background image
226 Chapter 5: Network Protocols
UDP gains some advantages over TCP by not using the sequence and acknowledgment fields.
The most obvious advantage of UDP over TCP is that there are fewer bytes of overhead. Not as
obvious is the fact that UDP does not require waiting on acknowledgments or holding the data
in memory until it is acknowledged. This means that UDP applications are not artificially
slowed by the acknowledgment process, and memory is freed more quickly.
Address Resolution Protocol
One common problem that CCNAs deal with on a regular basis is this: Given some Layer 3
address, what is its corresponding Layer 2 address? Address Resolution Protocol (ARP) is the
process by which this question is answered for an IP host on a LAN.
ARP is needed because to send an IP packet across some LAN, the data link header and trailer
(which encapsulate the packet) must first be created. The source MAC address in this new
header is known, but the destination MAC is not known in advance; ARP is the method IP uses
to discover the destination MAC address. Figure 5-10 shows an example of the ARP process.
Figure 5-10
The ARP Process
The ARP reply includes Barney's MAC address in this example. An ARP cache holds the ARP
entries (IP address and MAC address in each entry) for each interface. If packets are flowing in
and out the interface from and to the IP address, the cache entry stays fresh. After a period of
disuse for an entry, the entry in the table is removed. Any need to send packets to that IP address
out that same interface after the ARP entry times out will require another ARP exchange.
From an architecture perspective, ARP is a Layer 3 function and is defined in RFC 826. From
a programming perspective, ARP calls the LAN data link layer code, which is indicative of a
Layer 3 protocol. Note the location of ARP in the architectural model in Figure 5-11.
1
ARP Request
If your IP
address is 1.1.1.1,
please reply.
Fred
ARP Reply
OK, my MAC is
0200.1234.5678
Barney
2
ch05.fm Page 226 Monday, March 20, 2000 5:06 PM