ARP Datagram format
ARP (address Resolution Protocol): resolves the IP address to the corresponding MAC address. Each host has an ARP cache, which contains the mapping of IP addresses to MAC addresses of hosts and routers on this LAN.
Example: host 1 sends data to host 2 on the same network segment
In network communication, the packets sent by the source host are received by the network card before processing the upper layer protocol, but the hardware address and IP address of the destination host should be known before communication, and the ARP protocol should be used.
ARP Datagram format:
The Ethernet destination address is the MAC address of the destination host
The Ethernet source address is the MAC address of the source host
Frame type is ARP protocol type
An OP of 1 indicates the requesting party, and a value of 2 indicates the responding party
Example: source host MAC address is MAC1,IP address is IP1, destination host MAC address is MAC2,IP address is IP2
The source host sends an ARP request, broadcasts the hardware address MAC2 that looks up IP2 to the local network segment, and the destination host receives the ARP request, and the IP address matches it, and sends an ARP reply packet to the source host.
ARP requester Datagram format:
Where 0806 is represented as ARP protocol type 0800 is the IP protocol type to be converted, and the full F of the Ethernet header represents broadcast
ARP responder Datagram format:
At this point, the original destination host becomes the current source host, and ARP replies to the original source host.