Address Resolution Protocol (ARP)¶
https://www.youtube.com/watch?v=NpiORFxyM4c
- ARP is a protocol for mapping an IP address to a physical MAC address on a local area network.
- Program used by one device to find another device's MAC address based on that device's IP
- Device's maintain ARP Cache tables mapping IP to MAC
arp -a
lists table
How does ARP work?
Client
(192.168.1.10
) wants to communicate withServer
(192.168.1.50
)Client
knowsServer
has IP of192.168.1.50
and is local.Client
broadcasts packet to all IPs:- "Are you
192.168.1.50
? Please send MAC"- IP Source:
192.168.1.10
- MAC Source:
oe:cd:ef:12:34:56
- IP Dest:
192.168.1.50
- MAC Dest:
ff:ff:ff:ff:ff:ff
(broadcast)
- IP Source:
- For each device that 'hears' broadcast: if not
192.168.1.50
silently ignore packet
- "Are you
Server
'hears' packet - sends Unicast (1-to-1 communication) toClient
- IP Source:
192.168.1.50
- MAC Source:
fa:ed:db:91:11:19
- IP Dest:
192.168.1.10
- Mac Dest:
oe:cd:ef:12:34:56
(unicast)
- IP Source:
Client
confirms by sendServer
a request- IP Source:
192.168.1.10
- MAC Source:
oe:cd:ef:12:34:56
- IP Dest:
192.168.1.50
- MAC Source:
fa:ed:db:91:11:19
(unicast) Client
updates ARP Cache table for future reference
- IP Source:
ARP Summary¶
- Layer 2 protocol (aruably as Layer 2.5 as it exists between layers)
- Uses Layer 3 IP address to find Layer 2 MAC address
- Operates on LAN (same broadcast domain)
- Relies on broadcasting
- Uses/Updates ARP Table