Network Layer Protocols – Scaler Topics

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.

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

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, 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.

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.

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 travelled 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, addessing 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.