7. 互连问题
在帧中继网络中传输的数据分组有两种基本类型: 路由分组和桥接分组. 这些分组具有不同的格式, 因此必须包含目标方可用于正确解释帧内容的指示. 该指示嵌入在 NLPID 和 SNAP 头信息中.
对于尚未分配 NLPID 的协议, 需要提供一种便于识别协议的机制. 定义了一个 NLPID 值来指示存在 SNAP 头.
SNAP 头的形式为
+-------------------------------+
| Organizationally Unique |
+-- +---------------+
| Identifier | Protocol |
+---------------+---------------+
| Identifier |
+---------------+
所有站点都必须能够接受并正确解释路由分组中的 NLPID 封装和 SNAP 头封装.
三字节的组织唯一标识符 (OUI) 标识一个组织, 该组织管理其后协议标识符 (PID) 的含义. 二者共同标识一个不同的协议. 请注意, OUI 0x00-00-00 表示其后的 PID 是一个 EtherType.
7.1. 路由帧
某些协议会有已分配的 NLPID, 但由于 NLPID 编号空间非常有限, 许多协议并没有分配给它们特定的 NLPID. 当这类协议的分组通过帧中继网络路由时, 使用 NLPID 0x80 (表示随后是 SNAP), OUI 0x00-00-00 (表示随后是 EtherType) 以及所用协议的 EtherType 来发送.
Format of Routed Frames
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x00-00 |
+-------------------------------+
| EtherType |
+-------------------------------+
| Protocol Data |
+-------------------------------+
| FCS |
+-------------------------------+
在少数情况下, 当协议具有已分配的 NLPID 时 (见附录), 使用下面的格式可以节省 48 位:
Format of Routed NLPID Protocol
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | NLPID |
+-------------------------------+
| Protocol Data |
+-------------------------------+
| FCS |
+-------------------------------+
在 Internet IP 数据报这一特定情况下, NLPID 为 0xCC.
Format of Routed IP Datagram
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | NLPID 0xCC |
+-------------------------------+
| IP Datagram |
+-------------------------------+
| FCS |
+-------------------------------+
7.2. 桥接帧
第二种帧中继流量是桥接分组. 这些分组使用指示 SNAP 的 NLPID 值 0x80 进行封装, 其后的 SNAP 头标识桥接分组的格式. 用于此封装的 OUI 值是 802.1 组织代码 0x00-80-C2. 接下来的两个八位组 (PID) 指定紧随 SNAP 头之后的 MAC 头的形式. 此外, PID 还指示桥接帧中是否保留了原始 FCS.
802.1 组织保留了以下值供帧中继使用:
OUI 0x00-80-C2 的 PID 值
| 保留 FCS | 不保留 FCS | 介质 |
|---|---|---|
| 0x00-01 | 0x00-07 | 802.3/Ethernet |
| 0x00-02 | 0x00-08 | 802.4 |
| 0x00-03 | 0x00-09 | 802.5 |
| 0x00-04 | 0x00-0A | FDDI |
| 0x00-05 | 0x00-0B | 802.6 |
此外, PID 值 0x00-0E 与 OUI 0x00-80-C2 一起使用时, 标识桥接协议数据单元 (BPDU).
因此, 通过帧中继桥接的分组将具有以下格式之一:
Format of Bridged Ethernet/802.3 Frame
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-01 or 0x00-07 |
+-------------------------------+
| MAC destination address |
+-------------------------------+
| (remainder of MAC frame) |
+-------------------------------+
| LAN FCS (if PID is 0x00-01) |
+-------------------------------+
| FCS |
+-------------------------------+
Format of Bridged 802.4 Frame
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-02 or 0x00-08 |
+-------------------------------+
| pad 0x00 | Frame Control |
+-------------------------------+
| MAC destination address |
+-------------------------------+
| (remainder of MAC frame) |
+-------------------------------+
| LAN FCS (if PID is 0x00-02) |
+-------------------------------+
| FCS |
+-------------------------------+
Format of Bridged 802.5 Frame
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-03 or 0x00-09 |
+-------------------------------+
| Access Control| Frame Control |
+-------------------------------+
| MAC destination address |
| . |
| . |
+-------------------------------+
| (remainder of MAC frame) |
+-------------------------------+
| LAN FCS (if PID is 0x00-03) |
| |
+-------------------------------+
| FCS |
+-------------------------------+
Format of Bridged FDDI Frame
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-04 or 0x00-0A |
+-------------------------------+
| Access Control| Frame Control |
+-------------------------------+
| MAC destination address |
| . |
| . |
+-------------------------------+
| (remainder of MAC frame) |
+-------------------------------+
| LAN FCS (if PID is 0x00-04) |
| |
+-------------------------------+
| FCS |
+-------------------------------+
Format of Bridged 802.6 Frame
+-------------------------------+
| Q.922 Address |
| Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-05 or 0x00-0B |
+-------------------------------+
| Reserved | BEtag | Common
+---------------+---------------+ PDU
| BAsize | Header
+-------------------------------+
| MAC destination address |
+-------------------------------+
| (remainder of MAC frame) |
+-------------------------------+
| |
+- Common PDU Trailer -+
| |
+-------------------------------+
| FCS |
+-------------------------------+
通用协议数据单元 (PDU) 头和尾被传送, 以允许在通往 802.6 子网的出口桥处进行流水线处理. 具体而言, 通用 PDU 头包含 BAsize 字段, 该字段包含 PDU 的长度. 如果出口 802.6 桥无法获得该字段, 那么该桥在收到整个 PDU, 计算出长度并将长度插入 BAsize 字段之前, 无法开始发送分段 PDU. 如果可以获得该字段, 出口 802.6 桥可以从通用 PDU 头的 BAsize 字段中提取长度, 将其插入第一个分段的相应字段, 并立即将该分段发送到 802.6 子网上. 因此, 桥可以在收到完整 PDU 之前就开始发送 802.6 PDU.
应当注意, 封装帧的通用 PDU 头和尾不应简单地复制到外发的 802.6 子网, 因为封装的 BEtag 值可能与该桥先前发送的 BEtag 值冲突.
Format of BPDU Frame
+-------------------------------+
| Q.922 Address |
+-------------------------------+
|Control 0x03 | pad(s) 0x00 |
+-------------------------------+
| NLPID 0x80 | OUI 0x00 |
+---------------+ --+
| OUI 0x80-C2 |
+-------------------------------+
| PID 0x00-0E |
+-------------------------------+ ----
| 802.1(d) Protocol Identifier | BPDU, as defined
+-------------------------------+ by 802.1(d),
| Version = 00 | BPDU Type | section 5.3
+-------------------------------+
| (remainder of BPDU) |
+-------------------------------+ ----
| FCS |
+-------------------------------+