What is ARP (Address Resolution Protocol)?

What is ARP (Address Resolution Protocol)?

What is ARP (Address Resolution Protocol)?

ARP stands for address resolution protocol. 
Now this is a protocol that is used to resolve IP addresses to MAC addresses. 
The MAC address is a physical address of a device. 
It's a globally unique number that is assigned to every network interface card (NIC). 
Whenever a device needs to communicate with another device on a local area network (LAN) it needs the MAC address for that device and devices use ARP to acquire the MAC address for that device.


So as an example, 

Let's say that computer A wants to communicate with computer B.
Computer A already knows the IP address for computer B but in order to communicate with computer B it still needs its MAC address. 
An IP address is used to locate a device on a network and the MAC address is what identifies the actual device. 
In order to find the MAC address computer A will first look at its internal list called an ARP cache to see if computer B's IP address already has a matching MAC address. 

In fact we can check this ourselves at a Windows command prompt (CMD) by using the ARP utility and by typing "arp -a" and you can see in the output it has no entries at all the ARP cache is empty. (image 2)
Now computer A will send out a broadcast message out on the network asking every device which computer has the specific IP address and will ask for their MAC address. 
Then the computer that has the matching IP address will then respond back and tell computer A to its MAC address then once it receives the MAC address the communication can now take place between the two computers A & B.
Once computer A has the MAC address, it'll store this information in the ARP cache. 

Now let's check the same commands (arp -a) as before and now you can see that the IP address and matching MAC address have been added to the ARP cache. 
The ARP cache is used to make a network more efficient. 
It stores IP address to MAC address associations. 
Because if the next time it needs to communicate with a device on the network, it doesn't have to broadcast a message out on the entire network, it can just look in the ARP cache. 


There are also two different types of ARP entries.

1)dynamic
2)Static 

A dynamic entry is created automatically when a device sends out a broadcast message out on the network requesting a MAC address. 
Just like in the above example we just did. 
Dynamic entries are not permanent they are flushed out periodically so that the cache doesn't get filled up with too many entries that are not being used.

A static entry is where someone manually enters an IP address to MAC address association using the ARP command-line utility. 
For example let's create a static ARP entry. 
At a command prompt you would type arp -s and then the IP address followed by the MAC address. (arp -s 10.0.0. 90-02-7b-c2-c0-67)
Now if we look at the ARP cache again we would see our static ARP entry. (image 2)

Network administrators would use static entries to reduce any unnecessary ARP broadcast traffic on a network. 
For example static entries are ideal if you know that two devices are constantly going to be communicating with each other.
What is ARP (Address Resolution Protocol)?