You are on page 1of 10

Address Resolution Protocol

(ARP)

CS144, Stanford University 1


Layers of Addresses

Application
Presentation
Session
Transport
Network Host: 171.67.76.65
Link Interface: 00:13:72:4c:d9:6a
Physical

CS144, Stanford University 2


Addressing Problem
0:18:e7:f3:ce:1a 0:18:e7:f3:ce:1b
00:13:72:4c:d9:6a 9:9:9:9:9:9
A gateway B
192.168.0.5 192.168.0.1 171.43.22.5

CS144, Stanford University 3


Example Addressing
0:18:e7:f3:ce:1a 0:18:e7:f3:ce:1b
00:13:72:4c:d9:6a 9:9:9:9:9:9
192.168.0.1 171.43.22.8
A gateway B
192.168.0.5 171.43.22.5

CS144, Stanford University 4


Encapsulation
0:18:e7:f3:ce:1a 0:18:e7:f3:ce:1b
00:13:72:4c:d9:6a 9:9:9:9:9:9
192.168.0.1 171.43.22.8
A gateway B
192.168.0.5 171.43.22.5
netmask: 255.255.255.0
gateway: 192.168.0.1

CS144, Stanford University 5


Example Problem

Internet

gateway
192.168.0.1
switch 0:18:e7:f3:ce:1a

Ethernet address: 68:a8:6d:05:85:22


IP address: 192.168.0.5
IP Netmask: 0xffffff00
client client client IP Gateway: 192.168.0.1
192.168.0.4 192.168.0.76

CS144, Stanford University 6


Address Resolution Protocol
• Generates mappings between layer 2 and layer 3 addresses
▶ Nodes cache mappings, cache entries expire
• Simple request-reply protocol
▶ “Who has network address X?”
▶ “I have network address X.”
• Request sent to link layer broadcast address
• Reply sent to requesting address (not broadcast)
• Packet format includes redundant data
▶ Request has sufficient information to generate a mapping
▶ Makes debugging much simpler
• No “sharing” of state: bad state will die eventually

CS144, Stanford University 7


ARP Packet Format (RFC826)

Hardware Protocol
Hardware length Protocol length Opcode
Source hardware address
Source protocol address
Destination hardware address
Destination protocol address
Data
32 bits
grey fields are variable length, determined by length fields
CS144, Stanford University 8
ARP Request

Internet

gateway
192.168.0.1
switch 0:18:e7:f3:ce:1a

Ethernet address: 68:a8:6d:05:85:22


IP address: 192.168.0.5
IP Netmask: 0xffffff00
client client client IP Gateway: 192.168.0.1
192.168.0.4 192.168.0.76

CS144, Stanford University 9


ARP Reply

Internet

gateway
192.168.0.1
switch 0:18:e7:f3:ce:1a

Ethernet address: 68:a8:6d:05:85:22


IP address: 192.168.0.5
IP Netmask: 0xffffff00
client client client IP Gateway: 192.168.0.1
192.168.0.4 192.168.0.76

CS144, Stanford University 10

You might also like