ARP and RARP protocols

1. ARP (Address Resolution Protocol)

  • Purpose:
    Translates IP addresses (logical) into MAC addresses (physical).
    • Example: Find the MAC address of a device with IP 192.168.1.5.
  • How It Works:
    1. A device sends a broadcast ARP request:
      • “Who has IP 192.168.1.5? Tell me your MAC address.”
    2. The device with the matching IP replies with its MAC address.
  • Scope:
    Works within a single local network (LAN).
  • Type of Protocol:
    Operates at the Data Link Layer (Layer 2) and assists the Network Layer (Layer 3).
  • Common Use Case:
    Ensures data packets are sent to the correct hardware device on a LAN.

2. RARP (Reverse Address Resolution Protocol)

  • Purpose:
    Translates MAC addresses (physical) into IP addresses (logical).
    • Example: Find the IP address for a device with MAC 00:1A:2B:3C:4D:5E.
  • How It Works:
    1. A device (e.g., diskless workstation) sends a RARP request to the network:
      • “This is my MAC address; what is my IP address?”
    2. A RARP server replies with the corresponding IP address.
  • Scope:
    Used in networks with diskless devices (e.g., old systems or embedded devices).
  • Type of Protocol:
    Operates at the Data Link Layer (Layer 2).
  • Common Use Case:
    Assigns IP addresses to devices that do not have storage to hold configurations.

3. Key Differences Between ARP and RARP

FeatureARPRARP
Full FormAddress Resolution ProtocolReverse Address Resolution Protocol
PurposeConverts IP address to MAC addressConverts MAC address to IP address
Use CaseSending packets to the correct deviceAssigning IP to diskless devices
Request TypeBroadcast to all devices on the LANSent to a RARP server
DirectionIP → MACMAC → IP

4. ARP Table

  • Definition:
    A cache maintained by each device that stores IP-to-MAC address mappings for faster communication.
  • Command to View ARP Table:
    • In Windows: arp -a.

5. Protocols Replacing RARP

  • RARP is now outdated and replaced by:
    1. BOOTP (Bootstrap Protocol): Assigns IP along with configuration data like gateway and DNS.
    2. DHCP (Dynamic Host Configuration Protocol): Modern protocol to dynamically assign IPs and other configurations.

6. Mnemonics to Remember

  • ARP: “Ask for MAC” → IP → MAC.
  • RARP: “Request for Address” → MAC → IP.

7. Exam Focus

  • Understand the functions and differences between ARP and RARP.
  • Be familiar with modern alternatives like DHCP replacing RARP.
  • Focus on ARP’s role in LAN communication and troubleshooting commands like arp -a.

Quick Tip:

ARP works in forward direction (IP to MAC), while RARP works in reverse direction (MAC to IP).


MCQ

What does ARP stand for?
a) Address Routing Protocol
b) Address Resolution Protocol
c) Advanced Routing Protocol
d) Address Request Protocol

Answer: b) Address Resolution Protocol

What does RARP stand for?
a) Reverse Address Routing Protocol
b) Reverse Address Resolution Protocol
c) Reverse Advanced Routing Protocol
d) Routing Address Resolution Protocol

Answer: b) Reverse Address Resolution Protocol

What is the primary function of ARP?
a) To map an IP address to a MAC address
b) To map a MAC address to an IP address
c) To route packets between networks
d) To assign IP addresses dynamically

Answer: a) To map an IP address to a MAC address

What is the primary function of RARP?
a) To map an IP address to a MAC address
b) To map a MAC address to an IP address
c) To resolve DNS queries
d) To broadcast data packets

Answer: b) To map a MAC address to an IP address

At which layer of the OSI model does ARP operate?
a) Physical Layer
b) Data Link Layer
c) Network Layer
d) Transport Layer

Answer: b) Data Link Layer

At which layer of the OSI model does RARP operate?
a) Physical Layer
b) Data Link Layer
c) Network Layer
d) Application Layer

Answer: b) Data Link Layer

Which protocol has largely replaced RARP for IP address assignment?
a) DNS
b) DHCP
c) ICMP
d) ARP

Answer: b) DHCP

Which protocol is responsible for mapping IP addresses to MAC addresses?
a) DNS
b) RARP
c) ARP
d) DHCP

Answer: c) ARP

How does ARP find a MAC address for a given IP address?
a) By sending a unicast request to all devices
b) By sending a broadcast request to all devices on the network
c) By querying the DNS server
d) By using the routing table

Answer: b) By sending a broadcast request to all devices on the network

How does RARP work?
a) Sends a broadcast request for a MAC address
b) Sends a unicast request for an IP address from a server
c) Sends a request to a RARP server to map a MAC address to an IP address
d) Uses DNS for reverse resolution

Answer: c) Sends a request to a RARP server to map a MAC address to an IP address

What happens if the ARP cache does not have the MAC address for an IP address?
a) The ARP request is broadcasted to the entire network.
b) The DNS server is queried for the MAC address.
c) The router assigns a random MAC address.
d) The request fails.

Answer: a) The ARP request is broadcasted to the entire network.

What is the limitation of RARP?
a) It cannot work on LANs.
b) It requires a server to be configured in the network.
c) It does not support dynamic IP address assignment.
d) Both b and c.

Answer: d) Both b and c.

Which command is used in Windows to view the ARP table?
a) ping -a
b) netstat -arp
c) arp -a
d) ipconfig /arp

Answer: c) arp -a

What is an ARP cache?
a) A database storing IP-to-MAC address mappings
b) A database storing MAC-to-IP address mappings
c) A table of all active IP addresses in the network
d) A routing table for DNS lookups

Answer: a) A database storing IP-to-MAC address mappings

In which type of communication is ARP most commonly used?
a) Between two devices on the same LAN
b) Between devices on different networks
c) In assigning IP addresses dynamically
d) In DNS queries

Answer: a) Between two devices on the same LAN

Which protocol is used to resolve MAC addresses for IP addresses in IPv6 networks?
a) ARP
b) RARP
c) NDP (Neighbor Discovery Protocol)
d) DHCP

Answer: c) NDP (Neighbor Discovery Protocol)

What type of message does ARP send when requesting a MAC address?
a) Unicast request
b) Broadcast request
c) Multicast request
d) Encrypted request

Answer: b) Broadcast request

Which field is included in an ARP reply packet?
a) Sender’s MAC address only
b) Sender’s IP address only
c) Sender’s MAC and IP address
d) Receiver’s MAC and IP address

Answer: c) Sender’s MAC and IP address

What type of device maintains the RARP server?
a) Router
b) Switch
c) Gateway or dedicated RARP server
d) Any host on the network

Answer: c) Gateway or dedicated RARP server

Key Focus Areas for Exams

  1. ARP: IP → MAC address mapping, broadcast request, ARP cache.
  2. RARP: MAC → IP address mapping, used for diskless systems, replaced by DHCP.
  3. Commands: arp -a to view ARP table.
  4. Advanced Concepts: Proxy ARP, Gratuitous ARP, ARP in IPv6 (NDP).
  5. Layer Knowledge: ARP and RARP operate at Layer 2 (Data Link).