RARP: Reverse Address Resolution Protocol

Source: Internet
Author: User
Tags file transfer protocol

When a system with a local disk is booted, the IP address is generally read from the configuration file on the disk. However, diskless machines, such as X terminals or diskless workstations, need to use other methods to obtain the IP address.
Each system on the network has a unique hardware address, which is configured by the network interface manufacturer. The RARP implementation process of a diskless System reads the unique hardware address from the interface card, and then sends an RARP request (a frame of data broadcast on the network ), request a host to respond to the IP address of the diskless system (in RARP response ).
This process is very simple in concept, but it is often more difficult to implement than arp. The reason is described later in this chapter. The formal specification of RARP is rfc903 [finlaysonetal.1984].

RARP grouping format

The format of the RARP group is basically the same as that of the ARP group (see Figure 4-3 ). The main difference between them is that the frame type code of the RARP request or response is 0x8035, the operation code of the RARP request is 3, and the response operation code is 4. Corresponding to ARP, RARP requests are transmitted in broadcast mode, while RARP responses are generally transmitted by unicast (unicast.

RARP example

On the Internet, we can force the sun host to boot from the network rather than from the local disk. If you run the RARP service program and tcpdump command on the host bsdi, you can get the output as 5-1. The-e parameter causes the tcpdump command to print the hardware address:
 

Figure 5-1 RARP request and response R a r p requests are broadcast (1st rows), while r a r p responses of 2nd rows are unicast. In the output of Row 3, a T s u n indicates that the r a r p response contains the I P address of host s u n (1 4 0. 2 5 2. 1 3. 3 ).
In row 3rd, we can see that once s u n receives the I P address, it sends a t f t p Read Request (r q) to File 8 C f C0 D 2 1. s u n 4 C (t f t p represents the simple file transfer protocol. We will go into details in chapter 5 ). Obtain the I P address 1 4 0. 2 5 2. 1 3. 3 3 of the host s u n in the 8 hexadecimal number table in the file name. This I P address is returned in the R A R p response. The file name suffix s u n 4 C indicates the type of the system to be guided.
T c p d u m p indicates in row 3rd that the length of the I p datagram is 6 5 bytes rather than a U D p datagram (actually a U D p datagram ), because we run the t c p d u m p command with the-e parameter to view the address of the hardware layer. The other point that needs to be pointed out in Figure 5-1 is that the length of the Ethernet data frame in the 2nd rows is smaller than the minimum length (as we said in section 4. 5 It should be 6 0 bytes ). The reason is that we run the t c p d u m p command on the system that sends the Ethernet data frame (B s d I. Application r a r p D writes 4 2 bytes to the B S D grouping filter device (where 1 4 bytes is the header of the Ethernet data frame, the remaining 2 8 bytes are r a r p responses), which is the copy received by t c p d u m p. However, the Ethernet device driver needs to fill the short frame with white space characters to reach the minimum transmission length (6 0 ). If we run the t c p d u m p command on another system, the length will be 6 0.
From this example, we can see that when the diskless system receives its I P address from the R A P response, it will send a t f t p request to read the boot image. At this point, we will no longer discuss in detail how diskless systems are guided (Chapter 6 describes diskless X terminals using r a r p, B o t p, and t f t p ).
If there is no r a r p server on the network, the result is 5-2. The destination address of each group is an Ethernet broadcast address. The ethernet address after w h o-is the destination hardware address, and the ethernet address after t e l is the hardware address of the sender.
Pay attention to the frequency of retransmission. The first re-transmission is in 6. 5 5 seconds later, then increase to 4 2. 8 0 seconds, and then reduced to 5. 3 4 seconds and 6. 5 5 seconds, and then return to 4 2. 7 9 seconds. This uncertain situation continues. If we calculate the interval between two resends, we find that there is a double relationship: from 5. 3 4 to 6. 5 5 is 1. 2 1 second, from 6. 5 5 to 8. 9 7 is 2. 4 2 seconds, from 8. 9 7 to 1 3. 8 0 is 4. 8 or 3 seconds. Continue. When the time interval reaches a threshold value (greater than 4 2. 8 0 seconds), it is reset to 5. 3 4 seconds. The increasing time-out interval is better than the method with the same value every time. In Figure 6-8, we will see an incorrect timeout and retransmission method, and in chapter 1, we will see the timeout and retransmission mechanism of t c p.

Figure 5-2 No RARP request from the RARP server in the Network
RARP Server Design

Although r a r p is very simple in concept, the design of an r a p server is related to the system and complicated. On the contrary, it is easy to provide an a r p server, which is usually part of the implementation of t c p/I P in the kernel. Because the kernel knows the I p address and hardware address, when it receives an a r p request asking for the I p address, it only needs to provide a response using the corresponding hardware address.

RARP server used as the user process

The complexity of the r a r p server is that the server generally provides hardware address-to-I P address ing for multiple hosts (all diskless systems on the network. The ing is contained in a disk file (generally located in the/e t C/e t h e r s directory in the u n I x system ). Since the kernel generally does not read and analyze disk files, the functions of the r a p server are provided by the user process, rather than as part of the kernel's t c p/I p implementation.
More complex, r a r p requests are transmitted as a special type of Ethernet data frame (The Frame Type field value is 0x8 0 3 5, 2-1 ). This indicates that the r a r p server must be able to send and receive such Ethernet data frames. In appendix A, we describe the B S D grouping filter, the network interface plug of S U N, and the S v R 4 data link provider interface can be used to receive these data frames. Since the data frames sent and received are related to the system, the implementation of the r a p server is bundled with the system.

Each network has multiple RARP servers

A complex factor for r a r p server implementation is that r a r p requests are broadcast on the hardware layer, as shown in Figure 5-2. This means they are not forwarded by the router. To enable the diskless system to boot when the r a r p server is shut down, multiple r a p servers are usually provided on a network (such as a cable. When the number of servers increases (to provide redundant backups), network traffic increases as each server sends a r a p response to each r a p request. The diskless system that sends the r a r p request generally uses the r a r p response received first (for a r P, we have never encountered this situation, because only one host sends a R p response ). In addition, it is possible that each r a r p server responds at the same time, which increases the probability of Ethernet conflict.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.