What Is VLAN Mapping?
VLAN mapping technology changes VLAN tags in packets to map different VLANs.
Why Do We Need VLAN Mapping?
Two Layer 2 user networks in the same VLAN can be connected through a backbone network. To ensure Layer 2 connectivity between users, and to uniformly deploy Layer 2 protocols, the two user networks need to interwork seamlessly. However, the backbone network cannot directly transmit VLAN packets from the user networks, because the VLAN plans on the backbone and user networks are different.
To solve this problem, configure VLAN mapping. When VLAN packets from a user network enter the backbone network, an edge device on the backbone network changes the customer VLAN (C-VLAN) ID to the service VLAN (S-VLAN ID). After the packets are transmitted, the edge device reverts the VLAN ID change. This ensures seamless interworking between the two user networks. The other method is to configure a Layer 2 tunneling technology such as QinQ or VPLS to encapsulate VLAN packets into packets on the backbone network so that VLAN packets are transparently transmitted. However, this method increases extra cost because packets are encapsulated. In addition, Layer 2 tunneling technology may not support transparent transmission of packets of some protocol packets. The other method is to configure VLAN mapping. When VLAN packets from a user network enter the backbone network, an edge device on the backbone network changes the C-VLAN ID to the S-VLAN ID. After the packets are transmitted to the other side, the edge device changes the S-VLAN ID to the C-VLAN ID. This method implements seamless interworking between two user networks.
Configuring VLAN mapping on the switch connecting the two user networks allows a user to manage the two networks as a single Layer 2 network, despite the differing VLAN plans of the user networks.
What Are Application Scenarios of VLAN Mapping?
1:1 VLAN mapping
When receiving a single-tagged packet, the interface maps the VLAN tag to a specified single VLAN tag.
1:1 VLAN mapping applies to the network shown in the following figure. Services (HSI, IPTV, and VoIP) of each user are transmitted on different VLANs. Same services are transmitted on the same C-VLAN. To differentiate users, deploy Corridor Switch to allow the same services used by different users to be transmitted on different VLANs, which implements 1:1 VLAN mapping. 1:1 VLAN mapping requires a large number of VLANs to isolate services of different users; however, the VLAN quantity provided by the network access device at the aggregation layer is limited. To resolve this problem, configure the VLAN aggregation function to allow the same services to be transmitted on the same VLAN (N:1 VLAN mapping).
1:1 VLAN mapping
2:1 VLAN mapping
When the interface receives a double-tagged packet, the interface maps the outer VLAN tag in the packet to an S-VLAN tag and transparently transmits the inner VLAN tag.
2:1 VLAN mapping applies to the network shown in the following figure. Residential Gateway, Corridor Switch, and Community Switch are connected to the aggregation layer on the network. To differentiate users and services to facilitate network management and charging, configure the QinQ function for Corridor Switch. To save VLAN resources, configure VLAN mapping on Community Switch to transmit the same services on the same VLAN.
2:1 VLAN mapping
2:2 VLAN mapping
2:2 VLAN mapping applies to the network shown in the following figure. QinQ is used to send double-tagged packets, which prevents the conflict between C-VLAN IDs and S-VLAN IDs and differentiates services and users. However, the interface will discard the packets because C-VLAN IDs are different from S-VLAN IDs. To ensure communication continuity, configure 2:2 VLAN mapping on the PE and replace double C-VLAN tags with double S-VLAN tags.
2:2 VLAN mapping
How Does VLAN Mapping Work?
- Tagged packed: Based on the VLAN mapping mode, the switch determines whether a single tag, double tags, or the outer tag is to be replaced. The switch then learns the MAC addresses in the packet. The switch updates the MAC address entries in the VLAN mapping table based on the source MAC address and mapped VLAN ID. It then searches for the MAC address entries based on the destination MAC address and the mapped VLAN ID. If the destination MAC address matches an entry, the switch forwards the packet through the corresponding outbound interface. If not, the switch broadcasts the packet in the specified VLAN.
- Untagged packet: Based on the VLAN creation mode, the switch determines whether to add a VLAN tag. If the packet can be added to a VLAN, the switch adds a VLAN tag to it and learns the MAC addresses. The switch then performs Layer 2 forwarding based on the destination MAC address. If the packet cannot be added to a VLAN, the switch either delivers the packet to the CPU or discards it.
The following figure shows VLAN mapping between VLAN 2 and VLAN 3 configured on PORT 1. Before sending packets from VLAN 2 to VLAN 3, PORT 1 replaces the VLAN tags with VLAN 3 tags. When receiving packets from VLAN 3 to VLAN 2, PORT 1 replaces the VLAN tags with VLAN 2 tags. This implements communication between devices in VLAN 2 and VLAN 3.
VLAN mapping
If devices in two VLANs need to communicate based on VLAN mapping, the IP addresses of these devices must be on the same network segment. If their IP addresses are on different network segments, communication between these devices must be implemented using Layer 3 routes, which makes VLAN mapping invalid.
VLAN Mapping Mode
1 to 1 VLAN mapping
When the interface on a device configured with VLAN mapping receives a single-tagged packet, the interface maps the VLAN tag in the packet to an S-VLAN tag. 1:1 VLAN mapping maps a C-VLAN tag to an S-VLAN tag, whereas N:1 VLAN mapping maps multiple C-VLAN tags to an S-VLAN tag.
2 to 1 VLAN mapping
When the interface on a device configured with VLAN mapping receives a double-tagged packet, the interface maps the outer VLAN tag to an S-VLAN tag and transparently transmits the inner VLAN tag. The interface configured with 1:1 VLAN mapping maps an outer VLAN tag to an S-VLAN tag and transparently transmits the inner VLAN tag. The interface configured with N:1 VLAN mapping maps different outer VLAN tags of packets to the same S-VLAN tag and transparently transmits the inner VLAN tag. Only one outer VLAN tag can be mapped to an S-VLAN tag at a time; therefore, to achieve N:1 VLAN mapping, perform this configuration for multiple times.
2 to 2 VLAN mapping
When the interface on a device configured with VLAN mapping receives a double-tagged packet, the interface maps the double VLAN tags to the double S-VLAN tags.
MQC-based VLAN mapping uses a traffic classifier to classify packets based on VLAN IDs. It associates the traffic classifier with a traffic behavior defining VLAN mapping so that the switch can re-mark the VLAN ID in packets matching the traffic classifier. MQC-based VLAN mapping implements differentiated services.
- Author: Ge Karirong
- Updated on: 2025-01-21
- Views: 2489
- Average rating:
Export PDF