one ,ARP Role of the agreement
1,ARP Protocol used in Ethernet , Used to resolve the target address of communication to MAC address , When communicating across network segments, the gateway's MAC address .
2, If computer Aping computer B Address of , First, computers A Judge the target IP Address and whether you are in the same network segment , If in a network segment , Target of data link layer encapsulation MAC Address is computer C of MAC address .
3, If computer Aping computer C Address of , First, computers A Judge the target IP Address and whether you are in the same network segment , If not in a network segment , Target of data link layer encapsulation MAC The address is the gateway MAC address .
two , Address resolution protocol ARP main points
1,ARP Request grouping : Include sender hardware address / Sender IP address / Target hardware address ( Fill in when unknown 0) / Target party IP address .
2,ARP The request is sent to a broadcast address ( Router does not forward ARP request ).
3,ARP Response grouping : Include sender hardware address / Sender IP address / Target hardware address / Target party IP address .
4,ARP Packets are encapsulated and transmitted in frames of the physical network .
three , Address resolution protocol ARP Working process of
When the host A To send a message to a host on this LAN B send out IP Datagram time , First in its ARP Check whether there are hosts in the cache B of IP address .
1. if there be , You can find out the corresponding hardware address , Then write this hardware address to MAC frame , Then, the MAC The frame is sent to this hardware address .
2. If not ,ARP The process broadcasts and sends a ARP Request grouping . received ARP After response grouping , Will get IP Address to hardware address mapping write ARP In cache .
four , summary
1,ARP Used to solve the problem of host or router on the same LAN IP The mapping problem between address and hardware address .
2, If the host you are looking for is not on the same LAN as the source host , Then we have to pass ARP Find the hardware address of a router on this LAN , Then send the packet to the router , Let this router forward the packet to the next network , The rest of the work will be done by the next network .