net: 熟悉传统的交换机芯片

https://www.cnblogs.com/s08243/p/6221472.html

notes

来自中兴

在这里插入图片描述

s1

包由端口进入交换芯片之后,首先进行包头字段匹配,为流分类做准备;然后经过一个安全引擎进行包过滤;符合安全的包进行L2交换或者L3路由,并经过流分类处理器对匹配的包做相关动作(比如丢弃、限速、修改VLAN等);对于可以转发的包根据802.1P或DSCP放到不同队列的buffer中,调度器根据优先级或者WRR等算法进行队列调度,在端口发出该包之前执行流分类修改动作,最终从相应端口发送出去。

什么是IEEE 802.1p

是IEEE 802.1Q(VLAN标签技术)标准的扩展协议,两者共同运作,使第二层网上交换器能够提供流量优先级和动态多播过滤服务。

IEEE 802.1Q标准定义了以太网MAC数据帧添加的标签。VLAN标签有两部分:VLAN ID(12位)和PCP(Priority Code Point)(3比特)。IEEE 802.1Q VLAN标准中没有定义和使用PCP,而802.1P中则定义了PCP。
PCP定义了从0至7的优先值,可以为第二层服务质量(QoS)或服务类(CoS)区分流量。此外,IEEE 802.1p标准也提供了多播流量过滤功能,以确保该流量不超出第二层交换网上范围。 [1]
优先

对于交换芯片来说,L2转发是一个最基本的功能。

L2功能主要包括ingress过滤、MAC学习和老化、根据MAC+VLAN转发、广播与洪泛、生成树控制等基本功能。

在这里插入图片描述

2.2.3 L2 的地址表

56504的L2地址表大小为16K,5630X的L2地址表大小为8K,地址表使用MAC+VID的hash值作为索引查表。实际上56504的L2地址表hash值为4K,每个hash值对应4条地址,这样最多可以保存4条hash冲突的地址。地址表中每个表项都保存了MAC_ADDR和VLAN_ID。MAC学习的时候使用原MAC+VID的hash查表,把表中的MAC+VID与包中的MAC+VID进行比较,如果完全相等,表示找到了。然后看端口(TGID_PORT)是否相等,如果不相等表示地址发生了迁移,对于动态学习的地址需要更新port;如果相等表示命中,更新hit标志。其他几个重要的功能介绍如下:

  1. 设置静态地址:STATIC_BIT=1

  2. 设置L3转发标志:L3=1

  3. 设置本地址的包都转发到CPU去:CPU=1

  4. 设置本地址匹配的包丢弃:SRC_DISCARD=1、DST_DISCARD=1

  5. 设置本地址匹配的包对某些端口阻塞:MAC_BLOCK_INDEX

  6. 设置本地址匹配的包镜像:MIRROR=1

  7. 设置组播索引:L2MC_PTR

  8. 地址有效标志:VALID=1

L3 的转发

L3有关的几个重要的表:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

 RTL8370N-VB: Single-chip 8-port gigabit non-blocking switch architecture  Embedded 8-port 10/100/1000Base-T PHY  Each port supports full duplex 10/100/1000M connectivity (half duplex only supported in 10/100M mode)  Full-duplex and half-duplex operation with IEEE 802.3x flow control and backpressure  Supports 9216-byte jumbo packet length forwarding at wire speed  Supports Realtek Cable Test (RTCT) function  Supports 96-entry ACL Rules  Search keys support physical port, Layer2, Layer3, and Layer4 information  Actions support mirror, redirect, dropping, priority adjustment, traffic policing, CVLAN decision, and SVLAN assignment  Supports 5 types of user defined ACL rule format for 64 ACL rules  Optional per-port enable/disable of ACL function  Optional setting of per-port action to take when ACL mismatch  Supports IEEE 802.1Q VLAN  Supports 4K VLANs and 32 Extra Enhanced VLANs  Supports Un-tag definition in each VLAN  Supports VLAN policing and VLAN forwarding decision  Supports Port-based, Tag-based, and Protocol-based VLAN  Up to 4 Protocol-based VLAN entries  Supports per-port and per-VLAN egress VLAN tagging and un-tagging  Supports IVL, SVL, and IVL/SVL  Supports 4096-entry MAC address table with 4-way hash algorithm  Up to 4096 L2/L3 Filtering Database  Supports Spanning Tree port behavior configuration  IEEE 802.1w Rapid Spanning Tree  IEEE 802.1s Multiple Spanning Tree with up to 16 Spanning Tree instances  Supports IEEE 802.1x Access Control Protocol  Port-Based Access Control  MAC-Based Access Control  Guest VLAN  Supports Quality of Service (QoS)  Supports per port Input Bandwidth Control  Traffic classification based on IEEE 802.1p/Q priority definition, physical Port, IP DSCP field, ACL definition, VLAN based priority, MAC based priority, and SVLAN based priority  Eight Priority Queues per port  Per queue flow control  Min-Max Scheduling  Strict Priority and Weighted Fair Queue (WFQ) to provide minimum bandwidth  One leaky bucket to constrain the average packet rate of each queue  Supports rate limiting (64 shared meters, with 8kpbs granulation)  Supports RFC MIB Counter  MIB-II (RFC 1213)  Ethernet-Like MIB (RFC 3635)  Interface Group MIB (RFC 2863)  RMON (RFC 2819)  Bridge MIB (RFC 1493)  Bridge MIB Extension (RFC 2674)  Supports Stacking VLAN and Port Isolation with 8 Enhanced Filtering Databases  Supports IEEE 802.1ad Stacking VLAN  Supports 64 SVLANs  Supports 32 L2/IPv4 Multicast mappings to SVLAN  Supports 4 IEEE 802.3ad Link aggregation port groups  Supports OAM and EEE LLDP (Energy Efficient Ethernet Link Layer Discovery Protocol  Supports Loop Detection  Security Filtering  Disable learning for each port  Disable learning-table aging for each port  Drop unknown DA for each port  Broadcast/Multicast/Unknown DA storm control protects system from attack by hackers  Supports Realtek Green Ethernet features  Link-On Cable Length Power Saving  Link-Down Power Saving  Each port supports 3 parallel LED or scan LED or serial shift LED outputs  Supports I 2 C-like Slave interface or Slave MII Management interface to access configuration register  Supports 16K-byte EEPROM space for configuration  Integrated 8051 microprocessor  Supports SPI Flash Interface  25MHz crystal input  RTL8370N-VB: LQFP 128-pin E-PAD package
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值