I. ARP and RARP
Network transmission, according to the destination IP address through the route selection can be transmitted over the Internet, but if you do not know the destination interface, then you do not know the packet to a network or a subnet which host. ARP (Address Resolution Protocol) can be based on the destination IP to obtain the interface so that the two host computer to communicate properly. Rarp with ARP, reverse address Resolution protocol. ARP provides address resolution services for different network layers.
Two. ARP Transfer process
Host to communicate with the destination host, then the first TCP connection, TCP connection request, TCP request packet according to routing to reach the destination network or LAN, but the destination interface is unknown, can not further send the TCP packet to the host, then you have to use the ARP Resolution protocol to
Get Destination interface Address:
1. Host sends ARP Request packet, destination IP address broadcast
2. All hosts in the network accept the ARP Request packet, all the host IP in the network and the IP address in the ARP Request packet drop the ARP packet, find the same as the host that issued the ARP Request packet responds to an ARP response packet, the package contains the host's interface address
3. The source host receives the ARP response packet of the destination host, obtains to the destination interface address, and the destination host carries on the TCP three times the handshake, the link communication
Three. arp format
ARP Request packet format
Destination:broadcast (FF:FF:FF:FF:FF:FF) Destination interface address full 1 broadcast address
SOURCE:HUAWEITE_D8:80:02 (9c:c1:72:d8:80:02) source interface address
Type:arp (0x0806) protocol type
padding:000000000000000000000000000000000000 because the ARP Ethernet header is 18 bytes, the arp segment is 28 bytes, The total byte is only 46 because the minimum Ethernet frame length is 60, so the padding word Fu Da to the minimum length
Hardware type:ethernet (1) hardware type represents the type of hardware address, 1 means the Ethernet address
Protocol Type:ip (0x0800) protocol represents the protocol address type to be mapped and hardware types to determine the type of ARP packets such as hardware type 1 means to obtain the Hardware Address protocol IP refers to the to be mapped.IP address refers to IP addresses that map out interface addresses
Hardware size:6 length of hardware address
Protocol length of Size:4 protocol address
Opcode:request (1) ARP packet operation type 1 for ARP Request packet 2 for ARP response packet
Sender mac Address:asustekc_c0:5d:04 (78:24:af:c0:5d:04) source MAC address
Sender IP address:192.168.10.145 (192.168.10.145) Source IP address
Target Mac address:00:00:00_00:00:00 (00:00:00:00:00:00) Destination MAC address
Target IP address:192.168.10.126 (192.168.10.126) Destination IP address
Four. ARP cache
Host and destination host communication so each time you have to send ARP to obtain the destination host hardware address, not only increase the bandwidth congestion, will also reduce the host and destination host connection speed. ARP cache is used to solve this situation, each host has an ARP high - speed cache, similar to an IP and Hardware address mapping table, the host can be queried through the ARP cache destination address in which, there can be obtained to IP corresponding interface address, No ARP acquisition is sent, the data in the cache does not exist forever, it only exists for a period of time, the time is removed from the cache, the user can set the host cache life cycle
Five. ARP Proxy
Some routers can respond to ARP request packets instead of hosts, allowing the host to respond to the destination host.
1. The host sends an ARP request packet to obtain the interface address of the destination host
2. When the ARP packet is routed to the router on the destination host, there is a routing table in the router that responds to the destination host IP address group ARP packet to the source host
3. The source host receives the ARP response packet, which is sent by the destination host and communicates with the destination host using the destination interface address in the response packet.
Six. Free ARP
There is a special arp, that is, free ARP, which is the host to its own IP address to send ARP Request packets. Its role is mainly two points:
1. To query the host that owns the same IP address in the network or LAN
2. To update the ARP cache of other hosts, when the host hardware address is changed, the host sends a free ARP, the other host gets to ARP message update ARP cache
Seven. RARP
Inverse Address Resolution Protocol
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
TCP IP Protocol notes (4)--arp