Network Layer Protocols

Network Layer Protocols

Every computer on a network has a unique IP address that allows it to be identified and addressed under Network Layer Protocols. An IP address is a logical Layer-3 (Network Layer) address. When a machine restarts, this address may change. At one point in time, a computer may have one IP and at another point in time, it may have a different IP.

TCP/IP supports the following Network Layer Protocols:

Address Resolution Protocol(ARP)

Address Resolution Protocol (ARP) is used to link the MAC address to an IP address. The MAC address etched on the NIC identifies each device on the network. As a result, we can conclude that devices require the MAC address in order to communicate over a local area network. It is simple to modify the MAC address. For example, if a machine’s NIC dies, the MAC address changes but the IP address remains the same. When an internet address is known, ARP is used to determine the node’s MAC address. The MAC address is a number that is used to identify a device. An IP address is a number that is used to identify a device on a network.

How does ARP work?

If a host wishes to discover another host’s physical address on its network, it sends an ARP query packet with the IP address 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 the IP address and responds with the physical address. The host that is holding the datagram stores the physical address in cache memory and adds it to the datagram header before sending it back to the sender.

Steps – ARP protocol

When a device wishes to interact with another device, it takes the following steps:

To see if an IP address has a matching MAC address, the device will first check its internet list, known as the ARP cache. It will use the command arp-a to check the ARP cache on the command prompt.

If the ARP cache is empty, the device broadcasts a message to the entire network, requesting a matching MAC address from each device.

The device with the matching IP address will then respond with its MAC address to the sender.

The communication between two devices can begin after the MAC address is received by the device.

The MAC address is kept in the ARP cache if the device receives the MAC address. Using the command arp -a, we can verify the ARP cache on the command prompt. ARP cache is used to make a network more efficient.

 

Two types of ARP entries:

  • Dynamic entry: When a sender broadcasts a message to the whole network, an entry is automatically produced. Dynamic entries are not permanent and are removed on a regular basis.
  • Static entry: It is an item in which the IP to MAC address relationship is manually entered using the ARP command utility.

Reverse Address Resolution Protocol (RARP)

If a host wishes to know its IP address, it sends out a RARP inquiry packet with its physical address to everyone on the network. The RARP packet is recognized by a RARP server on the network, which response with the host IP address. Reverse Address Resolution Protocol is the protocol that is used to obtain an IP address from a server. The RARP protocol uses a message format similar to the ARP protocol. RARP frames, like ARP frames, are contained in the data section of a frame and transferred from one machine to another.

Internet Control Message Protocol (ICMP)

The ICMP protocol is a network layer protocol that hosts and routers utilize to notify the sender of IP datagram faults. The echo test/reply method is used by ICMP to determine whether the target is reachable and responding. ICMP can handle both control and error messages, but its primary purpose is to report errors rather than to fix them. 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 sender receives error signals using the ICMP protocol. The errors are returned to the user processes via ICMP messages. ICMP messages are sent as part of an IP datagram.

Internet Group Message Protocol (IGMP)

Multicasting is supported by the IGMP protocol, which is utilized by both hosts and routers. The hosts and router use the IGMP protocol to identify which hosts in a LAN are members of a group. The IP layer includes IGMP, which has a fixed-size message. An IP datagram is used to encapsulate the IGMP message.

There are two types of communication supported by the IP protocol:

Unicasting: Unicasting is a type of communication in which just one sender and one receiver communicate.
As a result, we can call it one-to-one communication.

Multicasting: A sender may desire to send the same message to a large number of recipients at the same time.
Multicasting, or one-to-many communication, is the name given to this procedure.