I thought of this blog following up a very popular blog of mine on Recursive Lookups. End-to-end communication between two Layer3/Layer2 hops is yet another networking fundamental concept which ought to be understood.
Here is the topology I’ll be using:
Notice the following:
- all mac-addresses have been changed on all Layer3 interfaces
- there are two networks – 192.168.1.0 /24 & 192.168.2.0 /24
- each switch is servicing its own VLAN-1 – i.e. there is no trunking between the two switches
- arp & mac address learning debuging has been enabled
Before each of the following tests, I will be clearing the mac-address tables on all Layer2 devices (switches) as well as the arp-cache on all Layer3 devices (routers).
- Before any communication happens, we need to have Layer2 information – on an Ethernet network this is found in the MAC-ADDRESS table
- Same applies in regards to Layer3 information – this is found in the ARP table
- If the destination IP address is on the same LAN, an ARP request is sent out to find out the MAC address of the actual destination IP
- When the destination IP is *not* on the same LAN, an ARP request is sent out to find out the MAC address of the configured default gateway
- An ARP request is received by all host on the same broadcast domain – ideally though, only one host should reply – the one with the IP address which matches the destination IP
- As the packet travels from hop-to-hop (L2 and L3) the source and destination MAC addresses will change; this is not true for the source and destination IP addresses which will always stay the same
- You should also know that the host will use the network mask to find out whether or not the destination IP is on the same LAN
Other Related Posts: