Network Layer Protocols - Computer Network

Network Layer Protocols (Full Explanation)

Network Layer Protocols Poster


Every computer connected to a network is assigned a unique IP address that allows it to be identified and addressed. An IP address functions as a logical address at Layer-3 (Network Layer). This address can change each time a computer is restarted. A computer may possess one IP address at a given moment and a different one at another time.

Address Resolution Protocol (ARP)

Address Resolution Protocol (ARP)


In order to communicate, a host must obtain the Layer-2 (MAC) address of the destination machine, provided that it is within the same broadcast domain or network. A MAC address is permanently embedded in the Network Interface Card (NIC) of a device and remains unchanged.

Conversely, an IP address in the public domain seldom changes. If the NIC is replaced due to a malfunction, the MAC address will also change. Therefore, for Layer-2 communication to occur, a mapping between the two addresses is necessary.

To discover the MAC address of a remote host within a broadcast domain, a computer that wants to start communication sends out an ARP broadcast message asking, "Who has this IP address?" Since this is a broadcast, all hosts on the network segment (broadcast domain) receive and process this packet. The ARP packet includes the IP address of the destination host that the sending host wishes to connect with. When a host receives an ARP packet intended for it, it responds with its own MAC address.

Once the host obtains the destination MAC address, it can establish communication with the remote host using the Layer-2 link protocol. This MAC to IP mapping is stored in the ARP cache of both the sending and receiving hosts. The next time they need to communicate, they can directly reference their respective ARP caches.

Reverse ARP is a process where a host knows the MAC address of a remote host but needs to find out the IP address to establish communication.

Internet Control Message Protocol (ICMP)

ICMP serves as a protocol for network diagnostics and error reporting. It is part of the IP protocol suite and utilizes IP as its carrier protocol. Once an ICMP packet is created, it gets encapsulated within an IP packet. Since IP operates as a best-effort, non-reliable protocol, ICMP shares this characteristic.

Any network feedback is relayed back to the originating host. In the event of a network error, ICMP is responsible for reporting it. This protocol encompasses numerous diagnostic and error reporting messages.

The ICMP-echo and ICMP-echo-reply messages are the most frequently utilized ICMP messages for verifying the reachability of end-to-end hosts. When a host gets an ICMP-echo request, it must respond with an ICMP-echo-reply. Should any issues arise within the transit network, ICMP will notify of those problems.

Internet Protocol Version 4 (IPv4)

IPv4 is a 32-bit addressing scheme that functions as the TCP/IP host addressing mechanism. This IP addressing system allows each host on the TCP/IP network to be uniquely identified.

IPv4 features a hierarchical addressing scheme that enables the division of the network into sub-networks, each accommodating a specific number of hosts. IP addresses are categorized into several classes:
  • Class A  - utilizes the first octet for network addresses and the last three octets for host addressing.
  • Class B  - employs the first two octets for network addresses and the last two for host addressing.
  • Class C  - uses the first three octets for network addresses and the last one for host addressing.
  • Class D  - offers a flat IP addressing scheme, differing from the hierarchical structure of the previous three classes.
  • Class E  - designated for experimental use.

IPv4 also defines specific address spaces for private addresses (which are not routable on the internet) and public addresses (which are provided by ISPs and are routable on the internet).

While IP is not inherently reliable, it does offer a Best-Effort-Delivery mechanism.

Internet Protocol Version 6 (IPv6)


The depletion of IPv4 addresses led to the development of the next generation Internet Protocol, known as IPv6. This protocol assigns 128-bit wide addresses to its nodes, offering an abundance of address space for use across the entire planet and even beyond.

IPv6 has brought in Anycast addressing while eliminating the broadcasting concept. It allows devices to automatically obtain an IPv6 address and communicate within their subnet. This self-configuration feature reduces reliance on Dynamic Host Configuration Protocol (DHCP) servers. Consequently, even if the DHCP server in that subnet fails, the hosts can still communicate with one another.

Another innovative feature of IPv6 is its mobility capability. Devices equipped with Mobile IPv6 can move freely without needing to change their IP addresses.

Currently, IPv6 is in a transitional phase and is anticipated to fully replace IPv4 in the coming years. At this moment, only a few networks operate on IPv6. There are several transition mechanisms available that enable IPv6-enabled networks to interact and navigate through different IPv4 networks seamlessly. These include:

- Dual stack implementation
- Tunneling
- NAT-PT