COMP429
Computer Network Software
Lecture 04: Address Resolution Protocol (ARP)____________________

Jeff Wiegley, Ph.D.
Computer Science
jeffw@csun.edu

Revised: February 15, 2006

1


Introduction__________________________________________

So now we have the following:

This raises the important question: “How does a host or router map an Internet address to the correct physical address?”

2


Address Resolution Problem_______________________

This is know as the address resolution problem

Consider two machines A and B. They both have:

The hosts wish to communicate using the Internet addresses IA and IB but ultimately the physical networks must use addresses PA and PB.

Because the packets may cross over multiple routers there are two, similar, problems:

  1. The last router must have some way of determining the physical address of the final destination.
  2. At each hop the sender must be able to determine the physical address of the next router.

This has been solved in several ways

3


Direct mapping_______________________________________

Networks that use small, configurable physical address (non-Ethernet) can use a simple direct mapping.

In such networks the system administrator assigns a small fixed address to each host.

The mapping can then be as simple as assigning the Host-ID as the physical address.

In such an evironment address resolution is trivial and can be described as a simple mathematical function:

PA = f(IA).

Advantages include computationally simple and requires no external data.

Disadvantages include that it won’t work with Ethernet because the physical address is statically assigned by the manufacturer. Replacing a broken NIC changes the physical address.

4


Dynamic Binding____________________________________

Direct mapping for Ethernet is also impossible because the address space of the physical address (248) is larger than that of Internet addresses (232).

But Ethernet has an advantage: It’s a broadcast network.

The designers chose a low level protocol that bind addresses dynamically without a centralized database.

This protocol is called the Address Resolution Protocol (ARP).

5


ARP___________________________________________________

When host A wants to know the physical address for host B it simply broadcasts a special packet.

This packet asks the host with address IB to respond with its physical address.

Since the request packet is broadcast all machines will see it.

All but one machine will ignore it. The remaining machine will send back its physical address.

This protocol is reasonable efficient and easy to maintain.

6


Silliness________________________________________________

Wait in order to send a packet to B I first have to send a packet to B??

Why don’t we just broadcast the original packet in the first place? Efficiency!!.

Imagine if every packet sent on the internet was a broadcast packet. All the bandwidth would be instantly used up and it would be like a crowd at a football game all trying to talk to one another by talking to everybody.

Clearly, broadcasting is far too expensive to be used for every packet.

7


Address Resolution Cache:_________________________

To solve this efficiency problem every host and router (and switch) maintains an ARP cache.

When machine A wants to send a packet it first checks the cache to see if the physical address for B is already known.

If so then that physical address is used for direct communication to B.

If not then the ARP request is sent, B responds and A stores the response in its ARP cache.

8


Cache timeouts_______________________________________

The cache has some problems.

This leads to items in the cache become stale (inaccurate).

It is the owner of the cache who is responsible for maintaining the accuracy of the cache information.

To deal with this entries in the ARP cache have timeouts set for them. When the timer for entry expires that ARP request/response procedure will be done again in order to refresh the cache.

This increases bandwidth usage marginally but insures that the information in the cache is up to date, correct and useful.

The main disadvantage is delay. The sender may not know about the absence or crash of a machine until the timeout occurs.

9


Refinements___________________________________________

If A is sending to B then there is a very high probability that B will be sending to A in the very near future.

In anticipation of this the ARP request generated by A includes A’s physical and Internet address.

This allows B to learn A’s binding without going through an ARP request itself.

In fact, all machines may learn A’s binding since the request was broadcast.

Lastly, If A’s binding changes it provides all the other machines an opportunity to correct their cache information.

10


ARP encapsulation__________________________________

Recall that Ethernet communication is carried out using frames.

The ARP message must be encapsulated within a frame so that it can be delivered on the Ethernet network segment.

In Eternet, frames carrying ARP messages can be identified by the frame’s type field being set to 080616.

Other network technologies may use other methods of encapsulating or delivering ARP messages.

11


ARP messages________________________________________

ARP is designed to be network independent.

ARP address fields cannot be a fixed length because different networks utilize different length physical addresses.

For Ethernet the message format is:

12


Message fields________________________________________

Hardware Type: specifies the type of hardware interface the ARP is requesting information about. For Ethernet this valu‘e is 1.

Protocol Type: Contains the type of high-level address the sender is supplying. For IP addresses this value is 080016.

Operation: 1 for an ARP request, 2 for an ARP response, 3 for RARP request and 4 for RARP response.

HLEN and PLEN: allow ARP to be used with a variety of networks and specify the lengths of the hardware and physical addresses respectively.

13


Revalidation/Jitter__________________________________

Assume that packets are being delivered between A and B for sometime. All packets are experiencing about the asme network delays.

When the ARP cache timeout occurs the next packet will experience an unusually long delay while the ARP protocol is carried out again.

This delay is called jitter and would introduce additional problems for streaming applications such as video and audio.

The solution to avoid jitter to associate two timers with each cache entry. A timeout timer and a shorter revalidation timer.

When the revalidation timer expires the host carries out the ARP protocol while simultaneously delivering data based on the current cache entry.

The revalidation and timeout timers are reset for a successful ARP revalidation.

14


Reverse Address Resolution (RARP)______________

RARP is no longer used on the internet but provided an important ability at one time.

There were many hosts originally that were diskless clients and did not have an IP address when they were first booted.

To obtain an IP address these hosts would broadcast a RARP request using their known hardware address. Some other, authoritative machine would see the request, look up what the hosts IP address should be and would send back a RARP response to that machine.

On Ethernet the frame type is set to 803516 to indicate a frame with a RARP message.

This would allow machines to learn an IP address and continue booting and connecting to the internet.

This functionality has been taken over by higher-level protocols such as bootp and DHCP which are far more capable and provide much more information that just IP addresses to diskless, or dynamic, clients.

15