Home » Computer Network » ARP vs RARP: Explanation and Differences

ARP vs RARP: Explanation and Differences

Last updated:

Support this post with a reaction:

4,608 views

In computer networks, devices communicate with each other using different types of addresses. Two important addressing systems used in network communication are IP addresses and MAC addresses.

An IP address is a logical address assigned to a device to identify it on a network, whereas a MAC address is a physical address associated with the network interface card (NIC) of a device.

For successful communication within a local network, devices sometimes need to convert an IP address into a MAC address or obtain an IP address using a known MAC address.

Two protocols associated with these address conversion processes are ARP (Address Resolution Protocol) and RARP (Reverse Address Resolution Protocol).

ARP is used to find the MAC address corresponding to a known IP address. On the other hand, RARP is used to obtain an IP address when the MAC address of a device is already known.

Both protocols play important roles in understanding address resolution in computer networks.

What Is ARP (Address Resolution Protocol)?

ARP (Address Resolution Protocol) is a network protocol used to find the physical MAC address of a device when its logical IP address is known.

In a local area network (LAN), devices use IP addresses to identify destinations at the network layer. However, when an IP packet must be transmitted over an Ethernet network, the sender needs the destination device’s MAC address to create the appropriate Ethernet frame.

ARP performs this address mapping by sending an ARP request to the devices on the local network.

The device that owns the requested IP address responds with its MAC address. The sender then stores this information in its ARP cache for future communication.

For example, suppose computer A wants to send data to computer B. Computer A knows the IP address of computer B but does not know its MAC address.

In this situation, computer A uses ARP to discover the MAC address associated with computer B’s IP address.

Thus, ARP helps devices communicate with each other within a local network by resolving IP addresses into MAC addresses.

How Does ARP Work?

ARP works through a request-and-reply mechanism. It allows a sender to discover the MAC address of another device using its IP address.

The working process of ARP involves the following steps:

Step 1: Checking the ARP Cache

Before sending an ARP request, the sender checks its ARP cache. The ARP cache is a temporary storage area that contains previously discovered IP-to-MAC address mappings.

If the required MAC address is already available, the sender can use it directly without sending another ARP request.

Step 2: Sending an ARP Request

If the MAC address is not available in the ARP cache, the sender creates an ARP request packet.

The request contains the sender’s IP and MAC addresses and the target IP address whose MAC address needs to be discovered.

The ARP request is generally sent as a broadcast frame to all devices in the local network.

Step 3: Receiving the ARP Request

All devices connected to the local network receive the broadcast ARP request.

Each device checks whether the target IP address in the request matches its own IP address.

Step 4: Sending an ARP Reply

The device whose IP address matches the requested IP address sends an ARP reply to the sender.

The reply contains the MAC address associated with the requested IP address. Unlike the request, the reply is generally sent as a unicast frame directly to the sender.

Step 5: Updating the ARP Cache

The sender receives the ARP reply and stores the IP-to-MAC address mapping in its ARP cache.

The sender can now use the discovered MAC address to transmit data to the destination device.

Example of ARP

Consider two computers connected to the same local network.

  • Computer A has IP address: 192.168.1.10
  • Computer B has IP address: 192.168.1.20
  • Computer B has MAC address: 00:1A:2B:3C:4D:5E

Suppose computer A wants to send data to computer B.

Computer A knows the IP address of computer B but does not know its MAC address.

It sends an ARP request asking which device has the IP address 192.168.1.20.

Computer B recognizes its IP address and sends an ARP reply containing its MAC address.

Computer A stores this mapping in its ARP cache and uses the MAC address to send the Ethernet frame.

Therefore, ARP helps computer A discover the physical address of computer B.

Types of ARP

ARP is associated with different address-resolution operations. The following are commonly discussed types and related forms of ARP.

1. Proxy ARP

Proxy ARP is a technique in which a router responds to an ARP request on behalf of another device.

It allows devices on one network to communicate with devices on another network by making the router provide its own MAC address for the requested IP address.

2. Gratuitous ARP

Gratuitous ARP is an ARP request or announcement sent by a device to announce or check the use of its own IP address.

It is commonly used to detect duplicate IP addresses and update other devices’ ARP caches.

3. Reverse ARP (RARP)

Reverse ARP is an older protocol that allows a device to discover its IP address when its MAC address is known.

It performs the reverse operation of traditional ARP and is explained in detail below.

4. Inverse ARP (InARP)

Inverse ARP is used to discover the network-layer address of another device when its data-link-layer address is already known.

It was commonly associated with Frame Relay networks.

What Is RARP (Reverse Address Resolution Protocol)?

RARP (Reverse Address Resolution Protocol) is a network protocol used by a device to obtain its IP address when its MAC address is already known.

RARP performs the reverse operation of ARP.

In traditional ARP, a device knows the IP address and searches for the corresponding MAC address. In RARP, a device knows its MAC address and requests the corresponding IP address from a RARP server.

RARP was mainly used by diskless workstations and computers that did not have permanent storage to store their IP configuration.

When such a device started, it knew its hardware MAC address but did not know its IP address. It sent a RARP request to a RARP server on the local network.

The server maintained a table containing MAC addresses and their corresponding IP addresses. After receiving the request, the server checked its table and returned the assigned IP address.

Thus, RARP helped devices obtain their IP addresses using their physical MAC addresses.

How Does RARP Work?

RARP follows a request-and-reply mechanism to obtain an IP address from a known MAC address.

The working process of RARP involves the following steps:

Step 1: Device Initialization

When a device starts, it identifies its own MAC address from its network interface card.

However, it may not know its IP address, especially when it is a diskless workstation.

Step 2: Sending a RARP Request

The device creates a RARP request packet containing its MAC address.

It sends the request as a broadcast message to the devices on the local network.

The request asks the RARP server to provide the IP address associated with the given MAC address.

Step 3: Receiving the RARP Request

The RARP server receives the broadcast request and checks the MAC address contained in it.

The server maintains a predefined table that stores MAC addresses and their corresponding IP addresses.

Step 4: Searching the RARP Table

The RARP server searches its table to find the IP address associated with the requesting device’s MAC address.

If a matching entry is found, the server retrieves the corresponding IP address.

Step 5: Sending a RARP Reply

The server sends a RARP reply containing the IP address associated with the requesting device’s MAC address.

Step 6: Configuring the Device

The device receives the RARP reply and uses the provided IP address for network communication.

Therefore, RARP allows a device to obtain its IP address using its known MAC address.

Example of RARP

Consider a diskless workstation connected to a local network.

The workstation has the following details:

  • MAC address: 00:1A:2B:3C:4D:5E
  • IP address: Unknown

When the workstation starts, it knows its MAC address but does not know its IP address.

It sends a RARP request to the RARP server containing its MAC address.

The RARP server checks its address table and finds the corresponding IP address.

For example:

  • MAC address: 00:1A:2B:3C:4D:5E
  • Assigned IP address: 192.168.1.10

The server sends the IP address to the workstation through a RARP reply.

The workstation receives the response and uses 192.168.1.10 as its IP address.

Thus, RARP helps a device discover its IP address using its physical address.

Characteristics of RARP

The important characteristics of RARP are:

  1. RARP stands for Reverse Address Resolution Protocol.
  2. It is used to obtain an IP address from a known MAC address.
  3. It works through request and reply messages.
  4. RARP requests are sent as broadcast messages within a local network.
  5. It requires a RARP server to provide the IP address.
  6. The RARP server maintains a mapping table containing MAC addresses and their corresponding IP addresses.
  7. It was mainly used by diskless workstations.
  8. RARP provides only IP address information and does not provide complete network configuration details.
  9. It has largely been replaced by BOOTP and DHCP.

Applications of RARP

RARP was mainly used in older computer networks. Some of its applications include:

1. Diskless Workstations: RARP allowed diskless computers to obtain their IP addresses during startup without requiring a locally stored IP configuration.

2. Network Booting: It helped devices obtain basic address information when starting from a network.

3. Automatic IP Address Assignment: It allowed devices to request their IP addresses from a central RARP server using their MAC addresses.

4. Older LAN Environments: It was used in traditional local area networks where devices needed a mechanism to obtain IP addresses during initialization.

Difference Between ARP and RARP

ARP and RARP are address resolution protocols used in computer networks. Both are associated with mapping IP addresses and MAC addresses, but they perform opposite functions.

ARP converts a known IP address into its corresponding MAC address, whereas RARP converts a known MAC address into its corresponding IP address.

The following table explains the important differences between ARP and RARP.

BasisARPRARP
Full FormAddress Resolution ProtocolReverse Address Resolution Protocol
PurposeFinds the MAC address using a known IP address.Finds the IP address using a known MAC address.
Address MappingIP address to MAC address.MAC address to IP address.
WorkingResolves logical addresses into physical addresses.Resolves physical addresses into logical addresses.
RequestARP request contains the target IP address.RARP request contains the requesting device’s MAC address.
ReplyReturns the corresponding MAC address.Returns the corresponding IP address.
Server RequirementDoes not normally require a dedicated ARP server.Requires a RARP server.
UsageUsed for communication within local networks.Mainly used by older diskless workstations.
AvailabilityCommonly used in IPv4 networks.Obsolete and largely replaced by BOOTP and DHCP.
ExampleFinding the MAC address of a device using its IP address.Finding the IP address of a device using its MAC address.

Simple Explanation of the Difference

The easiest way to understand the difference between ARP and RARP is to remember the direction of address conversion.

  • ARP: IP address → MAC address.
  • RARP: MAC address → IP address.

For example, if a computer knows the IP address of another computer but does not know its MAC address, it uses ARP.

If a computer knows its MAC address but does not know its IP address, it can use RARP in older network environments.

Advantages of ARP

  1. Easy Address Resolution: ARP makes it easy to discover the MAC address of a device using its IP address.
  2. Automatic Communication: Devices can communicate within a local network without manually entering destination MAC addresses.
  3. Efficient Data Transmission: ARP cache entries reduce the need to send repeated ARP requests.
  4. Simple Implementation: ARP uses a straightforward request-and-reply mechanism.
  5. Supports IPv4 Communication: It plays an important role in delivering IPv4 packets over Ethernet and other supported link-layer networks.

Advantages of RARP

  1. Automatic IP Discovery: It allows a device to obtain its IP address using its MAC address.
  2. Useful for Diskless Workstations: It helped computers without local storage obtain their network addresses during startup.
  3. Centralized Address Mapping: A RARP server maintains the mapping between MAC addresses and IP addresses.
  4. Reduced Manual Configuration: Devices do not need to have their IP addresses manually entered during initialization.

Limitations of ARP and RARP

Limitations of ARP

  1. ARP requests are broadcast within the local network, which can create additional traffic.
  2. ARP does not provide built-in authentication, making it vulnerable to ARP spoofing and ARP poisoning attacks.
  3. ARP works within the local network segment and does not resolve MAC addresses across routers.
  4. ARP is associated with IPv4 and is not used by IPv6, which uses Neighbor Discovery Protocol (NDP).

Limitations of RARP

  1. RARP requires a dedicated RARP server.
  2. RARP requests are generally limited to the local network because routers do not normally forward them.
  3. It provides only an IP address and does not provide other configuration details, such as subnet masks and default gateway information.
  4. It requires manual maintenance of MAC-to-IP mapping tables.
  5. It has been largely replaced by more flexible protocols such as BOOTP and DHCP.