ARP Cache Entries – Understanding and Managing

arpNetworkpingrouterswitch

Consider 2 PCs 01 and 02, where 01 is connected to a router R, which is in turn connected to a switch S, connected to 02:

                    01--R--S--02

I need to understand what would happen to the ARP cache of 02 if it were pinged by PC 01, and then by switch S.

I'm confused on this and would really appreciate any help I could get.

Best Answer

ARP stores the mapping between IP addresses and their respective MAC addresses.

Since you mention that your switch can ping, I'm going to assume that you mean it's a Layer 3 switch and not a pure Layer 2 switch.

Assuming the setup is as below:

PC1 (.1) --- R1 (.2) --- S1 (.3) ---- (.4) PC2

[Network: 10.10.10.0/24]

[I'm assuming 10.10.10.2 and 10.10.10.3 in R1 and S1 respectively are SVIs and the links in R1 and S1 are all switch-ports]

Pinging from PC1 to PC2 will make an ARP entry in PC2 as: 10.10.10.1 --- PC1

Pinging from S1 to PC2 will make an ARP entry in PC2 as: 10.10.10.3 --- S1

I think your confusion can be cleared by the fact that when you are pinging from PC1 to PC2, the packet is bridged through R1 and S1 to PC2 without any of the headers being changed, (i.e.) the source MAC address is still going to be PC1.

Now let's assume PC1 and PC2 are in different subnets.

PC1(10.10.10.1) --- (10.10.10.2) R1 (20.20.20.1) --- S1 (20.20.20.2) ---- (20.20.20.3) PC2

[Again here I'm assuming 20.20.20.2 to be a SVI and the links in S1 to be switch-ports]

When you are pinging from PC1 to PC2 and assuming that the default gateway R1 has been set for PC1, then the ping packet will be sent to R1, who will then route it towards the correct network (20.20.20.0/24 in this case).

So pinging from PC1 to PC2 will make an ARP entry in PC2 as: 20.20.20.1 --- R1

Pinging from S1 to PC2 will make an ARP entry in PC2 as: 20.20.20.2 --- S1

Related Topic