arp and rarp protocol

ARP and RARP detailed analysis of the
original zlnnjit Posted on 2016-04-03 15:12:15 Reads 9544 collection
launched

ARP ARP and Reverse Address Resolution Protocol RARP

1. Basic relations:

2. ARP ARP implementation process:

?? Regardless of what the network layer protocol, when transmitting data frames on the actual network link, and eventually have to use the hardware address.

Each host has an ARP cache (ARP cache), IP address mapping table hosts and routers on the LAN to which has been in the hardware address.

ƒ A when the host transmits an IP datagram to be to present a host B on the LAN, the IP address can view the presence or absence of the first host B in its ARP cache. If, you can find the corresponding hardware address, and then writes the data to the hardware address MAC frame, then the frame is sent to the hardware MAC address through the LAN.

Role 3.ARP cache

?? In order to reduce the traffic on the network, when the host A sends its ARP request packet, its IP address will be mapped to the hardware address is written to ARP request packet.

When the host B receives ARP request packet A, the address of Host A will write mapping host B in its ARP cache. This is more convenient for the later A sends a datagram to the host B.

5.ARP the problems noted in the agreement:

ARP is to solve the problem of mapping IP address and hardware address of the host or router on the same LAN.

If you are looking for host and source host not on the same local area network, then they would find one in the ARP hardware address of a router on the local LAN, and sends the packet to the router, so the router forwards the packet to the next The internet. Rest of the work done by the next network.

To resolve an IP address to the hardware address is automatically performed, the user host address resolution process for this is not known.

As long as the host or router to router and host or another known IP address to communicate on the local network, ARP protocol will automatically resolve the IP address for the hardware link layer address required.

6. Use the four typical case of ARP

(1)发送方是主机,要把IP数据报发送到本网络上的另一个主机。这时用ARP找到目的主机的硬件地址。

(2)发送方是主机,要把 IP 数据报发送到另一个网络上的一个主机。这时用ARP找到本网络上的一个路由器的硬件地址。剩下的工作由这个路由器来完成。

(3)发送方是路由器,要把 IP 数据报转发到本网络上的一个主机。这时用ARP找到目的主机的硬件地址。

(4) The sender is a router, the IP datagram should be forwarded to a host on another network. Then find the hardware address of a router on the local network with ARP. The rest of the work done by the router.

7.ARP datagram message format

Each host or device on the network has one or more IP addresses. IP address is the address of the network layer, network layer, data is assembled into IP packets. But sending IP packets need the support of the physical device (usually Ethernet equipment, in the course design, we designated as Ethernet device), that is, the sender must know the purpose of the physical address of the IP packets to be sent out, so the need for an IP address mapping mechanisms for the physical address. ARP protocol is used to accomplish this task. ARP protocol can be on the same physical network, the IP address given at the destination host or device conditions to obtain the physical address of the destination host or device. ARP protocol packet format shown in Figure 1:

图1        数据报的消息格式

Next, each part of the packet will be described

Hardware Type: Specifies a hardware interface type. For example, a value of 1 indicates Ethernet

Type specifies the sender Upper protocol: Protocol type

Physical Address Length: the length specified physical (hardware) address

Protocol address length: length of the network layer protocol addresses. If the IP protocol, a value of 4

Operation: ARP operation type specified, for example, 1 indicates an ARP request, an ARP reply 2 represents

Source physical address: IP address of the sender specified

Objective Physical Address: Destination physical address.

Destination IP Address: Destination IP address

ARP packet must be encapsulated into the data link layer in the investigation in order to send out the package

8.ARP agreement Workflow

(1) First, each host will establish a list of their ARP ARP buffer (ARP Cache), to represent the correspondence between the IP address and MAC address.

(2) When the source host needs a data packet to be transmitted to the destination host, will first check whether the MAC address of the corresponding IP address is present in their ARP list, if any, directly sends the data packet to the MAC address; if no, initiates a broadcast ARP request packet to the local subnet, the host searches the MAC address corresponding to this purpose. This ARP request data package including the IP address of the source host IP address, the hardware address, and the destination host.

(3) After all the network host receives this ARP request, checks the destination IP packet and its own IP address whether or not the same. If not identical to ignore this data packet; if identical, the host is first added MAC address of the sender and the IP addresses to its ARP list, if the information of the IP ARP table already exists, it is overwritten, and then to the source the host sends an ARP response packet, it needs to tell each other that they are looking for MAC address;

(4) the source host receives the ARP response packet, IP addresses of the destination host and the obtained MAC address to its ARP list, and uses this information start data transmission. If the source host has not received ARP response packet, represents an ARP query failed.

9. Reverse Address Resolution Protocol RARP:

Reverse Address Resolution Protocol RARP make only know their own hardware address of the host to know its IP address.

This host is often a diskless workstation. Therefore RARP protocol is now rarely used.

10.RARP works:

(1) Each device on the network will have a unique hardware address, typically the MAC address assigned by the device manufacturer. PC1 reads the MAC address from the card, and then sends a RARP request packet broadcast on the network, a request RARP server replies the IP address of the PC.

(2) RARP server receives the RARP request packet, assign an IP address, and transmits RARP responses to PC1.

After (3) PC1 received a response RARP, use IP address to get the communication.

ARP and RARP request is broadcast, answering all unicast





Guess you like

Origin www.cnblogs.com/hualou/p/12069864.html