Skip to content

Instantly share code, notes, and snippets.

@cdosborn
Last active April 10, 2016 00:46
Show Gist options
  • Select an option

  • Save cdosborn/a791841c9dda3e393dbad78199f8ec87 to your computer and use it in GitHub Desktop.

Select an option

Save cdosborn/a791841c9dda3e393dbad78199f8ec87 to your computer and use it in GitHub Desktop.
A story to motivate/understand the Address Resolution Protocol (ARP).
| A story to motivate/understand the Address Resolution Protocol (ARP).
|
| Connor Osborn
| 04/09/16
So you want to send a packet to your friend on your local ethernet. They are
blah.coolsite.org and you use DNS to find out which internet address maps to
that name. It's 1.2.3.4, ho-okay. You're fillin out this packet according to
the Internet Protocol (IP). You throw in you're address, their address, blah
blah some more bits. This packet is going over ethernet so you have to wrap
your IP packet in a new ethernet packet. Easy. Ethernet packets are observable
by anyone on the same link, so you just drop your E packet onto the wire. But
your friend doesn't listen to ALL traffic on the wire, only E packets
addressed to them. le sigh. How do you know someone's E address? What's the
DNS equivalent for E addresses (blood pressure rises). Turns out there is a
dead simple equivalent for E, enter the Address Resolution Protocol (ARP). You
just make an ARP request on your link:
My IP addr is ...
My E addr is ...
I'm searching for E addr of IP addr 1.2.3.4
You send this E packet to everyone on the link (on the broadcast addr). Your
friend ARP replies (doesn't have to broadcast) like so:
My IP addr is 1.2.3.4
My E addr is 1.2.3.4.5.6
I'm replying to E addr ..., IP addr ...
Phew.
A user of ARP builds a table mapping IP addr to E addr much like /etc/hosts
maps host names to IP addr. If they don't have an E addr entry for an IP they
initiate the ARP request and update their table when the ARP reply is
received.
You now have the information to communicate over E with your friend and
forward the intended packet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment