You are on page 1of 17

Advance Computer Networks

Spring 2020-21
Lect. #09

Prof. Suchismita Chinara


Dept. of Computer Science Engg.
National Institute of Technology Rourkela-769008
Email: suchismita@nitrkl.ac.in
18-01-2021 Advance Computer Networks 1
Address Resolution Protocol (ARP)
• Though IP address is used to identify a host in the network, the actual
communication happens over Physical address (MAC address).
• Thus, the protocol that is used to translate IP address to physical
address is called the Address Resolution Protocol (ARP).

18-01-2021 Advance Computer Networks 2


Protocols of Network Layer
• ARP is one of the sister protocols of IP.

18-01-2021 Advance Computer Networks 3


ARP
• A logical address is an Internet address. It’s jurisdiction is
universal, a logical address is unique universally.
• A physical address is a local address. It’s jurisdiction is a local
network, it should be unique locally.
• The address resolution protocol maps a logical address to a
physical address.

18-01-2021 Advance Computer Networks 4


ARP Request (broadcast) / Reply (unicast)

18-01-2021 Advance Computer Networks 5


How does ARP function?
• The Sender asks the receiver to announce its physical address
when needed.

• ARP is designed to this purpose.

• Anytime, a host(router) needs to find the physical address of


another host(router) on its network, it sends an ARP Request and
the query packet is broadcast over the network.

• Host will ignore the ARP request, if the IP address is not the host.
Otherwise the host will reply to the sender.
18-01-2021 Advance Computer Networks 6
• Every host(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 Reply.

18-01-2021 Advance Computer Networks 7


Example ARP

18-01-2021 Advance Computer Networks 8


Format of ARP Packet

18-01-2021 Advance Computer Networks 9


ARP packet description
• Hardware type: This is a 16-bit field defining the type of the
network on which ARP is running.

• Protocol Type: This is a 16-bit field defining the protocol.

• Hardware length: This is an 8-bit field defining the length of the


physical address in bytes.(6 bytes for Ethernet)

• Protocol length: This is an 8-bit field defining the length of the


logical address in bytes.(4 bytes for IP address)
18-01-2021 Advance Computer Networks 10
ARP packet description
• Operation: This is a 16-bit field defining the type of the
packet. (why 16 bit ?)
• Sender hardware address: This is a variable-length field defining
the physical address of the sender.
• Sender protocol address: This is a variable-length field defining
the protocol address of the sender.
• Target hardware address: This is a variable-length field defining
the physical address of the target. For ARP request is field is all
0s, because the sender foes not know the physical address of
the target.
• Target protocol address: This is a variable-length field defining
the protocol address of the target.
18-01-2021 Advance Computer Networks 11
Encapsulation of ARP packet

HDLC Frame Format


18-01-2021 Advance Computer Networks 12
The ARP Process
• The sender knows the IP address of the target.
• IP asks ARP to create an ARP request packet.
• The packet is encapsulated in a frame using the physical
broadcast address (All FFs MAC address) as the destination
address.
• All machines except the one targeted drop the packet.
• The target machine replies with an ARP Reply Packet containing
its physical address. This packet is unicast.
• The sender receives the reply packet.
• The IP datagram is now encapsulated in a frame and is unicast
to the target machine.
18-01-2021 Advance Computer Networks 13
ARP functionality for different cases
• 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 send a packet to another


host on another network.
• Sender looks at its routing table.
• Find the IP address of the next hop (router) for this destination.
• Use ARP to find the router’s physical address

18-01-2021 Advance Computer Networks 14


ARP functionality for different cases
• 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.

18-01-2021 Advance Computer Networks 15


Ex: ARP for different Cases

18-01-2021 Advance Computer Networks 16


ARP Request / Reply details

18-01-2021 Advance Computer Networks 17

You might also like