http://www.inetdaemon.com/tutorials/lan/arp.html
Code:
TRANSMISSION LAYER for 802.x protocols
1 2 3 3 4
0 7 5 3 1 9 7
+------------------------------------------------+
| Destination MAC Address |
+------------------------------------------------+
| Source MAC Address |
+---------------+--------------------------------+
| Protocol Type |
+-------+-------+
ARP
PACKET 1 2 3 3 4
DATA 0 7 5 3 1 9 7
+---------------+---------------+----------------+
| HRD | PRO | HLN | PLN |
+---------------+---------------+----------------+
| OP | SHA ...
+------------------------------------------------+
| SPA ...
+------------------------------------------------+
| THA ...
+------------------------------------------------+
| TPA ...
+------------------------------------------------+
| SHA ...
Ethernet transmission layer
(not necessarily accessible to the user):
DESTINATION 48.bit: Destination Address
SOURCE 48.bit: Source Address
PROTOCOL TYPE 16.bit: Protocol type
(set to ARP).
Ethernet packet data:
HRD 16.bit: Hardware address space
(e.g., Ethernet, Packet Radio Net.)
PRO 16.bit: Protocol address space.
For Ethernet hardware, this is from
the set of type fields ether_typ$.
HLN 8.bit: Hardware Address Length (0-255 Bytes)
PLN 8.bit: Protocol Address Length (0-255 Bytes)
OP 16.bit: Opcode: either request or reply
SHA nbytes: Sender Hardware Address (this packet),
n from the HLN field.
SPA mbytes: Sender Protocol Address (this packet),
m from the PLN field.
THA nbytes: Target Hardware Address (this packet),
(if known).
TPA mbytes: Target Protocol Address
Also see
ftp://ftp.isi.edu/in-notes/rfc826.txt for the RFC that defines ARP packets.