Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 6 Network layer (4. A router is a computer (Just like computers,…
Chapter 6 Network layer
1. Intro
Layer 3 provides services to allow end devices to exchange data across the network.
Basic processes
Addressing end devices
- End devices must be configured with a unique IP address for identification on the network.
Encapsulation
- The network layer encapsulates the PDU from the transport layer into a packet. The encapsulation process adds IP header information, such as the IP address of the source (sending) and destination (receiving) hosts.
Routing
- The network layer provides services to direct packets to a destination host on another network. To travel to other networks, the packet must be processed by a router. The role of the router is to select the best path and direct packets toward the destination host in a process known as routing. A packet may cross many intermediary devices before reaching the destination host. Each router a packet crosses to reach the destination host is called a hop.
De-encapsulation
- When the packet arrives at the network layer of the destination host, the host checks the IP header of the packet. If the destination IP address within the header matches its own IP address, the IP header is removed from the packet. After the packet is de-encapsulated by the network layer, the resulting Layer 4 PDU is passed up to the appropriate service at the transport layer.
Unlike the transport layer, which manages the data transport between the processes running on each host, network layer protocols specify the packet structure and processing used to carry the data from one host to another host.
Operating without regard to the data carried in each packet allows the network layer to carry packets for multiple types of communications between multiple hosts.
2 Network Layer Protocols
IP
IP was designed as a protocol with
low overhead
. It provides only the functions that are necessary to
deliver a packet from a source to a destination
over an interconnected system of networks
The protocol was not designed to track and manage the flow of packets
. These functions, if required, are performed by other protocols at other layers, primarily TCP at Layer 4.
Characteristics
Connectionless
: No connection with the destination is established before sending data packets.
Best Effort
: IP is inherently unreliable because packet delivery is not guaranteed.
Media independent
: Operation is independent of the medium carrying the data.
However
, one major characteristic of the media that the network layer considers: the
maximum size of the PDU
that each medium can transport.
This characteristic is referred to as the maximum transmission unit (
MTU
)
The data link layer passes the MTU value up to the network layer. The network layer then determines how large packets can be.
In some cases, an intermediate device, usually a router, must split up a packet when forwarding it from one medium to another medium with a smaller MTU. This process is called fragmenting the packet or
fragmentation
.
Versions
IPv4
Important fields
Version
- Contains a
4-bit
binary value set to
0100
that identifies this as an IP version 4 packet.
Differentiated Services or
DiffServ
(DS) - Formerly called the
Type of Service (ToS
) field, the DS field is an
8-bit
field used to determine the priority of each packet. The six most significant bits of the DiffServ field is the Differentiated Services Code Point (
DSCP
) and the last two bits are the Explicit Congestion Notification (
ECN
) bits.
Diffserv is a set of technologies that a allows a services provider to offer diverse levels of Quality of Service (
QoS
) to different clients and traffic
4 more items...
Time-to-Live (
TTL
) - Contains an
8-bit
binary value that is used to limit the lifetime of a packet. The packet sender sets the initial TTL value, and it is decreased by one each time the packet is processed by a router. If the TTL field decrements to zero, the router discards the packet and sends an Internet Control Message Protocol (
ICMP
) Time Exceeded message to the source IP address
Protocol
- Field is used to identify the next level protocol. This
8-bit
binary value indicates the data payload type that the packet is carrying, which enables the network layer to pass the data to the appropriate upper-layer protocol. Common values include ICMP (1), TCP (6), and UDP (17).
Source IPv4 Address
- Contains a 32-bit binary value that represents the source IPv4 address of the packet. The source IPv4 address is always a unicast address.
Destination IPv4 Address
- Contains a 32-bit binary value that represents the destination IPv4 address of the packet. The destination IPv4 address is a unicast, multicast, or broadcast address.
Header Checksum
- A value calculated based on the contents of the IP header. Used to determine if any errors have been introduced during transmission.
Options and Padding
- A field that varies in length from 0 to a multiple of 32-bits. If the option values are not a multiple of 32-bits, 0s are added or padded to ensure this field contains a multiple of 32 bits.
IP Header Length
: A 4-bit field containing the length of the IP header in 32-bit increments. The minimum length of an IP header is 20 bytes, or five 32-bit increments. The maximum length of an IP header is 24 bytes, or six 32-bit increments.
Therefore, the header length field should contain either 5 or 6
.
Total Length
- Specifies the length of the IP packet that includes the IP header and the user data. The length field is 2 bytes, so the maximum size of an IP packet is 216 – 1 or 65,535 bytes.
Identifier(16b), Flags(3), and Fragment Offset(13)
: These fields are used to fragment and reassemble packets.
Limitations
IP address depletion
- IPv4 has a limited number of unique public IPv4 addresses available
Internet routing table expansion
- A routing table is used by routers to make best path determinations. As the number of servers connected to the Internet increases, so too does the number of network routes. These IPv4 routes consume a great deal of memory and processor resources on Internet routers
Lack of end-to-end connectivity
- Network Address Translation (NAT) is a technology commonly implemented within IPv4 networks. NAT provides a way for multiple devices to share a single public IPv4 address. However, because the public IPv4 address is shared, the IPv4 address of an internal network host is hidden. This can be problematic for technologies that require end-to-end connectivity.
IPv6
IPv6 overcomes the limitations of IPv4 and is a powerful enhancement with features that better suit current and foreseeable network demands
Improved packet handling
- The IPv6 header has been simplified with fewer fields.
Increased address space
- IPv6 addresses are based on
128-bit
hierarchical addressing as opposed to IPv4 with 32 bits.
IPv6 address space provides 340,282,366,920,938,463,463,374,607,431,768,211,456, or 340 undecillion addresses, which is roughly equivalent to every grain of sand on Earth
Eliminates the need for NAT
- With such a large number of public IPv6 addresses, NAT between a private IPv4 address and a public IPv4 is not needed. This avoids some of the NAT-induced application problems experienced by applications requiring end-to-end connectivity.
IPv6 packet headers
Version
- This field contains a 4-bit binary value set to 0110 that identifies this as an IP version 6 packet.
Traffic Class
- This 8-bit field is equivalent to the IPv4 Differentiated Services (DS) field.
Flow Label
- This 20-bit field suggests that all packets with the same flow label receive the same type of handling by routers.
Payload Length
- This 16-bit field indicates the length of the data portion or payload of the IPv6 packet.
Next Header
- This 8-bit field is equivalent to the IPv4 Protocol field. It indicates the data payload type that the packet is carrying, enabling the network layer to pass the data to the appropriate upper-layer protocol.
Hop Limit
- This 8-bit field replaces the IPv4 TTL field. This value is decremented by a value of 1 by each router that forwards the packet. When the counter reaches 0, the packet is discarded, and an ICMPv6 Time Exceeded message is forwarded to the sending host, indicating that the packet did not reach its destination because the hop limit was exceeded.
Source IPv6 Address
- This 128-bit field identifies the IPv6 address of the sending host.
Destination IPv6 Address
- This 128-bit field identifies the IPv6 address of the receiving host.
An IPv6 packet may also contain extension headers (EH), which provide optional network layer information. Extension headers are optional and are placed between the IPv6 header and the payload. EHs are used for fragmentation, security, to support mobility and more.
Unlike IPv4, routers do not fragment routed IPv6 packets.
IPv5
Ok, there are almost no IPv4s, why aren’t we moving to the IPv5? Why we skipped it? The reason is that the IPv5 doesn’t exist. It never made it to become one of the IP protocols.
It was planned as a streaming protocol
, and it got to its second version ST2 (Stream Protocol II). Its packets had the IP version 5 ID but eventually died as a draft. To evade confusion, the next protocol was named IPv6.
3. Routing
How a host Routes
A host can send a packet to:
Itself
: A host can ping itself by sending a packet to a special IPv4 address of
127.0.0.1
, which is referred to as the loopback interface. Pinging the
loopback
interface tests the TCP/IP protocol stack on the host.
Local host
- This is a host on the same local network as the sending host. The hosts share the same network address.
Remote host
- This is a host on a remote network. The hosts do not share the same network address.
When a source device sends a packet to a remote destination device, then the help of routers and routing is needed
Routing
is the process of identifying the best path to a destination.
The router connected to the local network segment is referred to as the
default gateway
.
The default gateway is the network device that can route traffic to other networks.
It has a local IP address in the same address range as other host on the network
A host's
routing table
will typically include a default gateway.
Host Routing Tables
On a Windows host, the
route print
or
netstat -r
command can be used to display the host routing table. Both commands generate the same output.
IPv6 Route Table
- Lists all known IPv6 routes, including direct connections, local network, and local default routes.
IPv4 Route Table
- Lists all known IPv4 routes, including direct connections, local network, and local default routes.
Interface List
- Lists the Media Access Control (MAC) address and assigned interface number of every network-capable interface on the host, including Ethernet, Wi-Fi, and Bluetooth adapters
When a host sends a packet to another host, it will use its routing table to determine where to send the packet
If the destination host is on a remote network, the packet is forwarded to the
default gateway.
When a packet arrives at the default gateway, the router looks at its routing table to determine where to forward packets.
The routing table
of a router
can store information about:
Directly-connected routes
- These routes come from the active router interfaces. Routers add a directly connected route when an interface is configured with an IP address and is activated. Each of the router's interfaces is connected to a different network segment.
Remote routes
- These routes come from remote networks connected to other routers. Routes to these networks can be manually configured on the local router by the network administrator or dynamically configured by enabling the local router to exchange routing information with other routers using a dynamic routing protocol.
Default route
– Like a host, routers also use a default route as a
last resort
if there is no other route to the desired network in the routing table.
IPv4 Router Routing Table
The
R1#show ip route
command can be used to display the router’s IPv4 routing table
If there are two or more possible routes to the same destination, the metric is used to decide which route appears in the routing table.
Remote Network Routing Table Entries
Directly Connected Routing Table Entries
L
- Identifies that this is a local interface. This is the IPv4 address of the interface on the router.
C
- Identifies a directly-connected network. Directly-connected networks are automatically created when an interface is configured with an IP address and activated.
4. A router is a computer
Cisco routers are designed to address the needs of many different types of businesses and networks
Branch
- Teleworkers, small businesses, and medium-size branch sites. Includes Cisco Integrated Services Routers (ISR) G2 (2nd generation).
WAN
- Large businesses, organizations, and enterprises. Includes the Cisco Catalyst Series Switches and the Cisco Aggregation Services Routers (ASR).
Service Provider
- Large service providers. Includes Cisco ASR, Cisco CRS-3 Carrier Routing System, and 7600 Series routers.
Just like computers, tablets, and smart devices, routers also require:
Operating systems (
OS
): The Cisco Internetwork Operating System (IOS) is the system software used for most Cisco devices
RAM
- This is volatile memory used in Cisco routers to store applications, processes, and data needed to be executed by the CPU. Cisco routers use a fast type of RAM called synchronous dynamic random access memory (SDRAM)
ROM
- This non-volatile memory is used to store crucial operational instructions and a limited IOS. Specifically, ROM is
firmware embedded
on an integrated circuit inside the router which can only be altered by Cisco. Click ROM in the figure to view more information.
NVRAM
– This is non-volatile memory is used as the permanent storage for the startup configuration file (startup-config).
Flash
- This non-volatile computer memory used as permanent storage for the IOS and other system related files such as log files, voice configuration files, HTML files, backup configurations, and more. When a router is rebooted, the IOS is copied from flash into RAM.
A router has access to volatile or non-volatile memory storage. Volatile memory requires continual power to maintain its information. When the router is powered down or restarted, the content is erased and lost. Non-volatile memory retains its information even when a device is rebooted.
Bootset Files
Router Bootup Process
The
show version
command displays information about the version of the Cisco IOS software currently running on the router, the version of the bootstrap program, and information about the hardware configuration, including the amount of system memory.
1. Perform the POST and load the bootstrap program
During the
Power-On Self-Test
(POST), the router executes diagnostics from ROM on several hardware components, including the CPU, RAM, and NVRAM. After the POST, the bootstrap program is copied from ROM into RAM.
The main task of the bootstrap program is to locate the Cisco IOS and load it into RAM.
At this point, if you have a console connection to the router, you begin to see the output on the screen.
2. Locate and load the Cisco IOS software.
The IOS is typically stored in flash memory and is copied into RAM for execution by the CPU. If the IOS image is not located in flash, then the router may look for it using a Trivial File Transfer Protocol (TFTP) server. If a full IOS image cannot be located, a limited IOS is copied into RAM, which can be used to diagnose problems and transfer a full IOS into Flash memory.
3. Locate and load the startup configuration file or enter setup mode.
The bootstrap program then copies the startup configuration file from NVRAM into RAM. This becomes the running configuration. If the startup configuration file does not exist in NVRAM, the router may be configured to search for a TFTP server. If a TFTP server is not found, then the router displays the setup mode prompt.
4. Configuration
SWITCH
SWITCH
Default Gateway for a Switch
Layer 2 switch does not require an IP address to function properly. However, if you wish to connect to the switch and administratively manage it over multiple networks, you will need to configure the SVI with an IPv4 address, subnet mask, and default gateway address.
To configure a default gateway on a switch, use the
SW(config)#ip default-gateway
global configuration command.
ROUTER
Configure Router Interfaces
The
show ip interface brief
command output displays all interfaces, their IPv4 address, and their current status. The configured and connected interfaces should display a Status of “up” and Protocol of “up”. Anything else would indicate a problem with either the configuration or the cabling.
show ip route
- Displays the contents of the IPv4 routing table stored in RAM.
show interfaces
- Displays statistics for all interfaces on the device.
show ip interface
- Displays the IPv4 statistics for all interfaces on a router
https://aprendederedes.com/redes/ip/cabecera-ip/