802.1Q Encapsulation Explained

Hello again AZM!

The process will be much the same, however, in this case, Host A will have a default gateway of 10.10.10.50 and Host B will have a default gateway of 10.20.20.50. Each of these IP addresses correspond to the MAC address of the currently active router. So it is this MAC address that will be placed in the destination MAC address field. Let’s look at it step by step.

  1. Host A prepares a packet with destination IP address 10.20.20.200. It is on a different subnet, so when encapsulating, the destination MAC will be that of the default gateway (10.10.10.50). Using ARP, this MAC is learned and placed in the packet. This is the MAC that corresponds to the active router for VLAN 10, which is DIST_1
  2. The destination IP address of 10.20.20.200 will be used to look in the routing table of DIST_1 and see where this should be routed. The routing table shows that this should egress from the VLAN 20 SVI port on DIST_1 which has an IP address of 10.20.20.1. Note this is NOT the virtual HSRP interface, but the SVI interface on the switch.
  3. Encapsulation occurs, destination MAC address of Host B is inserted in the field and the MAC address table lookup takes place. Based on STP, whichever path is not blocked will be taken.
  4. The frame reaches ACCESS_SW2 and using another MAC address lookup it knows to send the packet from the port connected to Host B

The return trip works much the same way, but the DIST_1 and DIST2 switches are reversed. I’ll go through it quickly

  1. Host B sends a packet with destination IP address 10.10.10.10. MAC of default gateway (10.20.20.50) is destination MAC. This is the MAC that corresponds to the active router for VLAN 20, which is DIST_2
  2. The destination IP address of 10.10.10.10 will be used to look in the routing table. This should egress from the VLAN 10 SVI port on DIST_2 which has an IP address of 10.10.10.2. Note this is NOT the virtual interface, but the SVI interface on the switch.
  3. Encapsulation occurs, destination MAC address of Host A is inserted in the field and the MAC address table lookup takes place. Based on STP, whichever path is not blocked will be taken.
  4. The frame reaches ACCESS_SW1 and using another MAC address lookup it knows to send the packet from the port connected to Host A.

So the actual frame takes a different physical path because the default gateways reside on different devices because of HSRP.

I hope this has been helpful!

Laz

3 Likes