The Wayback Machine - https://web.archive.org/web/20241115031003/https://www.geeksforgeeks.org/how-address-resolution-protocol-arp-works/
Open In App

How Address Resolution Protocol (ARP) Works?

Last Updated : 27 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

When computer programs send or get messages, they usually use something called an IP address, which is like a virtual address. But underneath, the real talk happens using another type of address called a MAC address, which is like a device’s actual home address.

So, our goal is to find out the MAC address of where we want to talk to. That’s where ARP comes in handy. It helps by turning the IP address into the physical MAC address, so we can chat with other devices on the network

Most computer programs/applications use logical addresses (IP Addresses) to send/receive messages. However, the actual communication happens over the Physical Address (MAC Address) from layer 2 of the OSI model. So our mission is to get the destination MAC Address which helps communicate with other devices. This is where ARP comes into the picture; its functionality is to translate IP addresses into physical addresses.

ARP

ARP

What is Address Resolution Protocol (ARP)?

The acronym ARP stands for Address Resolution Protocol which is one of the most important protocols of the Data link layer in the OSI model. It is responsible to find the hardware address of a host from a known IP address. There are three basic ARP terms.

Note: ARP finds the hardware address, also known as the Media Access Control (MAC) address, of a host from its known IP address. 

Address Resolution Protocol

Address Resolution Protocol

ARP is essential in mapping IP addresses to MAC addresses, making it a vital networking concept. If you’re studying for GATE or seeking to deepen your understanding of network protocols like ARP, the GATE CS Self-Paced Course is designed to cover these concepts thoroughly with both theory and practical examples.

Important Terms Associated with ARP

  • Reverse ARP
  • Proxy ARP
  • Inverse ARP

Reverse ARP

Reverse Address Resolution Protocol is a protocol that is used in local area networks (LAN) by client machines for requesting IP Address (IPv4) from Router’s ARP Table. Whenever a new machine comes, which requires an IP Address for its use. In that case, the machine sends a RARP broadcast packet containing MAC Address in the sender and receiver hardware field.

Proxy ARP

Proxy Address Resolution Protocol work to enable devices that are separated into network segments connected through the router in the same IP to resolve IP Address to MAC Address. Proxy ARP is enabled so that the ‘proxy router’ resides with its MAC address in a local network as it is the desired router to which broadcast is addressed. In case, when the sender receives the MAC Address of the Proxy Router, it is going to send the datagram to Proxy Router, which will be sent to the destination device.

Inverse ARP

Inverse Address Resolution Protocol uses MAC Address to find the IP Address, it can be simply illustrated as Inverse ARP is just the inverse of ARP. In ATM (Asynchronous Transfer Mode) Networks, Inverse ARP is used by default. Inverse ARP helps in finding Layer-3 Addresses from Layer-2 Addresses.

How ARP Works?

Imagine a device that wants to communicate with others over the internet. What does ARP do? It broadcast a packet to all the devices of the source network. The devices of the network peel the header of the data link layer from the Protocol Data Unit (PDU) called frame and transfer the packet to the network layer (layer 3 of OSI) where the network ID of the packet is validated with the destination IP’s network ID of the packet and if it’s equal then it responds to the source with the MAC address of the destination, else the packet reaches the gateway of the network and broadcasts packet to the devices it is connected with and validates their network ID. The above process continues till the second last network device in the path reaches the destination where it gets validated and ARP, in turn, responds with the destination MAC address.

How-Address-Resolution-Protocol-ARP-works---gif-opt-(1)

ARP

  1. ARP Cache: After resolving the MAC address, the ARP sends it to the source where it is stored in a table for future reference. The subsequent communications can use the MAC address from the table.
  2. ARP Cache Timeout: It indicates the time for which the MAC address in the ARP cache can reside.
  3. ARP request: This is nothing but broadcasting a packet over the network to validate whether we came across the destination MAC address or not.
    • The physical address of the sender.
    • The IP address of the sender.
    • The physical address of the receiver is FF:FF:FF:FF:FF: FF or 1’s.
    • The IP address of the receiver.
  4. ARP response/reply: It is the MAC address response that the source receives from the destination which aids in further communication of the data.
  • CASE-1:
    • The sender wants to send a packet to another host on the same network.
    • Use ARP to find another host’s physical address.
  • CASE-2:
    • The sender is a host and wants to send a packet to another host on another network.
    • The sender looks at its routing table.
    • Find the IP address of the next hop (router) for this destination.
    • Find the IP address of the next hop (router) for this destination.
  • CASE-3:
    • The sender is a router and received a datagram.
    • The router checks its routing table.
    • Calculate the IP of the next router.
    • Use ARP to find the next router’s physical address.
  • CASE-4:
    • The sender is a router that has received a datagram destined for a host in the same network.
    • Use ARP to find this host’s physical address.

Note: An ARP request is broadcast, and an ARP response is a Unicast. 

Test Yourself

Internet Schema 1

Internet Schema 1

Connect two PC, say A and B with a cross cable. Now you can see the working of ARP by typing these commands: 

1. A > arp -a

There will be no entry at the table because they never communicated with each other. 

Blank Entry Table ARP

Blank Entry Table ARP

2. A > ping 192.168.1.2

IP address of destination is 192.168.1.2
Reply comes from destination but one
packet is lost because of ARP processing.
Packet Loss ARP

Packet Loss ARP

Now, entries of the ARP table can be seen by typing the command. This is what the ARP table looks like: 

ARP Table

ARP Table

Types of ARP

A communication protocol called Address Resolution Protocol (ARP) is used to determine a device’s MAC (Media Access Control) address based on its IP address. There are mainly 4 types of ARP available:

1. Proxy ARP

A Layer 3 device can reply to an ARP request for a target that is on a different network than the sender by using a technique called proxy ARP. In response to the ARP, the router that has been set for Proxy ARP maps its MAC address to the target IP address, deceiving the sender into believing that the message has arrived at destination.

Because the packets have the required information, the proxy router at the backend forwards them to the correct location.

2. Gratuitous ARP

The host’s ARP request known as “gratuitous ARP” aids in locating duplicate IP addresses. This is a broadcast request for the router’s IP address. All other nodes are unable to use the IP address assigned to a switch or router in the event that it sends out an ARP request to obtain its IP address and receives no ARP answers in return. However, another node uses the IP address assigned to the switch or router if it sends an ARP request for its IP address and gets an ARP response.

3. Reverse ARP

In a local area network (LAN), the client system uses this networking protocol to ask the ARP gateway router table for its IPv4 address. The network administrator creates a table in the gateway-router that is used to correlate the IP address with the MAC address.

4. Inverse ARP

The purpose of inverse ARP, which is the opposite of ARP, is to deduce the nodes’ IP addresses from their data link layer addresses. Frame relays and ATM networks, where Layer 2 virtual circuit addressing is frequently obtained from Layer 2 signalling, are the primary applications for them. These virtual circuits can be used with the necessary Layer 3 addresses accessible.

Relationship Between ARP , DNS and DHCP

As was previously noted, IP addresses are dynamic by design since doing so protects users’ privacy and security. IP address changes, though, shouldn’t happen at random. An IP address should be assigned according to rules from a predetermined range of numbers that are available in a particular network. By doing this, problems like two machines getting the same IP address are avoided.

The Dynamic Host Configuration Protocol, or DHCP, is the name given to the regulations. Because IP addresses are required to do an internet search, they are significant as computer identities. Users utilise alphabetical names while searching for a domain name or Uniform Resource Locator (URL).

Computers, on the other hand, link a domain name to a server using the numeric IP address. In order to link the two, an IP address is converted from a bewildering string of digits into a more legible, intelligible domain name by use of a Domain Name System (DNS) server, and vice versa.

ARP Spoofing and ARP Cache Poisoning

ARP Spoofing is a type of falseness of a device in order to link the attacker’s MAC Address with the IP Address of the computer or server by broadcasting false ARP messages by the hacker. Upon successful establishment of the link, it is used for transferring data to the hacker’s computer. It is simply called Spoofing. ARP can cause a greater impact on enterprises. ARP Spoofing attacks can facilitate other attacks like:

Local Area Network that uses ARP is not safe in the case of ARP Spoofing, this is simply called as ARP Cache Poisoning.

History and Future of ARP

ARP was first talked about in a document called Request for Comments 826, written by David C. Plummer in November 1982. Back then, there was a problem with figuring out addresses because Ethernet, the popular network technology, needed 48-bit addresses.

But now, with IP version 6 (IPv6) addresses, which are much longer at 128 bits, we use something called the Neighbor Discovery protocol instead of ARP to get configuration info. Even though IPv4 addresses are still more common, IPv6 is getting more popular, especially with the rise of Internet of Things (IoT) devices that need IP addresses. Neighbor Discovery works in a different layer of the network and uses a protocol called Internet Control Message Protocol version 6 to find nearby devices.

Advantages of Using ARP

  • Efficient Communication : ARP helps devices communicate efficiently by translating IP addresses into MAC addresses, allowing seamless communication on a network.
  • Dynamic Network Updates : ARP dynamically updates its cache with MAC address information, allowing for changes in network topology without manual intervention.
  • Scalability : ARP scales well with network size, enabling devices to communicate effectively in both small and large networks.
  • Compatibility : ARP is a standard protocol used across different types of networks, ensuring compatibility and interoperability among various devices and systems.

Disadvantages of Using ARP

  • Security : ARP operates at a low level and can be vulnerable to various attacks, such as ARP spoofing, where attackers copy devices on the network to intercept or manipulate data.
  • Broadcast Traffic : ARP uses broadcast messages to discover MAC addresses, which can lead to increased network congestion, especially in large networks.
  • Limited Security Features : ARP lacks robust security features, making it challenging to authenticate and verify the identity of devices on the network, leaving it susceptible to attacks.

Conclusion

In conclusion, ARP helps computers find each other’s physical addresses on a network so they can communicate effectively. ARP (Address Resolution Protocol) is like a translator for computers on a network. When one computer wants to talk to another, it needs to know the other computer’s physical address (MAC address). But all it has is the other computer’s IP address (like its home address). So, ARP steps in and asks, “Hey, who has this IP address?” The computer with that IP address responds with its MAC address, and then they can chat.

Frequently Asked Question on ARP – FAQs

What is MTM attack?

A “man in the middle” assault is one in which the hacker or attacker establishes a connection with the victims in order to communicate with them or maybe intercept all of the victims’ data packets. In this instance, the victims believe they are speaking with one another, but in actuality, the communication is being controlled by the malevolent attacker or hacker; in other words, a third party is in place to oversee and manage the communication flow between the client and server.

What is ARP cache?

An IP address and a Media Access Control (MAC) address for a physical computer or device on a local network are linked by use of an Address Resolution Protocol cache (ARP cache), which is a data repository. The ARP cache aids in directing packets to the appropriate endpoint and can store information for both Ethernet and wireless routing.

What is ARP time-out?

Network hosts maintain the Address Resolution Protocol (ARP) table, which retains ARP entries for a few hours.

What is ARP Spoofing?

Spoofing is a kind of attack where hackers infiltrate the target user’s system and utilise their trust to propagate dangerous malware and steal data, including PINs and passwords, that is saved on the system.In spoofing, the hacker’s primary goal is to psychologically influence the victim.

Is ARP provide security?

No ARP is not secure itself.



Previous Article
Next Article

Similar Reads

ARP, Reverse ARP(RARP), Inverse ARP (InARP), Proxy ARP and Gratuitous ARP
Prerequisite IP Addressing, Introduction of MAC Addresses, Basics of Address Resolution Protocol (ARP) In this article, we will discuss about whole ARP-family, which are ARP, RARP, InARP, Proxy ARP and Gratuitous ARP. Let's try to understand each one by one. 1. Address Resolution Protocol (ARP) -Address Resolution Protocol is a communication protoc
6 min read
What is ARP Spoofing? - ARP poisoning Attack
The ARP Poisoning, also known as ARP Spoofing, is a type of cyberattack that takes advantage of the ARP (Address Resolution Protocol). ARP is a protocol that maps an IP address to a MAC address within a local network. However, ARP lacks authentication mechanisms, and this is what the attack exploits. The attacker sends fake ARP responses to a speci
5 min read
ARP Spoofing and ARP Poisoning
In this article, we will learn about the difference between ARP Spoofing and ARP Poisoning. We will explore them and understand the importance of these two malicious attacks in the context of network security. Before diving into the difference between ARP Spoofing and ARP Poisoning let's understand these topics in detail. What is ARP?ARP or Address
5 min read
Why is the IP address called a "logical" address, and the MAC address is called a "physical" address?
Let us try to deeply understand, why IP address is known as "Logical" while, MAC Address is known as "Physical" address. The IP address and the MAC address are both used for addressing and identifying devices on a computer network, but they serve different purposes and operate at different levels of the network stack. An IP address is a logical add
7 min read
IP address as logical address and MAC address as Physical address
Overview :IP addresses and MAC addresses are essential for data communication. Assume there are two networks. The first network has three devices: A, B, C and the second network has three devices: X, Y, Z. If a device A from the first network wishes to send data to a device Y in the second network, it must first determine where Y is located in the
6 min read
ARP Protocol Packet Format
Pre-requisites: How Address Resolution Protocol (ARP) works? ARP is a communication mechanism that is used to translate a network address, such as an IP address, to a physical (MAC) address on a local network. ARP packets are transmitted and received on a network to achieve this mapping. An ARP packet's format, also known as an ARP packet header, h
2 min read
ARP Protocol
ARP (Address Resolution Protocol) is an important protocol that plays an important role in the networking world. When working with your network systems, this protocol helps to identify specified network devices and find their addresses. Its main purpose is to duly transport data packets over the network, allowing them to move between devices connec
8 min read
Address Resolution in DNS (Domain Name Server)
Prerequisite - Domain Name Server Mapping a domain name to an IP Address is known as Name-Address Resolution. The Domain Name Server (DNS) Resolver performs this operation by consulting name servers. Mapping name to an address or an address to a name is called name-address resolution. RESOLVERDNS is designed as a client -server application.A host t
8 min read
How Point To Point Protocol Works?
Answer: Point to Point Protocol also known as (PPP), it is a protocol that operated at data link layer to connect network devices. Point to point protocol makes use of CHAP, LCP and NCP protocol.Below is the working of Point to Point protocol: Step 1: Initiation and Physical ConnectionOne node in the communication, initiates a connection request to
2 min read
Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Both the Stop and Wait protocol and the Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between the Stop-and-wait protocol and the Sliding window protocol is that in the Stop-and-Wait Protocol, the sender sends one frame and waits for acknowledgment from the receiver whereas in the sliding wi
5 min read
Difference between Border Gateway Protocol (BGP) and Routing Information Protocol (RIP)
When dealing with network routing, it's crucial to understand the various protocols that help direct traffic across complex networks. Two significant protocols in this space are the Border Gateway Protocol (BGP) and the Routing Information Protocol (RIP). Each serves different purposes and operates under different principles. This article explores
5 min read
Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
Data transfer is the most common task in network and system communications, and they involve transfer of files using two means i.e the File Transfer Protocol (FTP) and the Secure File Transfer Protocol (SFTP). FTP is a commonly applied protocol that enables files to be transferred through a network from one computer to another, but FTP is unsecure
5 min read
Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP), are designed to avoid network loops in Ethernet. It provide loop-free logical topology. They were both designed to provide network reliability and particularly avoid broadcast radiation, but the major differences are on the rate, functionality and versatility. In this article we
5 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
SLIP and PPP, which are the widely used serial connection techniques, help to connect the distant devices of the network. The fullform of SLIP is Session Layer Internetworking Protocol. SLIP being a primitive protocol put into use during the early connections to the Internet, when there was not much overhead. PPP is slightly more complex as the pro
6 min read
MITM (Man in The Middle) Attack using ARP Poisoning
Introduction :Man In The Middle Attack implies an active attack where the attacker/Hacker creates a connection between the victims and sends messages between them or may capture all the data packets from the victims. In this case, the victims think that they are communicating with each other, but in reality, the malicious attacker/hacker controls t
5 min read
How to Avoid ARP Poisoning?
Many cyber-attacks take place by exploiting the weaknesses in the network. ARP poisoning is also one such cyber-attack. It exploits the Address Resolution Protocol (ARP) to attack network traffic. Before we go in-depth to understand the concept of ARP poisoning, let us first understand the ARP protocol. ARP Protocol:In earlier days of computer netw
6 min read
What is Dynamic ARP Inspection?
There are various ways in which an attacker tries to enter the network to steal confidential information, or they try to choke the network by flooding it with unwanted requests. A network security administrator works to provide security to the network. ARP spoofing is one of the ways in which attackers poison the network. Dynamic ARP inspection is
4 min read
Difference between ARP and RARP
In Address Resolution Protocol (ARP), Receiver's MAC address is fetched. Through ARP, 32-bit IP address mapped into 48-bit MAC address. Whereas, In Reverse Address Resolution Protocol (RARP), IP address is fetched through server. Through RARP, 48-bit MAC address of 48 bits mapped into 32-bit IP address. In this article we will see difference betwee
4 min read
MAC Address and Random MAC Address
MAC Addresses are the address which are specified by the Manufacturer.MAC address help in communicating with the devices with communicating with other devices over the network. They are 12 digit hexadecimal numbers in which first three set bits specify the manufacturer of the device and last 3 specify the specific device. Random MAC Address They ar
3 min read
Why Do We Need IP Address if We Have Already MAC Address?
Answer: The network allots an IP address to every connected device making sure that every device can be identified separately within the network. Each device is identified by its MAC address, which cannot be shared by two devices. The MAC address is assigned by the embedded Network Interface Card (NIC) of each device and cannot be altered once set.
1 min read
What is Physical Address and Logical Address in Networking?
A physical address is a unique identifier given to network interfaces for communication over a physical network segment. A logical address is a unique address assigned to each networked device to identify its location and enable routing. In this article, we will discuss Physical Address and Logical Address. What is a Physical Address?The physical a
5 min read
Difference Between Network Address Translation (NAT) and Port Address Translation (PAT)
In the world of networking, most of the uses of IP addresses are important due to the limited availability of IPv4 addresses which is a part of network address translation. Two technologies that have been developed to address this problem are Network Address Translation and Port Address Translation. These technologies not only help to keep IP addre
6 min read
Difference between 3-address instruction and 1-address instruction
In computer architecture, instruction formats are very important elements which describe how the operational functions in the CPU are done. Two general forms of instruction representations are 3-address instruction and 1-address instruction. These formats differ with the number of addresses or operands they can undertake and therefore the level of
5 min read
Difference between 2-address instruction and 1-address instructions
When we convert a High-level language into a low-level language so that a computer can understand the program we require a compiler. The compiler converts programming statements into binary instructions. Instructions are nothing but a group of bits that instruct the computer to perform some operation. An instruction has two fields Opcode and Operan
5 min read
Difference between 3-address instruction and 0-address instruction
According to how many addresses an instruction consumes for arguments, instructions can be grouped. Two numerous kinds of instructions are 3 address and 0 address instructions. It is crucial to comprehend the distinction between these two, in order to know how different processors function in relation to data processing. By the end of this article,
4 min read
Difference between 3-address instruction and 2-address instructions
In computer architecture, instructions are the basic building blocks of execution that manually inform records how records is processed through the CPU. Three-operand instructions and two-address instructions differ in how they specify operands for acting operations, such as addition or multiplication. A three-address preparation has 3 operands: tw
8 min read
How do You Calculate the Subnet Address from an IP Address and Subnet Mask?
To calculate the subnet address from an IP address and subnet mask we first convert both into its binary form and perform the bitwise AND operation between IP address and subnet mask. What is a Subnet Mask?A subnet mask is a 32-bit number that separates the IP address into two parts: the network portion and the host portion. It determines which par
2 min read
Difference Between MAC Address and IP Address
MAC Address and IP Address are used to uniquely define a device on the internet. NIC Card Manufacturer provides the MAC Address, on the other hand, the Internet Service Provider provides the IP Address. In this article, we will learn about MAC Addresses, IP Addresses, and their differences. What is MAC Address?MAC, or Media Access Control is a uniq
6 min read
Article Tags :
three90RightbarBannerImg