Network Layer Protocols
Network Layer Protocols
The network layer, or OSI Layer 3, provides services to allow end devices to exchange data across the
network. To accomplish this end-to-end transport, the network layer uses four basic processes:
Addressing end devices - In the same way that a phone has a unique telephone number, end
devices must be configured with a unique IP address for identification on the network. An end device
with a configured IP address is referred to as a host.
Encapsulation - The network layer receives a protocol data unit (PDU) from the transport layer. In a
process called encapsulation, the network layer adds IP header information, such as the IP address
of the source (sending) and destination (receiving) hosts. After header information is added to the
PDU, the PDU is called a packet.
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 paths for 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 route the packet takes 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. This process of removing headers from lower
layers is known as de-encapsulation. 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 (OSI Layer 4), 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.
There are several network layer protocols in existence; however, only the following two are commonly
implemented as show in the figure:
packet overhead
The time it takes to transmit data on a packet-switched network. Each packet requires extra bytes of
format information that is stored in the packet header, which, combined with the assembly and
disassembly of packets, reduces the overall transmission speed of the raw data.
Characteristics of the IP protocol
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 in other layers.
Connectionless - No connection with the destination is established before sending data packets.
IP – Connectionless
The role of the network layer is to transport packets between hosts while placing as little burden on the
network as possible. The network layer is not concerned with, or even aware of, the type of
communication contained inside of a packet.
IP is connectionless, meaning that no dedicated end-to-end connection is created before data is sent.
Connectionless communication is conceptually similar to sending a letter to someone without notifying the
recipient in advance.
IP is connectionless and, therefore, requires no initial exchange of control information to establish an end-
to-end connection before packets are forwarded.
IP also does not require additional fields in the protocol data unit (PDU) header to maintain an established
connection. This process greatly reduces the overhead of IP. However, with no pre-established end-to-
end connection, senders are unaware whether destination devices are present and functional when
sending packets, nor are they aware if the destination receives the packet, or if they are able to access
and read the packet.
IP is often referred to as an unreliable or best-effort delivery protocol. This does not mean that IP
works properly sometimes and does not function well at other times, nor does it mean that it is a poor
data communications protocol. Unreliable simply means that IP does not have the capability to manage
and recover from undelivered or corrupt packets. This is because while IP packets are sent with
information about the location of delivery, it contains no information that can be processed to inform the
sender whether delivery was successful. There is no synchronization data included in the packet header
for tracking the order of packet delivery. There are also no acknowledgments of packet delivery with IP,
and there is no error control data to track whether packets were delivered without corruption. Packets
may arrive at the destination corrupted, out of sequence, or not at all. Based on the information provided
in the IP header, there is no capability for packet retransmissions if errors such as these occur.
If out-of-order or missing packets create problems for the application using the data, then upper layer
services, such as TCP, must resolve these issues. This allows IP to function very efficiently.
If reliability overhead were included in IP, then communications that do not require connections or
reliability would be burdened with the bandwidth consumption and delay produced by this overhead.
In the TCP/IP suite, the transport layer can use either TCP or UDP based on the need for reliability in
communication. Leaving the reliability decision to the transport layer makes IP more adaptable and
accommodating for different types of communication.
TCP, require that control data be exchanged to establish the connection. To maintain information about
the connection, TCP also requires additional fields in the PDU header.
IP – Media Independent
The network layer is also not burdened with the characteristics of the media on which packets are
transported. IP operates independently of the media that carry the data at lower layers of the protocol
stack. Any individual IP packet can be communicated electrically over cable, as optical signals over fiber,
or wirelessly as radio signals.
It is the responsibility of the OSI data link layer to take an IP packet and prepare it for transmission over
the communications medium. This means that the transport of IP packets is not limited to any particular
medium.
There is, 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). Part of the control communication between the data link layer and the network
layer is the establishment of a maximum size for the packet. The data link layer passes the MTU value up
to the network layer. The network layer then determines how large packets should be.
In some cases, an intermediate device, usually a router, must split up a packet when forwarding it from
one medium to a medium with a smaller MTU. This process is called fragmenting the packet or
fragmentation.
Encapsulating IP
IP encapsulates, or packages, the transport layer segment by adding an IP header. This header is used
to deliver the packet to the destination host. The IP header remains in place from the time the packet
leaves the network layer of the source host until it arrives at the network layer of the destination host.
The process of encapsulating data layer by layer enables the services at the different layers to
develop and scale without affecting other layers. This means that transport layer segments can
be readily packaged by IPv4 or IPv6 or by any new protocol that might be developed in the future.
Routers can implement these different network layer protocols to operate concurrently over a network to
and from the same or different hosts.
The routing performed by these intermediate device only considers the contents of the packet
header that encapsulates the segment. In all cases, the data portion of the packet, that is, the
encapsulated transport layer PDU, remains unchanged during the network layer processes.
IPv4 Packet
Payload - Contains the Layer 4 segment information and the actual data.
As shown in the figure, an IPv4 packet header consists of fields containing important information about
the packet. These fields contain binary numbers which are examined by the Layer 3 process. The binary
values of each field identify various settings of the IP packet.
Version - Contains a 4-bit binary value identifying the IP packet version. For IPv4 packets, this field
is always set to 0100.
Differentiated Services (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 first 6 bits identify the Differentiated
Services Code Point (DSCP) value that is used by a quality of service (QoS) mechanism. The last 2
bits identify the explicit congestion notification (ECN) value that can be used to prevent dropped
packets during times of network congestion.
Time-to-Live (TTL) - Contains an 8-bit binary value that is used to limit the lifetime of a packet. It is
specified in seconds but is commonly referred to as hop count. The packet sender sets the initial
time-to-live (TTL) value and is decreased by one each time the packet is processed by a router, or
hop. 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.
The traceroute command uses this field to identify the routers used between the source and
destination.
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 (0x01), TCP (0x06), and UDP (0x11).
Source IP Address - Contains a 32-bit binary value that represents the source IP address of the
packet.
Destination IP Address - Contains a 32-bit binary value that represents the destination IP address
of the packet.
The two most commonly referenced fields are the source and destination IP addresses. These fields
identify where the packet is from and where it is going. Typically these addresses do not change while
travelling from the source to the destination.