Data Network Resource
       Earn on the Web


ARP and RARP



Address Resolution Protocol (ARP)


ARP is a layer 3 protocol and is required to allow a sending station gather address information used in forming a layer 2 frame complete with destination and source MAC addresses. Every router maintains a table listing IP addresses and respective hardware addresses (e.g. MAC addresses) of devices that exist on the network. This table is called an ARP cache and is referenced by the router when it is looking up a hardware address of a device for which it knows the IP address and needs to forward a datagram to it. If no hardware address is found in the ARP cache then an ARP broadcast is sent on to the adjoining media (ARP only applies to the connecting wire). This broadcast is read by every station including the destination station. The destination station sends back an ARP reply with its hardware address so that the IP datagram can now be forwarded to it by the router.

RFC 826 describes ARP in detail.

Although ARP is a layer 3 protocol it does not use an IP header, it has its own packet format and is a broadcast on the local LAN within the data field of a layer 2 frame without needing to be routed. The Ethernet Type field has the value 0x0806 to indicate an ARP. The following diagram details the ARP packet:

ARP
  • Hardware Type - this is 1 for Ethernet.
  • Protocol Type - the protocol used at the network layer.
  • Hardware Address Length - this is the length in bytes, so it would be 6 for Ethernet.
  • Protocol Address Length - For TCP/IP th value is 4 bytes.
  • Operation Code - this code indicates whether the packet is an ARP Request (1) or an ARP Response (2).
  • Senders Hardware Address - hardware address of the source node.
  • Senders Protocol Address - layer 3 address of the source node.
  • Target Hardware Address - used in a RARP request, the response carries both the destination's hardware and layer 3 addresses.
  • Target Protocol Address - used in an ARP request, the response carries both the destination's hardware and layer 3 addresses.

Reverse Address Resolution Protocol (RARP)


If a station does not know its IP address it may send out a RARP (Reverse Address Resolution Protocol) request read by a RARP server which has a table of hardware addresses and IP addresses. The RARP server operates as a rudimentary Bootp server. The RARP uses the same packet format as the ARP and uses an Ethertype value of 0x8035 to indicate it being a RARP. The opcodes are 3 for a RARP Request or 4 for a RARP Response. The opcodes 1 and 2 are also available for use and cause the stack software to pass these frames on to the ARP process.

RFC 903 describes RARP in detail.

Proxy ARP


There is also a technique called Proxy ARP. If a station without a Default Gateway or a routing table configured wishes to talk to a another station on the other side of a router, the router that is configured for Proxy ARP can respond to the ARP and map the router's MAC address with the destination IP address and fool the sending station that it has found its destination. The router acts as a proxy as the name suggests, and forwards the packets to the correct destination since it has the relevant information. This is really only recommended as a temporary fix e.g. if you were gradually moving hosts from one addressing scheme to another and you still wanted to maintain connectivity between the disparately-addressed devices. You don't want Proxy ARP running as a general rule because it causes hosts to ARP for every address that it is trying to reach on the Internet.

RFC 1027 describes Proxy ARP.

Gratuitous ARP


Most hosts on a network will send out a Gratuitous ARP when they are initialising their IP stack. This Gratuitous ARP is an ARP request for their own IP address and is used to check for a duplicate IP address. If there is a duplicate address then the stack does not complete initialisation.

Valid HTML 4.01 Transitional




Earn on the Web    


All rights reserved. All trademarks, logos, and copyrights are property of their respective owners.