Understanding VLAN Mapping
Basic Principles
After receiving a single tagged packet, the switch determines to replace a single tag based on the VLAN mapping mode. Then the switch learns the MAC addresses contained in the packet. Based on the source MAC address and mapped VLAN ID, the switch updates the MAC address entries in the VLAN mapping table. Based on the destination MAC address and the mapped VLAN ID, the switch searches for the MAC address entries. If the destination MAC address matches no entry, the switch broadcasts the packet in the specified VLAN; if the destination MAC address matches an entry, the switch forwards the packet through the corresponding outbound interface.
As shown in Figure 7-1, VLAN mapping between VLAN 2 and VLAN 3 is configured on Interface1. Before sending packets from VLAN 2 to VLAN 3, Interface1 replaces the VLAN tags with VLAN 3 tags. When receiving packets from VLAN 3, Interface1 replaces the VLAN tags with VLAN 2 tags. Then packets are forwarded according to the Layer 2 forwarding process. This implements communication between devices in VLAN 2 and VLAN 3.
If devices in two VLANs need to communicate through VLAN mapping, the IP addresses of these devices must be on the same network segment. If IP addresses of these devices are on different network segments, communication between devices is implemented through Layer 3 routes. In this case, VLAN mapping is invalid.
Implementation Modes
1 to 1 VLAN mapping
When an interface configured with VLAN mapping receives a single-tagged packet, the interface maps the VLAN tag in the packet to a new VLAN tag.
2 to 1 VLAN mapping
When an interface configured with VLAN mapping receives a double-tagged packet, the interface maps the double VLAN tags in the packet to a new VLAN tag.
MQC-based VLAN mapping uses a traffic classifier to classify packets based on VLAN IDs, associates the traffic classifier with a traffic behavior defining VLAN mapping so that the device can re-mark the VLAN ID in packets matching the traffic classifier. MQC-based VLAN mapping implements differentiated services.