The difference between arp and RARP
How ARP works
ARP is used to solve the peer IP address when the local IP address and hardware address as well as the peer IP address are known. Its working principle is briefly shown as follows:
What is the hardware address of A that first sends a broadcast message requesting its corresponding destination IP address? At the same time, its own IP address and hardware address are attached to the broadcast message.
After receiving the broadcast packet, B takes out the IP address and hardware address of An and adds them to the address mapping table. At the same time, the unicast response is returned, and the response packet contains the IP address and hardware address of B.
A receives a response, takes out B's IP address and hardware address, and adds them to the address mapping table.
After that, devices An and B can transfer data normally.
How RARP works
RARP is used in situations where the hardware address is known and the IP address is unknown. Its working principle is summarized as follows:
What is the IP address of A that first sends a broadcast message requesting its corresponding destination hardware address? At the same time, its own hardware address is attached to the broadcast message.
When B receives the broadcast packet, it returns a unicast response, which contains B's IP address and hardware address (and often A's IP address, to reduce ARP parsing).
A receives a response, takes out B's IP address and hardware address, and adds them to the address mapping table.
After that, devices An and B can transfer data normally.