官方的help文档,针对关于RB2011和3011产品,采用两颗交换芯片在网络规划中,可能会要求将所有以太网接口建立在一个Bridge,并配置VLAN策略(通过/interface ethernet switch下配置),以便实现二层流量的线速转发,但跨两颗交换芯片之间的数据是存在问题的,需要经过CPU转发,不能实现线速转发,特别提示下,RB2011和3011在Brdige下配置VLAN是不支持hardware-offloading的,但在switch下配置是可以实现硬件转发的,只是不叫hardware-offloading,只有在bridge下配置vlan才被官方称为hardware-offloading。

提示:RB4011和RB1100AHx4,以及最新出的CCR2004-16G-2S+都是两颗交换芯片,在v7.1rc1版本后,支持hardware-offloading(switch vlan目录被删除),并明确答复在跨交换芯片的以太网接口,需要经过CPU中转。在bridge vlan配置目录下,必须将跨交换芯片的vlan id,tagged给CPU(bridge)。

下面看看两个交换芯片产品的设计框架图

RB2011两个交换芯片,一个是atheros8327,另外一个是AR9344 CPU集成的:

RB3011使用了两个QCA8337交换芯片:

 

我们通过一个例子来说明,假如是RB3011,需要将ether1-ether10创建一个Bridge,有一个端口作为trunk端口,其他端口都是access端口,例如ether10作为trunk端口,ether1-ether9是access端口。

配置

创建bridge

/interface bridge
add name=bridge1

将ether1-ether10加入bridge1

/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
add bridge=bridge1 interface=ether7
add bridge=bridge1 interface=ether8
add bridge=bridge1 interface=ether9
add bridge=bridge1 interface=ether10

创建三层VLAN接口,vlan10

/interface vlan
add interface=bridge1 name=VLAN10 vlan-id=10

在switch port菜单下,配置端口参数

/interface ethernet switch port
set ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9 default-vlan-id=10 vlan-header=always-strip vlan-mode=secure
set ether10 vlan-header=add-if-missing vlan-mode=secure
set switch1-cpu,switch2-cpu vlan-mode=secure

在switch vlan下配置VLAN

/interface ethernet switch vlan
add ports=ether1,ether2,ether3,ether4,ether5,switch1-cpu switch=switch1 vlan-id=10
add ports=ether6,ether7,ether8,ether9,ether10,switch2-cpu switch=switch2 vlan-id=10

问题

在测试之后,会注意到ether6-ether10的二层数据按预期转发,但来ether1-ether5的数据总是不正确转发(特别是通过trunk端口)。最明显的问题是,数据包从ether1-ether5 到ether10转发是在下降,这是因为这些端口属于不同的交换芯片,两个交换芯片有自己独立的vlan表,不同交换机芯片上的端口之间转发,需要由CPU处理,这意味着将无法实现二层线速转发。

解决方案

最简单的方案是重新规划网络拓扑,分别创建两个bridge和vlan策略,对应两个交换芯片,这样避免了数据包在两个交换芯片穿透,而导致发送到CPU处理降低性能问题。

不过官方给出了一种方法,可以使所有端口都在一组bridge交换下,并且能够在硬件级别上使用VLAN策略,这种解决方案需在两个交换芯片上各牺牲一个以太网端口,它将作为trunk端口在交换芯片之间转发数据,这需在两个交换芯片之间接上网线来实现,就好像飞线一样,例如,RB3011在ether5和ether6之间插入一根网线,然后重新配置两个端口为trunk:

配置如下:

创建bridge1后,将ether1-ether10加入bridge port

/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge2 interface=ether6
add bridge=bridge2 interface=ether7
add bridge=bridge2 interface=ether8
add bridge=bridge2 interface=ether9
add bridge=bridge2 interface=ether10

除了ether5,ether6和ether10外配置vlan10的access模式

/interface ethernet switch port
set ether1,ether2,ether3,ether4,ether7,ether8,ether9 default-vlan-id=10 vlan-header=always-strip vlan-mode=secure

设置ether5,ether6和ether10为trunk模式

/interface ethernet switch port
set ether5,ether6,ether10 vlan-header=add-if-missing vlan-mode=secure default-vlan-id=auto
set switch1-cpu,switch2-cpu vlan-mode=secure

创建vlan10所属端口

/interface ethernet switch vlan
add ports=ether1,ether2,ether3,ether4,ether5,switch1-cpu switch=switch1 vlan-id=10
add ports=ether6,ether7,ether8,ether9,ether10,switch2-cpu switch=switch2 vlan-id=10

注意:如果是100Mbps 交换芯片的RB设备,使用default-vlan-id=0 代替default-vlan-id=auto

这种操作其实就是为两个交换芯片建立一条互联的总线,见过主板飞线,现在见识了交换机飞线,需注意这个飞线带宽是1Gbps:

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

文章很值,打赏犒劳作者一下