ARP
What
A way to find out how to reach a device on L2, based on an IPv4 address
E.g. "Who here has 192.168.1.12
Device with said IP will respond, thus allowing the asker to learn the MAC
IPv6 uses NDP instead
Why
We somehow need to convert L3 (IPv4) addresses to L2 (MAC) addresses so we can deliver frames on the local network
Concepts
- ARP request
- Broadcasted to everyone
- Contains the IP we want to know the MAC for, as well as the source IP and MAC
- ARP response
- Allows the source to get the answer and cache it
- ARP Table
- Storage to cache ARP responses in
- Stale time
- Gratuitous ARP
- An ARP reply, for which no request has been made
- Useful to announce changes to the network
How
- Source checks it's ARP table to see if it already knows where
192.168.1.12is- If it does, ARP is not needed
- If not, broadcast (everyone receives this) an ARP request saying
"Who has 192.168.1.12? Tell 192.168.1.4 at aa:bb:cc:dd:ee:ff - The device with the IP in question will respond (only to the source device)
- Both source and target now add an entry in their ARP table
- Saved until old (stale time), but can be marked as persistent