wire / wire-format / arp-packet
An ARP (Address Resolution Protocol) packet resolves an IPv4 address to a MAC address (and reverse). Layout: hardware type (2), protocol type (2), hardware address length (1), protocol address length (1), operation (2: 1 request, 2 reply), sender hardware address (6), sender protocol address (4), target hardware address (6), target protocol address (4). Total 28 bytes for Ethernet/IPv4.
aka: ARP packet (RFC 826)
spec: RFC 826
An ARP (Address Resolution Protocol) packet resolves an IPv4 address to a MAC address (and reverse). Layout: hardware type (2), protocol type (2), hardware address length (1), protocol address length (1), operation (2: 1 request, 2 reply), sender hardware address (6), sender protocol address (4), target hardware address (6), target protocol address (4). Total 28 bytes for Ethernet/IPv4.
| field | size | meaning |
|---|---|---|
| Hardware type | 2 bytes | 1 = Ethernet (0x0001). |
| Protocol type | 2 bytes | 0x0800 = IPv4. |
| Hardware address length | 1 byte | 6 for Ethernet (MAC). |
| Protocol address length | 1 byte | 4 for IPv4. |
| Operation | 2 bytes | 1 = request, 2 = reply, 3 = RARP request, 4 = RARP reply. |
| Sender hardware address | 6 bytes | Sender's MAC address. |
| Sender protocol address | 4 bytes | Sender's IPv4 address. |
| Target hardware address | 6 bytes | Target's MAC (zero in a request). |
| Target protocol address | 4 bytes | Target's IPv4 address. |
example:
00 01 08 00 06 04 00 01 aa bb cc dd ee ff c0 a8 01 01 00 00 00 00 00 00 c0 a8 01 02
ARP request: who has 192.168.1.2? Tell 192.168.1.1 (aa:bb:cc:dd:ee:ff)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/arp-packet
or /wire-format/arp-packet.json