当前位置:网站首页>QinQ VLAN, the Mapping principle and configuration of collection "advice"

QinQ VLAN, the Mapping principle and configuration of collection "advice"

2022-09-23 08:37:52Full stack programmer webmaster

大家好,又见面了,我是你们的朋友全栈君.

我唯一知道的就是我一无所知. —苏格拉底

文章目录

一、QinQ 基本原理

QinQ是指在802.1Q VLAN的基础上增加一层802.1Q VLAN标签,从而拓展VLAN的使用空间.在公网的传输过程中,设备只根据外层VLAN Tag转发报文,并根据报文的外层VLAN Tag进行MAC地址学习,而用户的私网VLAN Tag将被当作报文的数据部分进行传输.

1、QinQ 报文封装格式

QinQMessages have a fixed format,就是在802.1QMake another layer on top of the label802.1Q标签,QinQ报文比802.1Q报文多四个字节.

2、QinQ配置

(1)QinQThe function can already existVLANThe data of the tag is encapsulated and specified againVLAN,Make the data carry the second layerVLAN标签. (2)只有Hybrid及TrunkThe type of interface supports this feature. (3)For outer labels,需要在QinQConfigure the interface configurationuntagger,Remove the outer label,用户vlanThere is no need to release or peel off the label.

二、VLAN Mapping 基本原理

1、After the switch receives the data packet,Depending on whether or not it hasTagDo the following two treatments:

(1)data packetTag,根据配置的VLAN Mapping方式,Decided to replace the single layer、A double layer or the outer layer in a double layerTag;然后进入MAC地址学习阶段,根据源MAC地址+映射后的VLAN ID刷新MAC地址表项;根据目的MAC+映射后VLAN ID查找MAC地址表项,如果没有找到,则在VLAN ID对应的VLAN内广播,否则从表项对应的接口转发.

(2)Data packets are not includedTag,根据配置的VLANThe division method determines whether to add or notVLAN Tag,For cannot joinVLANdata packets are sentCPU或丢弃,否则添加Tag;然后进入MAC地址学习阶段,Forwarding is performed according to the Layer 2 forwarding process.

2、映射方式

设备支持基于VLAN、802.1p优先级和MQC方式实现VLAN Mapping,其中基于VLAN的VLAN MappingIncludes the following mappings:

(1)1 to 1的映射方式

当部署VLAN MappingInterfaces on functional devices receive a single layerVLAN Tag的报文时,The single layer that will be carried in the packetVLAN TagMapped to the public networkVLAN Tag.包括1:1和N:1两种方式,其中1:1The way is to specify a user sideVLAN TagLabels are mapped to a network sideVLAN Tag标签,N:1The way is to specify a range of multiple users sideVLAN TagLabels are mapped to a network sideVLAN Tag标签.

(2)2 to 1的映射方式

当部署VLAN MappingThe interface on the functional device receives a double layerVLAN Tag的报文时,The outer layer that will be carried in the packetTagMapped to the public networkTag,内层Tagas data transparent transmission.

(3)2 to 2的映射方式

当部署VLAN MappingThe interface on the functional device receives a double layerVLAN Tag的报文时,The double layer that will be carried in the messageVLAN TagMapped to the double layer of the public networkVLAN Tag.基于MQC实现VLAN Mapping指的是通过MQCIt can be implemented for the classified packetsVLANMapping.Users can classify packets according to various matching rules,Then classify the flow with VLANMappingassociated with the action,Remarks the packets matching the rulesVLAN ID值.基于MQC的VLAN Mapping能够针对业务类型提供差别服务.

3、Vlan-Mapping配置

(1)Vlan-MappingA function can replace an existing oneVLAN标签的数据,And when the data is returned with the mapped data, the label before the mapping of the data is automatically restored. (2)只有Hybrid及TrunkThe type of interface supports this feature. (3)对于Vlan-Mappinginterface onlytagger The mapped label,无需配置untagger,用户vlanThere is no need to release or peel off the label.

三、拓扑

四、配置与分析

1、ISP向A公司和BThe company provides Layer 2 accessVLAN为VLAN 100.

[SW-1]vlan 100

2、A公司的同VLANIt needs to be implemented in the Layer 2 network of cross-domain operatorsVLAN成员互通. (使用QinQ实现这一需求)

LSW3

[SW-3]vlan batch 10
[SW-3]int g0/0/1
[SW-3-GigabitEthernet0/0/1]port link-type trunk
[SW-3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW-3]int e0/0/1
[SW-3-Ethernet0/0/1]port link-type access
[SW-3-Ethernet0/0/1]port default vlan 10

LSW1

[SW-1]v 100
[SW-1]int g0/0/1
[SW-1-GigabitEthernet0/0/1]port hybrid untagged vlan 100
//Configure this interface to pass and remove withvlan 100标签的数据(If there are multiple layers of labels,Only remove the outer label)
[SW-1-GigabitEthernet0/0/1]qinq vlan-translation enable  //开启此接口的qinq多vlan标签处理功能
[SW-1-GigabitEthernet0/0/1]port vlan-stacking vlan 10 stack-vlan 100
//配置This interface receives with vlan 10标签的数据后再次封装外层标签为vlan 100
[SW-1-GigabitEthernet0/0/1]int g0/0/24
[SW-1-GigabitEthernet0/0/24]port link-type trunk
[SW-1-GigabitEthernet0/0/24]port trunk allow-pass vlan all

[SW-1]dis vlan 100 verbose

LSW2、LSW5配置类似

PC1 ping 192.168.1.103(PC3)

3、B公司的不同VLAN成员跨域运营商二层网络后实现互通. (是用Vlan-Mapping实现这一需求)

LSW4

[SW-4]vlan 24
[SW-4-vlan24]quit
[SW-4]int e0/0/2
[SW-4-Ethernet0/0/2]p l a
[SW-4-Ethernet0/0/2]p d v 24
[SW-4-Ethernet0/0/2]int g0/0/2
[SW-4-GigabitEthernet0/0/2]p l t 
[SW-4-GigabitEthernet0/0/2]p t a v 

LSW1

[SW-1]int g0/0/2
[SW-1-GigabitEthernet0/0/2]port hybrid tagged vlan 100	 //此接口放行The mapped label 
[SW-1-GigabitEthernet0/0/2]qinq vlan-translation enable  //开启此接口的qinq多vlan标签处理功能 
[SW-1-GigabitEthernet0/0/2]port vlan-mapping vlan 24 map-vlan 100
//This interface receives with vlan 24The label's data replaces the label withvlan 100转发,在SWInternal received withvlan 100The data auto-restore label is vlan 24
[SW-1-GigabitEthernet0/0/2]quit

LSW2、LSW6配置类似

抓包 SW-1接口下g0/0/24

PC2 ping 192.168.1.104(PC4)

五、总结

Summary of the experiment

① Unlabeled data is received,封装PVID所在的标签 ② data with the specified label,收到vlan 10再封装一层vlan 100 ③ Data other than the specified label,丢弃

(1)QinQ,When carrying the label into the dispatch,Check out the outer label (2)QinQ,When leaving to remove the label,Only remove the outer label

1、QinQ的部署

(1)基本QinQ,Any data received under the interface will be encapsulated with the specified label (2)灵活QinQ,Different outer labels can be added to the received data according to different characteristics

2、特征:

(1)The source and purpose of the data—-IP/MAC (2)VLAN标签 (3)传输层协议+端口 (4)优先级-801.1p—-dot1q—-DSCP

3、Hybrid QINQ

(1)配untagger—Labels added by business (2)and enable the interfaceQino传输功能

VLAN–高级特性–打破常规

多对一的映射–Block-shot devices record pre-mapping dataMAC与VLAN的关系,Follow this entry when restoring.

QinQ核心作用: A new tag is encapsulated again for the data carrying the tag,As for the forwarding and removal of multi-layer tablesqinq配置无关.

vlan映射和qinqThe difference is a pairvlan进行替换,One is to repackage new labels,正因为如此,针对vlanTry the configuration of the mapped interfacetaggerRelease the replaced label.对于qinq是 untaggerAn extra layer of labels added; 另外在vlanMap this place,when the data is returned,User tags are restored based on logging this data source when user data came inmacaddress and the user's ownvlan标签,When the backhaul user data is received, the data is sent from the firstSWInternal guide to proceedvlan映射的接口,Based on this beforemacThe data corresponding to the addressvlan 进行还原.

我是艺博东,The more one knows,The more you understand your ignorance.也欢迎你和我一起讨论,我们下期见.

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/169378.html原文链接:https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://chowdera.com/2022/266/202209230827040176.html

随机推荐