ARP/RARP报文格式

地址解析协议ARP(Address Resolution Protocol)是用来将IP地址解析为MAC地址的协议。

报文格式

字段 长度(bit) 含义
Ethernet Address of destination 48比特 目的以太网地址。发送ARP请求时,为广播的MAC地址,0xFF.FF.FF.FF.FF.FF。
Ethernet Address of sender 48比特 源以太网地址。
Frame Type 16比特 表示后面数据的类型。对于ARP请求或应答来说,该字段的值为0x0806。
Hardware Type 16比特 表示硬件地址的类型。对于以太网,该类型的值为“1”。
Protocol Type 16比特 表示发送方要映射的协议地址类型。对于IP地址,该值为0x0800。
Hardware Length 8比特 表示硬件地址的长度,单位是字节。对于ARP请求或应答来说,该值为6。
Protocol Length 8比特 表示协议地址的长度,单位是字节。对于ARP请求或应答来说,该值为4。
OP 16比特 操作类型:
  • 1 ARP请求
  • 2 ARP应答
  • 3 RARP请求
  • 4 RARP应答
Ethernet Address of sender 48比特 发送方以太网地址。这个字段和ARP报文首部的源以太网地址字段是重复信息。
IP Address of sender 32比特 发送方的IP地址。
Ethernet Address of destination 48比特 接收方的以太网地址。发送ARP请求时,该处填充值为0x00.00.00.00.00.00。
IP Address of destination 32比特 接收方的IP地址。

报文示例

图1 免费ARP报文格式
图2 ARP请求报文格式
图3 ARP应答报文格式
图4 RARP请求报文格式

参考标准

标准 描述
RFC 826 Ethernet Address Resolution Protocol
RFC 903 Reverse Address Resolution Protocol
RFC 1027 Using ARP to Implement Transparent Subnet Gateways
RFC 1042 Standard for the Transmission of IP Datagrams over IEEE 802 Networks
RFC 5227 IPv4 Address Conflict Detection

本资料收集于互联网
2016 ©