Address Resolution Protocol (ARP) is an important protocol of the network layer in the OSI model, which helps find the MAC (Media Access Control) address given the system’s IP address. The ARP’s main task is to convert the 32-bit IP address (for IPv4) to a 48-bit MAC address.
This protocol is mostly used to determine the hardware (MAC) address of a device from an IP address. It is also used when one device wants to communicate with some other device on a local network. The full form of ARP is Address Resolution Protocol.
In this networking tutorial, you will learn:
- What is ARP?
- How Address Resolution Protocol (ARP) works?
- Important ARP terms:
- Address Resolution Methods
- Types of ARP
- ARP Header:
- Advantages of using ARP
All OS in an IPv4 network keeps an ARP cache. When the host requests a MAC address to send a packet to another host in the LAN, it checks its ARP cache to check that the MAC address translation already presents.
Let us understand this concept with an example:
- Hosta P resolves protocol address for host U for protocol messages from an application on P sent to U.
- P does not resolve a protocol address for host U
- By using the internet layer, host P delivers to host U by routing through T1 and T2.
- Host P resolves the T1 hardware address.
- Network layer on host P passes packet containing destination protocol address for U for delivery to T1
- T1 delivers the packet to T2 which in turn forwards the packet to Host U.
- ARP Cache: After resolving the MAC address, the ARP sends it to the cache stored in a table for future reference. The subsequent communications can use the MAC address from the table.
- ARP Cache Timeout: It is the time for which the MAC address in the ARP cache can reside.
- ARP request: Broadcasting a packet over the network to validate whether we came across the destination MAC address or not.
- ARP response/reply: The MAC address response that the source receives from the destination aids in further communication of the data.
Association between a protocol address and a hardware address is known as binding.
There are three techniques used for this purpose:
- Table lookup – Bindings stored in memory with protocol address as the key. It uses the data link layer to check the protocol address to find the hardware address.
- Dynamic–This type of network messaging method is used for “just-in-time” resolution. Data link layer sends message requests in a hardware address. destination responds.
- Closed-form computation–In this method, a protocol address is based on a hardware address. Data link layer derives the hardware address from the protocol address.
Here are four types of Address Resolution Protocol, which is given below:
- Proxy ARP
- Gratuitous ARP
- Reverse ARP
- Inverse ARP
Let us learn them all in detail:
In the Proxy ARP method, Layer 3 devices can respond to ARP requests. This ARP type is configured router will respond to the target IP address and maps the router’s MAC address with the target IP address and sender when it is reached to its destination.
Gratuitous is another type of ARP request of the host. This type of ARP request helps the network to identify the duplicate IP address. Therefore, when an ARP request is sent by a router or switch to get its IP address, no ARP responses are received so that no other nodes can use the IP address allocated to that switch or router.
Reverse ARP (RARP)
Reverse ARP, also now called RARP, is a type of ARP networking protocol which is used by the client system in a LAN to request its IPv4 address from the ARP router table. The network admin mostly creates a table in the gateway-router, which helps determine the MAC address to that specific IP address.
Inverse ARP (InARP)
Inverse ARP is also called InARP, is a type of ARP used to find the nodes’ IP of addresses from the data link layer addresses. InARP is widely used for ATM networks frame relays where Layer 2 virtual circuit addressing acquired from Layer 2 signaling.
- Hardware Type–It is 1 for Ethernet.
- Protocol Type–It is a protocol used in the network layer.
- Hardware Address Length–It is the length in bytes so that it would be 6 for Ethernet.
- Protocol Address Length – Its value is 4 bytes.
- Operation Code indicates that the packet is an ARP Request (1) or an ARP Response (2).
- Senders Hardware Address – It is a hardware address of the source node.
- Senders Protocol Address -It is a layer 3 address of the source node.
- Target Hardware Address – It is used in a RARP request, which response impact both the destination’s hardware and layer 3 addresses.
- Target Protocol Address – It is used in an ARP request when the response carries both layer 3 addresses and the destination’s hardware.
Here are the pros/benefits of using ARP
- If you are using ARP, then MAC addresses can easily be known if you know the IP address of the same system.
- End nodes should not be configured to “know” MAC addresses. It can be found when needed.
- ARP’s goal is to enable each host on a network that allows you to build up a mapping between IP addresses and physical addresses.
- The set of mappings or table stored in the host is called ARP table or ARP cache.
❓ What happens if an ARP request is made for a non-existing host?
If the several ARP requests are made for a non-existing host, it will increase time intervals between requests. Eventually, ARP gives up.
⚡ What if a host sends an ARP request for its IP address?
The other machines respond (gratuitous ARP) as a normal ARP request. This helps to detect an IP address has already been assigned.
- ARP protocol helps to find the MAC (Media Access Control) address given the system’s IP address.
- Important ARP terms are: 1) ARP Cache 2)ARP Cache Timeout 3) ARP request 4) ARP response/reply
- Three types of ARP resolution techniques are: 1) Table lookup 2) Dynamic 3) Closed-form computation.
- Important ARP protocols are: 1) Proxy ARP 2) Gratuitous ARP 3) Reverse ARP 4) Inverse ARP.
- The components of ARP header are 1)Hardware Type 2) Protocol Type 3) Hardware Address Length 4) Protocol Address Length 5) Senders Hardware Address 6) Senders Protocol Address 7) Target Hardware Address 8) Target Protocol Address.