ARP protocol (Address Resolution Protocol)
Concept
The Address Resolution protocol, known as ARP Resolution Protocol, is a TCP/IP protocol that obtains physical addresses based on IP addresses .
Divided
Because the IP protocol uses the ARP protocol, the ARP protocol is usually placed on the network layer. However, the purpose of the ARP protocol is to resolve the hardware address used at the data link layer from the IP address used at the network layer, so it is possible to place the ARP protocol on the data link layer.
Cache (ARP cache)
Each host has an ARP cache with the IP address of each host and router on the local area network to the hardware address mapping table . When host A is sending an IP datagram to a host B on the local area network, the IP address of Host B is viewed in its ARP cache first. If so, the corresponding hardware address is found in the ARP cache, and Mac frames are sent to the hardware address.
Steps
When the corresponding IP address mapping is not found in the cache, perform the following steps:
(1) The MCU process broadcasts a packet of ARP requests on the local area network. , the main content of the group is: "My IP address is 192.168.1.9,mac address is: XXX, whose IP address is 192.168.1.15??"
(2) The ARP process running on all hosts on the local area network receives this ARP request grouping.
(3) Computer A's IP address and ARP request group the IP address of the Chinese Medicine query is consistent, the ARP request group, and to the MCU relaxed arp-response packet, the approximate content is "My IP address is 192.168.1.15,mac address is xxx"
(4) After the MCU receives a packet of ARP responses from computer A, it writes the IP address of computer A to the mapping of the hardware address in its ARP cache.
Inverse Address Resolution Protocol (RARP)
The function is to enable a host that knows only its hardware address to find its IP address through the RARP protocol.
Computer network (2)-----ARP protocol