RFC 903 INTERNET STANDARD LINK LAYER · BOOTSTRAP

RARP: A Reverse Address Resolution Protocol

How a diskless workstation learns its own IP address from its hardware address.

On rfc-editor.org ↗
PUBLISHED
June 1984
AUTHORS
Ross Finlayson, Timothy Mann, Jeffrey C. Mogul, Marvin Theimer
ORG
Stanford University
STREAM
Legacy
ETHERTYPE
0x8035
OPCODES
3 (request), 4 (reply)
PACKET SIZE
28 bytes (Ethernet/IPv4)
BUILDS ON
RFC 826 — ARP
SUPERSEDED IN PRACTICE BY
RFC 951 — BOOTP, RFC 2131 — DHCP
DOI
10.17487/RFC0903

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                    Finlayson, Mann, Mogul, Theimer
Request for Comments: 903                            Stanford University
                                                               June 1984

                 A Reverse Address Resolution Protocol


      Ross Finlayson, Timothy Mann, Jeffrey Mogul, Marvin Theimer
                      Computer Science Department
                          Stanford University
                               June 1984

Status of this Memo

   This RFC suggests a method for workstations to dynamically find their
   protocol address (e.g., their Internet Address), when they know only
   their hardware address (e.g., their attached physical network
   address).

   This RFC specifies a proposed protocol for the ARPA Internet
   community, and requests discussion and suggestions for improvements.

I. Introduction

   Network hosts such as diskless workstations frequently do not know
   their protocol addresses when booted; they often know only their
   hardware interface addresses.  To communicate using higher-level
   protocols like IP, they must discover their protocol address from
   some external source.  Our problem is that there is no standard
   mechanism for doing so.

   Plummer's "Address Resolution Protocol" (ARP) [1] is designed to
   solve a complementary problem, resolving a host's hardware address
   given its protocol address.  This RFC proposes a "Reverse Address
   Resolution Protocol" (RARP).  As with ARP, we assume a broadcast
   medium, such as Ethernet.

II. Design Considerations

   The following considerations guided our design of the RARP protocol.

   A. ARP and RARP are different operations.  ARP assumes that every
   host knows the mapping between its own hardware address and protocol
   address(es).  Information gathered about other hosts is accumulated
   in a small cache.  All hosts are equal in status; there is no
   distinction between clients and servers.

   On the other hand, RARP requires one or more server hosts to maintain
   a database of mappings from hardware address to protocol address and
   respond to requests from client hosts.

   B. As mentioned, RARP requires that server hosts maintain large
   databases. It is undesirable and in some cases impossible to maintain
   such a database in the kernel of a host's operating system.  Thus,
   most implementations will require some form of interaction with a
   program outside the kernel.

   C. Ease of implementation and minimal impact on existing host
   software are important.  It would be a mistake to design a protocol
   that required modifications to every host's software, whether or not
   it intended to participate.

   D. It is desirable to allow for the possibility of sharing code with
   existing software, to minimize overhead and development costs.

III.  The Proposed Protocol

   We propose that RARP be specified as a separate protocol at the
   data-link level.  For example, if the medium used is Ethernet, then
   RARP packets will have an Ethertype (still to be assigned) different
   from that of ARP.  This recognizes that ARP and RARP are two
   fundamentally different operations, not supported equally by all
   hosts.  The impact on existing systems is minimized; existing ARP
   servers will not be confused by RARP packets. It makes RARP a general
   facility that can be used for mapping hardware addresses to any
   higher level protocol address.

   This approach provides the simplest implementation for RARP client
   hosts, but also provides the most difficulties for RARP server hosts.
   However, these difficulties should not be insurmountable, as is shown
   in Appendix A, where we sketch two possible implementations for
   4.2BSD Unix.

   RARP uses the same packet format that is used by ARP, namely:

      ar$hrd (hardware address space) -  16 bits
      ar$pro (protocol address space) -  16 bits
      ar$hln (hardware address length) - 8 bits
      ar$pln (protocol address length) - 8 bits
      ar$op  (opcode) - 16 bits
      ar$sha (source hardware address) - n bytes,
                                       where n is from the ar$hln field.
      ar$spa (source protocol address) - m bytes,
                                       where m is from the ar$pln field.
      ar$tha (target hardware address) - n bytes
      ar$tpa (target protocol address) - m bytes

   ar$hrd, ar$pro, ar$hln and ar$pln are the same as in regular ARP
   (see [1]).

   Suppose, for example, that 'hardware' addresses are 48-bit Ethernet
   addresses, and 'protocol' addresses are 32-bit Internet Addresses.
   That is, we wish to determine Internet Addresses corresponding to
   known Ethernet addresses.  Then, in each RARP packet, ar$hrd = 1
   (Ethernet), ar$pro = 2048 decimal (the Ethertype of IP packets),
   ar$hln = 6, and ar$pln = 4.

   There are two opcodes: 3 ('request reverse') and 4 ('reply reverse').
   An opcode of 1 or 2 has the same meaning as in [1]; packets with such
   opcodes may be passed on to regular ARP code.  A packet with any
   other opcode is undefined.  As in ARP, there are no "not found" or
   "error" packets, since many RARP servers are free to respond to a
   request.  The sender of a RARP request packet should timeout if it
   does not receive a reply for this request within a reasonable amount
   of time.

   The ar$sha, ar$spa, $ar$tha, and ar$tpa fields of the RARP packet are
   interpreted as follows:

   When the opcode is 3 ('request reverse'):

      ar$sha is the hardware address of the sender of the packet.

      ar$spa is undefined.

      ar$tha is the 'target' hardware address.

         In the case where the sender wishes to determine his own
         protocol address, this, like ar$sha, will be the hardware
         address of the sender.

      ar$tpa is undefined.

   When the opcode is 4 ('reply reverse'):

      ar$sha is the hardware address of the responder (the sender of the
      reply packet).

      ar$spa is the protocol address of the responder (see the note
      below).

      ar$tha is the hardware address of the target, and should be the
      same as that which was given in the request.

      ar$tpa is the protocol address of the target, that is, the desired
      address.

   Note that the requirement that ar$spa in opcode 4 packets be filled
   in with the responder's protocol is purely for convenience.  For
   instance, if a system were to use both ARP and RARP, then the
   inclusion of the valid protocol-hardware address pair (ar$spa,
   ar$sha) may eliminate the need for a subsequent ARP request.

IV. References

   [1] Plummer, D., "An Ethernet Address Resolution Protocol",  RFC 826,
   MIT-LCS, November 1982.

Appendix A.  Two Example Implementations for 4.2BSD Unix

   The following implementation sketches outline two different
   approaches to implementing a RARP server under 4.2BSD.

   A. Provide access to data-link level packets outside the kernel.  The
   RARP server is implemented completely outside the kernel and
   interacts with the kernel only to receive and send RARP packets.  The
   kernel has to be modified to provide the appropriate access for these
   packets; currently the 4.2 kernel allows access only to IP packets.
   One existing mechanism that provides this capability is the CMU
   "packet-filter" pseudo driver.  This has been used successfully at
   CMU and Stanford to implement similar sorts of "user-level" network
   servers.

   B. Maintain a cache of database entries inside the kernel.  The full
   RARP server database is maintained outside the kernel by a user
   process.  The RARP server itself is implemented directly in the
   kernel and employs a small cache of database entries for its
   responses.  This cache could be the same as is used for forward ARP.

   The cache gets filled from the actual RARP database by means of two
   new ioctls.  (These are like SIOCIFADDR, in that they are not really
   associated with a specific socket.)  One means: "sleep until there is
   a translation to be done, then pass the request out to the user
   process"; the other means: "enter this translation into the kernel
   table".  Thus, when the kernel can't find an entry in the cache, it
   puts the request on a (global) queue and then does a wakeup().  The
   implementation of the first ioctl is to sleep() and then pull the
   first item off of this queue and return it to the user process.
   Since the kernel can't wait around at interrupt level until the user
   process replies, it can either give up (and assume that the
   requesting host will retransmit the request packet after a second) or
   if the second ioctl passes a copy of the request back into the
   kernel, formulate and send a response at that time.

AI ELI5

On this page
PROBLEMA diskless machine knows its MAC address but not its IP address.
MECHANISMIt broadcasts an ARP-shaped packet with opcode 3, and a server that holds a MAC-to-IP table answers with opcode 4.
WHY IT FADEDIt needs a server on every network segment and returns only an address, so BOOTP and then DHCP replaced it in practice.

§1Introduction

The Reverse Address Resolution Protocol (RARP) lets a host discover its protocol address, for example its IP address, when it knows only its hardware address. It is the complement of the Address Resolution Protocol (ARP) in RFC 826, which goes the other way and finds a hardware address from a protocol address.

The RFC's problem statement is short: network hosts such as diskless workstations often know only their hardware interface address when they boot, and "there is no standard mechanism" for finding the rest. Like ARP, RARP assumes a broadcast medium such as Ethernet.

Imagine it's the first day at a new school. You know your name, because it is sewn into your jacket, but you don't know your locker number. So you stand in the hallway and shout: "My name is Sam! What's my locker?" The school office has a list of every name and locker, and someone there shouts back: "Sam, you're locker 21." That's RARP. The jacket name is the computer's MAC address, the locker is its IP address, and the office is the RARP server.

ARP and RARP are inverses
ARP · RFC 826192.0.2.1 → ??:??:??"Who has this IP? Tell me your MAC."
INVERSE OF
RARP · RFC 90308:00:20:01:AB:C2 → ?.?.?.?"Who has this MAC? Tell me its IP."

§2Motivation

Diskless workstations booted over the network and had no local disk to hold configuration, yet they needed an IP address before they could talk to anyone. The Ethernet address lives in the network card, but the IP address is assigned by an administrator and has no algorithmic relationship to it. Something had to bridge the two, and in 1984 nothing standard did.

The table compares RARP with the other options for getting an address into a machine that has no disk.

A computer with no hard drive has nowhere to write down its own address, so every time it wakes up it has forgotten. It needs someone to ask.

Ways to give a diskless machine an address
ApproachProsCons
Address stored on the machine (boot PROM)Simple, no serverDoes not scale, error-prone
RARP THIS RFCCentral table, automaticNeeds a server on every network segment
BOOTP (1985, later)Can be relayed across routers, supplies more informationNeeds a UDP/IP stack

§3Design

The authors list four considerations behind the design. ARP and RARP are different operations. A RARP server must keep a large database, which is hard to hold inside an operating-system kernel. Ease of implementation and little impact on existing hosts matter. And sharing code with existing software is desirable.

The result is a separate protocol at the data-link level that reuses ARP's packet format.

RARP borrows ARP's envelope but puts a different stamp on it, so computers that only know ARP don't get confused.

Design choices
  • Separate protocol, shared formatSame packet layout as ARP but its own Ethertype, so existing ARP code is not confused.
  • Data-link level onlyRARP assumes a broadcast medium like Ethernet, so client and server share one network segment.
  • Servers hold the databaseOne or more hosts keep the hardware-to-protocol table, usually in a program outside the kernel.
  • No error packetsThere is no "not found" reply because many servers may answer; a client simply times out.

§4Packet Format

RARP uses exactly the packet format of ARP. For 48-bit Ethernet addresses and 32-bit Internet addresses every packet has hardware type 1, protocol type 2048 (0x0800, the Ethertype of IP), hardware length 6 and protocol length 4. That adds up to 28 bytes. The RFC leaves the RARP Ethertype "still to be assigned"; it was later registered as 0x8035, different from ARP's 0x0806.

In a request (opcode 3) the sender and target hardware address fields both hold the client's own MAC, and both protocol address fields are undefined. In a reply (opcode 4) the target protocol address carries the answer, and the sender fields identify the responder. Switch between request and reply below to see which fields change.

The packet is a form with nine boxes. The question fills in the box for "my name tag" and leaves "my address" blank. The answer fills in that blank.

FIG 4.1 · RARP PACKET · 28 BYTES
RARP packet
FieldNameSizeRequest · op 3Reply · op 4Description
HTYPEHardware Type2 bytes0x00010x0001ar$hrd. Hardware address space. Ethernet = 1.
PTYPEProtocol Type2 bytes0x08000x0800ar$pro. Protocol address space. IPv4 = 2048 decimal (0x0800), the Ethertype of IP packets.
HLENHW Addr Length1 byte66ar$hln. Length of a hardware address in bytes. Ethernet = 6.
PLENProto Addr Length1 byte44ar$pln. Length of a protocol address in bytes. IPv4 = 4.
OPEROperation2 bytes34ar$op. 3 = request reverse, 4 = reply reverse. Opcodes 1 and 2 keep their ARP meaning.
SHASender HW Addr6 bytes08:00:20:01:AB:C208:00:20:0F:11:90ar$sha. In a request, the sender's own MAC. In a reply, the responder's MAC.
SPASender Proto Addr4 bytesundefined192.0.2.250ar$spa. Undefined in a request. In a reply, the responder's protocol address (a convenience, so the client may skip a later ARP).
THATarget HW Addr6 bytes08:00:20:01:AB:C208:00:20:01:AB:C2ar$tha. The hardware address being looked up. A client asking about itself puts its own MAC here, and a reply repeats it.
TPATarget Proto Addr4 bytesundefined192.0.2.1ar$tpa. Undefined in a request. In a reply, the answer: the protocol address of the target.

§5Protocol Operation

RARP adds two opcodes beside ARP's 1 and 2: 3 ("request reverse") and 4 ("reply reverse"). A packet with any other opcode is undefined. As in ARP there are no "not found" or "error" packets, because several servers may be free to answer; a client that hears nothing should time out after a reasonable time.

Step through the exchange below, then put the server behind a router to see why RARP stays on one network segment.

Ask, wait, get an answer, and if nobody answers, ask again later. If the office is in another building, the shout never gets there.

Opcodes
  • 1ARP request
  • 2ARP reply
  • 3RARP request — who has this MAC?
  • 4RARP reply — that MAC is this IP
simulation · one Ethernet segment

RARP on one Ethernet segment

  1. A workstation powers on knowing only its MAC

    boot

    A diskless host has its 48-bit Ethernet address in ROM but no protocol address, so it cannot use IP until it learns one.

    Why: IP addresses are assigned by people, not derived from the hardware, so the machine has to ask someone.

  2. It shouts a RARP request to everyone

    broadcast

    The client sends opcode 3 with its own MAC in both the sender and target hardware fields; the protocol address fields are undefined. By convention the frame goes to the Ethernet broadcast address FF:FF:FF:FF:FF:FF.

    Why: It has no IP address and does not know where a server is, so shouting to the whole segment is its only option.

  3. Ordinary hosts ignore it

    filter

    Hosts that do not run RARP server software have nothing to answer with, because they hold no hardware-to-protocol table. Using a separate Ethertype also keeps the request away from plain ARP code.

    Why: Only a host that keeps the mapping table can give a useful answer.

  4. The RARP server checks its table

    lookup

    The server looks up the target hardware address in its database to find the matching protocol address. On BSD-style systems that is traditionally /etc/ethers combined with /etc/hosts.

    Why: Someone has to keep that table up to date by hand, which was a real operational cost.

  5. The server sends back the answer

    reply

    The server sends opcode 4. The target hardware address repeats the request, the target protocol address carries the desired IP, and the sender fields identify the responder. Implementations normally address the frame directly to the client's MAC.

    Why: Filling in the responder's own address pair as well may save the client a later ARP request.

  6. The workstation now has an IP address

    configured

    The client adopts 192.0.2.1 and carries on booting, typically by fetching a boot image over TFTP. If no reply ever arrives, it times out and asks again; the RFC leaves the interval open.

    Why: That is all RARP provides: no gateway, no DNS server, no boot file name. BOOTP added those.

Failure branch: with the server behind a router

  1. The request dies at the router

    blocked

    RARP works at the data-link level on a broadcast medium, and routers do not forward link-layer broadcasts. With no RARP server on this segment, the request is never answered.

    Why: This is why BOOTP (RFC 951) was built on UDP/IP: it can be relayed across routers.

Server's lookup table /etc/ethers + /etc/hosts
MACIPHost
08:00:20:01:AB:C2192.0.2.1sparc-ws-01
08:00:20:01:AB:C3192.0.2.2sparc-ws-02
08:00:20:01:AB:C4192.0.2.3sparc-ws-03
08:00:20:01:AB:C5192.0.2.4sparc-ws-04

What replaced it

RARP is still in the standards track, but BOOTP and then DHCP took over its job in practice.

§6Implementation

The RFC's Appendix A sketches two ways to build a server on 4.2BSD Unix. One runs the whole server outside the kernel and needs a way to receive and send raw data-link packets, such as the CMU packet-filter pseudo driver. The other keeps a small cache of database entries in the kernel, filled from the full database kept by a user process through two new ioctls.

Classic Unix servers such as rarpd answer from the ethers(5) file, which maps a MAC address to a host name, and from the hosts file, which maps that name to an IP address. Neither file is part of the RFC; they are common practice. A server is needed on every network segment, because requests do not cross routers.

The helper keeps two lists: one that says which name tag belongs to which computer, and one that says which address belongs to which computer.

/etc/ethers and /etc/hosts (traditional server data)
# /etc/ethers   (MAC address to host name)
08:00:20:01:ab:c2  sparc-ws-01
08:00:20:01:ab:c3  sparc-ws-02
08:00:20:01:ab:c4  sparc-ws-03

# /etc/hosts      (host name to IP address)
192.0.2.1  sparc-ws-01
192.0.2.2  sparc-ws-02
192.0.2.3  sparc-ws-03

§7What replaced it

RARP's limits were its own design: it works only on one broadcast network segment, and it returns just an address. BOOTP (RFC 951) moved the idea onto UDP and IP so it can be relayed between networks, and added a boot file name and extra fields; RFC 1542 clarified it. DHCP (RFC 2131) added leases and a rich set of options. Those became what machines actually use.

RARP itself has never been withdrawn: the RFC Editor's index lists RFC 903 as an Internet Standard (STD 38), so this page says "superseded in practice", not obsolete.

Later helpers could answer from other buildings and could also tell the computer where to find its files. RARP could do neither.

§8References