Unit – I
ARP and RARP
1
Logical Addresses
• The hosts and routers are recognized at the network level by
their logical addresses
i. A logical address is an internet address
ii. Called a logical address because it is usually
implemented in software
• The logical addresses in the TCP/IP are called IP address and are
32 bits long
2
Physical Addresses
However, hosts/routers are recognized at the
physical layer by their physical address
• A physical address is an local address
• Called a physical address because
implemented in hardware
• Example : 48-bit MAC addresses in Ethernet
3
Translation
We need both the physical address and the
logical address for packet delivery
Thus, we need to be able to map a logical
address to its corresponding
and vice versa
Solutions
• Static
mapping
• Dynamic mapping
4
Static Mapping
Create a table that associates a logical address with
physical address and store in each machine
However, physical addresses may change
• A machine could change its NIC resulting in a new
physical address
• In some LANs, such as LocalTalk, the physical address
changes every time the computer is turned on
• A mobile station can move from one physical network to
another, resulting in a change in its physical address
5
Dynamic Mapping
Use a protocol to find another address
ARP: Address Resolution Protocol
• Map a logical address to a physical address
RARP: Reverse Address Resolution Protocol
• Map a physical address to a logical address
6
ARP and RARP
7
Position of ARP and RARP in TCP/IP
Protocol Suite
8
ARP Operations
To find the physical address of another host or
router on its network
• Send an ARP request message
ARP request message
• The physical address of the sender
• The IP address of the sender
• The physical address of the receiver is 0s
• The IP address of the receiver
9
Then, ARP request message is broadcast by
the physical layer
• For example: in Ethernet, MAC header’s
destination address is all 1s (broadcast address)
• Received by every station on the physical
network
The intended recipient send back an ARP
reply message
• ARP reply message packet is unicast
10
11
ARP Packet
12
Packet Format
HTYPE (Hardware type)
• 16-bit field defining the underlying type of the
network
D Ethernet is given the type 1
D ARP can be used on any physical network
PTYPE (Protocol type)
• 16-bit field defining the protocol
D IPv4 is 080016
D ARP can be used with any higher-level protocol
13
Packet Format (Cont…)
HLEN (Hardware length)
• 8-bit field defining the length of the physical address in
bytes
D Ethernet has the value of 6
PLEN (Protocol length)
• 8-bit field defining the length of the logical address in
bytes
D IPv4 has the value of 4
OPER (Operation)
• 16-bit field defining the type of packet
• (1) = ARP request, (2) = ARP reply
14
Packet Format (Cont…)
SHA (Sender hardware address)
• A variable-length field defining the physical
address of the sender
SPA (Sender protocol address)
• A variable-length field defining the logical
address of the sender
15
Packet Format (Cont…)
SHA (Sender hardware address)
• A variable-length field defining the physical
address of the sender
SPA (Sender protocol address)
• A variable-length field defining the logical
address of the sender
16
Encapsulation of ARP Packet
An ARP packet is encapsulated directly into a
data link frame
Type field indicates that the data carried
by the frame is an ARP packet
17
Operations
The sender knows the target’s IP address
IP asks ARP to create an ARP request message
• The sender physical address
• The sender IP address
• The target physical address field is filled with 0s
• The target IP address
The message is passed to the data link layer to
encapsulate in a data link frame
• Physical destination address is broadcast address
18
Operations (Conti..)
Every host or routers receives the frame and since
the destination address is broadcast, pass it to the
ARP
• All machines’ ARP except the one targeted drop the
packet
The target reply with an ARP reply message
that contains its physical address and is unicast
The sender receives the reply message and knows
the target’s physical address
19
Four Cases of ARP
Case 1: The sender is a host and wants to send a
packet to another host on the same network
• Use ARP to find another host’s physical address
Case 2: The sender is a host and wants to a
send packet to another host on another network
• Sender looks at its routing table
• Findthe IP address of the next hop (router) for this
destination
• Use ARP to find the router’s physical address
20
Case 1:
21
Case 2:
22
Case 3: the sender is a router and received a datagram
destined for a host on another network
• Router check its routing table
• Find the IP address of the next router
• Use ARP to find the next router’s physical address
Case 4: the sender is a router that has
received a datagram destined for a host in the
same network
• Use ARP to find this host’s physical address
23
Case 3:
24
Case 4:
An ARP request is broadcast;
an ARP reply is unicast.
25
Example
A host with IP address 130.23.43.20 and
physical address 0xB23455102210
Another host with IP address 130.23.43.25
and physical address 0xA46EF45983AB.
The two hosts are the same Ethernet
on network
Show the ARP request and reply packets
encapsulated in Ethernet frames
26
Note that
• The IP addresses are shown in hexadecimal 27
Reply from B to A
28
Proxy ARP
Used to create a subnetting effect
A router running a proxy ARP
• Its ARP acts on behalf of a set of hosts
• If it receives an ARP request message looking for
the address of one of these host
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
29
Example
Administrator need to create a subnet without
changing the whole system
Add a router running a proxy ARP
30
31
RARP
A diskless machine is usually booted from
ROM
It cannot include the IP address
• IP address are assigned by the network
administrator
Obtain its logical address by the physical
address using the RARP protocol
32
RARP Operations
Note : The RARP request packets are broadcast;
the RARP reply packets are unicast.
33
Packet Format
The format of the RARP packet isthe same as
the ARP packet
Except that the operation field is
• Three for RARP request message
• Four for RARP reply message
34
RARP Packet
35
Encapsulations of RARP Packet
36
Alternative Solutions to RARP
When a diskless computer is booted, it needs
more information in addition to its IP address
• The subnet mask
• The IP address of a router
• The IP address of a name server
RARP cannot provide this extra information
Two protocols, BOOTP and DHCP, can
be used instead of RARP
37