Address Resolution Protocol
(ARP)
PREPARED BY
GowthamrajF
Address Resolution Protocol
•If you learned about the OSI Model and encapsulation
/ decapsulation you know that when two computers on
the LAN want to communicate with each other the
following will happen:
•An IP packet is created with a source and destination IP
address carrying the data from an application.
•The IP packet will be encapsulated in an Ethernet
frame with a source and destination MAC address.
Address Resolution Protocol
•The sending computer will of course know its
source MAC address but how does it know the
destination MAC address?
•That’s where ARP comes into play.
Address Resolution Protocol
•Ping uses the ICMP protocol and IP uses the
network layer (layer 3). Our IP packet will have
a source IP address and a destination IP
address.
•Next step will be to put our IP packet in an
Ethernet frame where we set our source MAC
address and destination MAC address
.
Address Resolution Protocol
Address Resolution Protocol
•When PC0 needs to communicate with PC1
•Now PC0 needs to determine whether PC1 is
located in the same subnet because this will
determine whether the frame will have the
Mac of PC1 or the Mac of the default
gateway(DG)
Address Resolution Protocol
•PC0 determines its network/subnet portion by
comparing its ipaddress to its subnet mask in
binary as follows:
•11000000.10101000.00000000.00000001–PC0 IP address in binary
•11111111.11111111.11111111.00000000–PC0 Subnet mask in binay
•---------------------------------------------------------------------------
•11000000.10101000.00000000. -PC0 network/subnet ID
•------------------------------------------------------
Address Resolution Protocol
•The 1s in the subnet mask identify the
network portion.
•Now PC0 compares the exact same binary bits
to those binary bits in PC1 address as follows:
•11000000.10101000.00000000.-PC0network/subnet ID
•11000000.10101000.00000000. -PC1 Ipaddress in binary
•Because the binary bits are the same. PC0 concludes that
PC1 is in the same network/subnet.
Address Resolution Protocol
•Therefore, it can communicate directly with it
and does not need to send the data to its
default gateway.
•PC0 will create a frame with its own source
MAC address and the MAC of PC1 as the
destination.
Address Resolution Protocol
•You know about the OSI-model and also know we
have to go through all the layers.
•Ping uses the ICMP protocol and IP uses the
network layer (layer 3). Our IP packet will have a
source IP address of 192.168.0.1 and a
destination IP address of 192.168.0.2. Next step
will be to put our IP packet in an Ethernet frame
where we set our source MAC address AAA and
destination MAC address BBB.
Address Resolution Protocol
•Now wait a second…how does PC0 know
about the MAC address of PC1?
•We know the IP address because we typed it
but there is no way for PC0 to know the MAC
address of PC1. There is another protocol we
have that will solve this problem for us, it’s
called ARP (Address Resolution Protocol).
Address Resolution Protocol
Address Resolution Protocol
•We are sitting behind PC0 and we want to send a
ping to PC1.
•The ARP table is empty so we have no clue what
the MAC address of PC1 is.
•The first thing that will happen is that PC0 will
send an ARP Request. This message basically says
“Who has 192.168.0.2 and what is your MAC
address?” Since we don’t know the MAC address
we will use the broadcast MAC address for the
destination (FF:FF:FF:FF:FF:FF). This message will
reach all computers in the network.
Address Resolution Protocol
Address Resolution Protocol
Address Resolution Protocol
•PC1 will reply with a messageARP Replyand
is basically saying “that’s me! And this is my
MAC address”. PC0 can now add the MAC
address to its ARP table and start forwarding
data towards PC1.
Address Resolution Protocol
Address Resolution Protocol
Address Resolution Protocol
•When PC0 needs to communicate with PC1
•Now PC0 needs to determine whether PC1 is
located in the same subnet because this will
determine whether the frame will have the
Mac of PC1 or the Mac of the default
gateway(DG)
Address Resolution Protocol
•PC0 determines its network/subnet portion by
comparing its ipaddress to its subnet mask in
binary as follows:
•11000000.10101000.00000000.00000001–PC0 IP address in binary
•11111111.11111111.11111111.00000000–PC0 Subnet mask in binay
•---------------------------------------------------------------------------
•11000000.10101000.00000000. -PC0 network/subnet ID
•------------------------------------------------------
Address Resolution Protocol
•The 1s in the subnet mask identify the
network portion.
•Now PC0 compares the exact same binary bits
to those binary bits in PC1 address as follows:
•11000000.10101000.00000000.-PC0network/subnet ID
•11000000.10101000.00000001. -PC1 Ipaddress in binary
•Because the binary bits are not same. PC0 concludes that
PC1 is in the different network/subnet.
Address Resolution Protocol
•PC0 concludes that the PC1 is in different
network/subnet, because the bits are not the
same.
•Therefore to communicate with the PC1, its
needs to send the data to its default gateway.
•PC0 will create a frame with its own source
MAC address and the MAC of R0 as the
destination
Address Resolution Protocol
Address Resolution Protocol
Address Resolution Protocol
Address Resolution Protocol
Question
Question
•PC0 send ARP Request to PC1 or Router R0?
•PC0 can able to learn Mac address of PC1 or
Router R0?
•PC0 can bale to ping PC1?