You are on page 1of 3

Check my understanding - ARP and...

Gareth.Harle 6 posts since Mar 14, 2012


Check my understanding - ARP and Switches Apr 30, 2014 5:27 AM
I just want to check my understanding of ARP broadcasts and switch flooding...

Assume two PC's are connected to a single switch. There are no entries in the Mac address table on the switch
or the ARP cache on the PC's.

1) Host A produces an ARP broadcast message to find the IP of Host B.


2) The switch floods this broadcast out of all ports (bar the originating port) as a broadcast message and adds
an entry for Host A in it's Mac Address Table.
3) HOST B replies with it's IP and the switch filters that reply to only the port host A is connected.
4) The switch also adds an entry for Host B into it's Mac Address Table.
5) Subsequent connections then use the ARP cache on the clients (to get the IP) and the Mac Address Table
in the switch to filter the traffic in essence creating and end to end connection.

Is this correct?
Tags: arp

Ri0N 2,187 posts since Dec 29, 2011


Re: Check my understanding - ARP and Switches Apr 30, 2014 5:57 AM
Yes, that is accurate. Only one minor specification in steps 1) and 3): HOST B "replies" with its MAC (not IP)
address. Remember that ARP resolves a Layer 3 address to a Layer 2 address. HOST A already knows the
IP address where it wants to send the packet, but it still needs the MAC address of that host. Once learned,
HOST A will save the MAC address of HOST B in its ARP cache and will refer to the cache when constructing
subsequent packets for HOST B. The switch will then forward the packet (examining the destination MAC
address) based on the information it has in its MAC address table. The process operates exactly as you
described. Here is an example packet capture for ARP:

sarah 2,313 posts since Sep 12, 2013


Re: Check my understanding - ARP and Switches Apr 30, 2014 5:54 AM
Gareth.Harle,

"Host A produces an ARP broadcast message to find the IP of Host B."..........

and

2015 Cisco and/or its affiliates. All Rights Reserved. Generated on 2015-05-24-07:00
This document is Cisco Public Information.
1
Check my understanding - ARP and...

"HOST B replies with it's IP and the switch filters that reply to only the port host A is connected."

and

"Subsequent connections then use the ARP cache on the clients (to get the IP)"

...............replace the IP with MAC address. ARP will resolve to the MAC address that matches the IP address.
In order for ARP to work, you have to provide it with an IP address....

PC1 checks the ip address against its own mask to determine if the IP address belongs to the same subnet

I'm reposting an earlier reply of mine on the ARP process....

PC1 checks the ip address against its own mask to determine if the IP address belongs to the same subnet

Yes......

1. PC1 checks its ARP cache to find the MAC address of the destination PC. Hence the frame is built
accordingly, with source/destination MAC address and source/destination IP address. (you have provided the
destination address when you type in the URL)
2. If the ARP cache of PC1 does not list the MAC address, PC1 ARPs for the MAC address of the destination
PC....remember here....PC1 has the IP address of the destination that it will use to ARP for its MAC.
3. To get the MAC address, the switch will flood the frame it recived from PC1....out all its ports, except the
one it received from PC1.....and then the intended recipient responds back acknowledging the ARP request by
replying with its own MAC address information.

Now the switch adds the MAC address of the returning frame to its MAC table. It already has the MAC address
of PC1, for which this returning frame is destined, hence forwards it out the ethernet port PC1 is attached to.

If the destination is in a different subnet/network....


1. PC1 will send an ARP request for the default gateway.

2. Switch receives the frame.....switch checks its MAC address table.

3. Scenario 1 - Is the exit interface for the default gateway is listed in its MAC address table - -> yes .....switch
will send the frame out that port to the default gateway

Scenario 2 - If the exit interface is not listed in the MAC table of the switch, then the switch will floods
that frame out all it ports except the incoming interface.....and then the intended recipient responds back
acknowledging the ARP request by replying with its own MAC address information.

2015 Cisco and/or its affiliates. All Rights Reserved. Generated on 2015-05-24-07:00
This document is Cisco Public Information.
2
Check my understanding - ARP and...

Now the switch adds the MAC address of the returning frame to its MAC table. It already has the MAC address
of PC1, for which this returning frame is destined, hence forwards it out the ethernet port PC1 is attached to.

Now the router will forward it out the interface that indicates connectivity towards the destination PC2

Gareth.Harle 6 posts since Mar 14, 2012


Re: Check my understanding - ARP and Switches Apr 30, 2014 6:00 AM
in response to sarah
Yes indeed, what a silly mistake. ARP is looking for Macs not IPs. Thank you all for helping me out with that.

Gareth

2015 Cisco and/or its affiliates. All Rights Reserved. Generated on 2015-05-24-07:00
This document is Cisco Public Information.
3