Lecture05 Address Resolution Protocol (ARP)
Lecture05 Address Resolution Protocol (ARP)
Chapter 8
Address Resolution
Protocol (ARP)
Shawqi Kharbash
1
Objectives
• To make a distinction between logical address (IP
address) and physical address (MAC address).
• To describe how the mapping of a logical address to a
physical address can be static or dynamic.
• To show how the address resolution protocol (ARP) is
used to dynamically map a logical address to a physical
address.
• To show that the proxy ARP can be used to create a
subnetting effect
2
Address Mapping
The delivery of a packet to a host or a router requires
two levels of addressing: logical and physical. We need
to be able to map a logical address to its
Corresponding physical address and vice versa. These
can be done using either static or dynamic mapping.
3
Address Mapping
Static mapping means creating a table that associates a logical
address with a physical address. This table is stored in each
machine on the network. Each machine that knows, for example,
the IP address of another machine but not its physical address
can look it up in the table.
4
Address Resolution Protocol (ARP)
Anytime a host or a router has an IP datagram to send to
another host or router, it has the logical (IP) address of the
receiver. But the IP datagram must be encapsulated in a
frame to be able to pass through the physical network.
This means that the sender needs the physical address of
the receiver. A mapping corresponds a logical address to a
physical address. ARP accepts a logical address from the
IP protocol, maps the address to the corresponding
physical address and pass it to the data link layer.
5
Address Resolution Protocol (ARP)
Anytime a host, or a router, needs to find the physical address of
another host or router on its network, it sends an ARP query packet. The
packet includes the physical and IP addresses of the sender and the IP
address of the receiver. Because the sender does not know the physical
address of the receiver, the query is broadcast over the network
Every host or router on the network receives and processes the ARP
query packet, but only the intended recipient recognizes its IP address
and sends back an ARP response packet. The response packet contains
the recipient’s IP and physical addresses. The packet is unicast directly
to the inquirer using the physical address received in the query packet.
6
Address Mapping
LAN
System A System B
Request
LAN
System A System B
Reply
8
ARP Packet
Hardware type. This is a 16-bit field defining the type of the network on
which ARP is running. Each LAN has been assigned an integer based on
its type. For example, Ethernet is given the type 1. ARP can be used on
any physical network.
Protocol type. This is a 16-bit field defining the protocol. For example,
the value of this field for the IPv4 protocol is 0800 16. ARP can be used with
any higher-level protocol.
Hardware length. This is an 8-bit field defining the length of the physical
address in bytes. For example, for Ethernet the value is 6.
Protocol length. This is an 8-bit field defining the length of the logical
address in bytes. For example, for the IPv4 protocol the value is 4.
Operation. This is a 16-bit field defining the type of packet. Two packet
types are defined: ARP request (1), ARP reply (2).
9
ARP Packet
Sender hardware address. This is a variable-length field defining the
physical address of the sender. For example, for Ethernet this field is 6
bytes long.
10
ARP Encapsulation
An ARP packet is encapsulated directly into a data link frame. For
example, as shown in the Figure, an ARP packet is encapsulated
in an Ethernet frame. Note that the type field indicates that the
data carried by the frame is an ARP packet.
Type: 0x0806
11
ARP Operation
1. The sender knows the IP address of the target. We will
see how the sender obtains this shortly.
2. IP asks ARP to create an ARP request message, filling in
the sender physical address, the sender IP address, and the
target IP address. The target physical address field is filled
with 0s.
3. The message is passed to the data link layer where it is
encapsulated in a frame using the physical address of the
sender as the source address and the physical broadcast
address as the destination address.
12
ARP Operation
4. Every host or router receives the frame. Because the
frame contains a broadcast destination address, all stations
remove the message and pass it to ARP. All machines
except the one targeted drop the packet. The target
machine recognizes the IP address.
5. The target machine replies with an ARP reply message
that contains its physical address. The message is unicast.
6. The sender receives the reply message. It now knows
the physical address of the target machine.
7. The IP datagram, which carries data for the target
machine, is now encapsulated in a frame and is unicast to
the destination.
13
ARP Operation: Cases
Case 1: The sender is a host and wants to send a packet to another
host on the same network. In this case, the logical address that must
be mapped to a physical address is the destination IP address in the
datagram header.
14
ARP Operation: Cases
Case 2: The sender is a host and wants to send a packet to another host
on another network. In this case, the host looks at its routing table and
finds the IP address of the next hop (router) for this destination. If it does
not have a routing table, it looks for the IP address of the default router.
The IP address of the router becomes the logical address that must be
mapped to a physical address.
15
ARP Operation: Cases
Case 3: The sender is a router that has received a datagram
destined for a host on another network. It checks its routing
table and finds the IP address of the next router. The IP
address of the next router becomes the logical address that
must be mapped to a physical address.
16
ARP Operation: Cases
Case 4: The sender is a router that has received a datagram
destined for a host in the same network. The destination IP
address of the datagram becomes the logical address that
must be mapped to a physical address.
17
Example
A host with IP address 130.23.43.20 and physical address
B2:34:55:10:22:10 has a packet to send to another host
with IP address 130.23.43.25 and physical address
A4:6E:F4:59:83:AB (which is unknown to the first host).
The two hosts are on the same Ethernet network. Show
the ARP request and reply packets encapsulated in
Ethernet frames.
18
Example
19
Proxy ARP
A technique called proxy ARP is used to create a subnetting
effect. A proxy ARP is an ARP that acts on behalf of a set of
hosts. Whenever a router running a proxy ARP receives an
ARP request looking for the IP address of one of these hosts,
the router sends an ARP reply announcing its own hardware
(physical) address. After the router receives the actual IP
packet, it sends the packet to the appropriate host or router.
20
Proxy ARP
Added subnetwork
The proxy ARP router replies 141.23.56.21 141.23.56.22 141.23.56.23
to any ARP request received
for destinations 141.23.56.21,
141.23.56.22, and 141.23.56.23.
Request
Proxy ARP
Router or host router
21
Summary
We discussed:
– Address Mapping
– The ARP Protocol
22