Network Layer Protocols

Learn via video courses
Topics Covered

Overview

Network Layer is responsible for how a machine in a network can communicate with a machine in a different network. The primary goal of this layer is to deliver packets from a source to a destination. The network layer splits data into fragments(data packets) and sends these fragments, which are then combined once the processing is done. It uses various network layer protocols such as IPv4, IPv6, ICMP, etc., to transfer data to the destination. In the article, we will learn about these protocols in detail.

What is the Network Layer in the OSI Model?

There are two primary purposes of the network layer. The first one is to divide segments into network packets and then reassemble them on the receiving end. Another is to route packets across a physical network by determining the optimum path. The network layer uses logical network addresses (usually Internet Protocol addresses) to route packets to a destination node.

OSI Model in Newtwork Layer

Everything that has to do with inter-network connections happens at the network layer. Setting up data packet routes, checking whether a server on another network is up and running, and addressing and receiving IP packets from other networks are all part of this. As most of the internet data is sent through IP, this final step is likely the most crucial.

The network layer provides various services. Some of the services provided by the network layer are described below.

  • Guaranteed delivery:- This layer provides the service that ensures the packet will reach its intended destination.
  • Packet delivery within the bounded delay:- This service ensures that the packet arrives within a defined host-to-host delay limit.
  • Security:- The network layer uses a session key between the source and destination hosts to provide security. The payloads of datagrams delivered to the destination host are encrypted by the network layer of the source host. The payload is then decrypted by the network layer on the target host. The data integrity and source authentication services are maintained by the network layer in this manner.
  • In-Order packets:- This service guarantees that the packets arrive at their destination in the same sequence as they were sent.

How Do Network Layer Protocols Work?

The various network layer protocols are

ARP

Address resolution protocol converts a logical address(IP address) to a physical address(MAC address). If a host on its network wants to know the physical address of another host on the network, it sends an ARP query packet with the IP address and MAC address of the source host and IP address of the destination host and broadcasts it over the network. The ARP packet is received and processed by every host on the network, but only the intended recipient recognizes its own IP address in the request address and responds with the physical address.

The host holding the datagram stores the physical address in cache memory and adds it to the datagram header before sending it back to the sender. A datagram is a basic transfer unit of a packet-switched network. Header and payload portions are the typical organizational units of datagrams. Across a packet-switched network, datagrams offer a connectionless communication service.

Reverse ARP is a mechanism in which the host knows the remote host's MAC address but needs to know the IP address to interact.

ICMP

ICMP stands for Internet Control Message Protocol. It is a network diagnostic and error reporting protocol. ICMP is a protocol that is part of the IP protocol suite that employs IP as a carrier protocol because the ICMP packet is enclosed in an IP packet after it is constructed. ICMP is a best-effort non-reliable protocol, the same as IP. ICMP is one of the most essential network layer protocols.

Any network feedback is returned to the original host. If an error occurs on the network, it is reported using ICMP. There are dozens of diagnostic and error-reporting messages in the ICMP protocol. An IP datagram comprises the source and destination addresses, but it does not know the address of the last router it traveled through. As a result, ICMP can only deliver messages to the source, not to the routers in the immediate vicinity.

The ICMP protocol handles five types of errors

  • Destination unreachable
  • Source Quench
  • Time Exceeded
  • Parameter problems
  • Redirection

IPv4

Internet Protocol Version 4 is a network layer protocol that addresses and controls information and is used to transport packets in a network. To transport data packets across a network, IP and TCP work together. Each host is given a 32-bit IP address consisting of the network and host ID. The host number identifies a host on the network, assigned by a network administrator, whereas the network number identifies a network and is assigned by the internet. The IP is only responsible for delivering the packets, and TCP(a transport layer protocol) helps put them back in the correct order.

Types of IPv4

  • Classful:- In classful IP addressing, some bits are reserved for network ID, and the remaining bits are used to represent the host in the network. The classful IP addressing can be further classified into five classes: class A, class B, class C, class D, and class E.
  • Classless:- In classless IP, adding the number of network bits and number of host bits is variable and can be modified according to need. Classless addressing avoids the problem of IP address exhaustion that can arise with classful addressing. The format of classless IP addressing is x.u.v.z/n, where n represents the number of network bits.

IPv6

Internet Protocol Version 6 is the latest version of the Internet Protocol. It is a network layer protocol containing addressing and control information for packet routing. IPv6 was established to address the exhaustion of IPv4. To accommodate more levels of addressing, it raises the IP address size from 32 bits to 128 bits.

IPv6 has introduced Anycast addressing and removed the concept of broadcasting. Devices can self-acquire an IPv6 address and interact within that subnet using IPv6. The Dynamic Host Configuration Protocol (DHCP) servers are no longer reliant on this auto-configuration. The hosts can connect even if the DHCP server on that subnet is down.

IPv6 introduces a new mobility feature. Mobile IPv6-enabled devices can roam without having to change their IP addresses. IPv6 is currently in its early stages of development, but it is expected to totally replace IPv4 in the next years. IPv6 is now used by a small number of networks.

IGMP

It stands for Internet group message protocol. IGMP is a multicasting communication protocol that uses resources efficiently to broadcast message/data packets. Hosts and nearby routers use it for multicasting communication with IP networks. IGMP can be utilized in streaming media, games, or web conferencing tools since multicast communication can have multiple senders and receivers.

Functions of Network Layer

The network provides the following functionalities.

Host-to-host Data Delivery

The network layer is responsible for delivering data packets from source to destination. This layer provides the service that ensures the packet will reach its intended destination.

Logical Addressing

The network layer defines an addressing scheme to uniquely identify each device on the network. The network layer places the IP addresses of the sender and receiver in the header. Such an address distinguishes each device uniquely and universally. The header contains the network ID and the host ID of the network, which describes which device of the given network is the receiver.

Routing and Forwarding

Routing decides which route from source to destination is most appropriate. It chooses the shortest root between sender and receiver to forward data packets. Some widely used routing protocols are distance vector routing, link-state routing, and path vector.

Fragmentation

The network layer fragments the extensive data in fragments to forward from source to destination. It is done because each receiving node has some fixed capacity to accept data.

Congestion Control

When the data packets are flooded into the network in tremendous amounts, and the router is unable to route them properly, it causes aggregation of data packets into the network, which is referred to as congestion. The network layer is also responsible for controlling the congestion in the network and manipulating the flow of the network.

Conclusion

  • Network Layer is responsible for how a machine in a network can communicate with a machine in a different network.
  • There are various network layer protocols such as IPv4, IPv6, ICMP, etc., to transfer data to the destination.
  • There are two primary purposes of the network layer.
    • The first one is to divide segments into network packets and then reassemble them on the receiving end.
    • Another is to route packets across a physical network by determining the optimum path.
  • The various protocols used in the network layer are
    • ARP
    • ICMP
    • IPv4
    • Ipv6
    • IGMP
  • The Network layer provides various functionalities such as host-to-host delivery, Logical addressing, routing, fragmentation, and congestion control.