IEEE 802.3 SNAP以太帧格式
IEEE 802.3 SNAP以太帧,是IEEE为保证在802.3 LLC上支持更多的上层协议同时更好的支持IP协议而发布的标准。
一、 IEEE 802.3 SNAP帧格式
+-----------+-----------+-----------+----------+----------+----------+---------+---------+------------------+----------+ | DMAC | SMAC | Length | DSAP | SSAP | Ctrl | OUI | Type | Data | FCS | | 6 Bytes | 6 Bytes | 2 Bytes | 1 Bytes | 1 Bytes | 1 Bytes | 3 Bytes | 2 Bytes | Variable length | 4 Bytes | +-----------+-----------+-----------+----------+----------+----------+---------+---------+------------------+----------+ | | | | | | | | | | +--------------------+-----------------+-------------+---------------------+ | 帧间隙 | 前同步码 | 帧开始定界符| Ethernet Frame | | 至少12Bytes | 7 Bytes | 1 Byte | Variable length | +--------------------+-----------------+-------------+---------------------+
字段 | 长度 | 含义 |
---|---|---|
DMAC | 6字节 | 目的MAC地址,该字段标识帧的接收者。 |
SMAC | 6字节 | 源MAC地址,该字段标识帧的发送者。 |
Length | 2字节 | 指后续数据的字节长度,但不包括FCS字段。 |
DSAP | 1字节 | 目的服务访问点,若后面类型为IP帧值设为0x06。服务访问点的功能类似于Ethernet II帧中的Type字段或TCP/UDP传输协议中的端口号。 |
SSAP | 1字节 | 源服务访问点,若后面类型为IP帧值设为0x06。 |
Ctrl | 1字节 | 该字段值通常设为0x03,表示无连接服务的IEEE 802.2无编号数据格式。 |
SNAP-ID | 5字节 | 由OUI和Type两部分组成。 |
OUI | 3字节 | 3字节的组织唯一标识符(Organizationally Unique Identifier),其值通常等于MAC地址的前3字节,即网络适配器厂商代码。 |
Type | 2字节 | 标识以太网帧所携带的上层数据类型。
根据RFC1042标准,OUI使用一个特殊的数值0x00-00-00,当这个字段为0x00-00-00时,Type字段与Ethernet II封装中的Type具有相同的含义。 |
Data | 38~1492字节 |
数据字段,标识帧的负载(可能包含填充位)。 数据字段的最小长度必须为38字节以保证帧长至少为64字节,这意味着传输1字节信息也必须使用38字节的数据字段。 如果填入该字段的信息少于38字节,该字段的其余部分也必须进行填充。数据字段的最大长度为1492字节。 以太帧的长度必须为整数字节,因此帧的负载长度不足整数字节,需插入填充字段以保证数据帧的长度为整数字节。 |
FCS | 4字节 |
帧校验序列FCS(Frame Check Sequence)是为接收网卡提供判断是否传输错误的一种方法,如果发现错误,丢弃此帧。 FCS只是通用叫法,具体的FCS还可以细分多种校验方法。在以太帧中,FCS通常采用循环冗余码校验CRC(Cyclical Redundancy Check)。 |
字段 | 长度 | 含义 |
---|---|---|
帧间隙 | 至少12字节 | 每个以太帧之间都要有帧间隙(Inter Frame Gap),即每发完一个帧后要等待一段时间才能再发另外一个帧,以便让帧接收者对接收的帧作必要的处理(如调整缓存的指针、更新计数、通知对报文进行处理等等)。在以太网标准中规定最小帧间隙是12个字节,其数据为全1。对于个别的接口,可减少到64(GE)或40比特(10GE),其他的接口都不应该小于12字节。 |
前同步码 | 7字节 | 以太网标准中规定前导码为10101010 10101010 10101010 10101010 10101010 10101010 10101010(二进制),共7字节。 |
帧开始定界符 | 1字节 | 以太网标准中规定帧开始定界符为10101011(二进制),共1字节。 |
二、IEEE 802.3 SNAP以太帧帧示例
Frame 1: 300 bytes on wire (2400 bits), 300 bytes captured (2400 bits) Arrival Time: Nov 20, 2006 22:49:06.739806000 Epoch Time: 1164034146.739806000 seconds [Time delta from previous captured frame: 0.000000000 seconds] [Time delta from previous displayed frame: 0.000000000 seconds] [Time since reference or first frame: 0.000000000 seconds] Frame Number: 1 Frame Length: 300 bytes (2400 bits) Capture Length: 300 bytes (2400 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:llc:cdp:data] [Coloring Rule Name: Routing] [Coloring Rule String: hsrp || eigrp || ospf || bgp || cdp || vrrp || gvrp || igmp || ismp] IEEE 802.3 Ethernet Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Address: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) Source: d5:d5:15 (00:e0:1e:d5:d5:15) Address: d5:d5:15 (00:e0:1e:d5:d5:15) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) Length: 286 Logical-Link Control DSAP: SNAP (0xaa) IG Bit: Individual SSAP: SNAP (0xaa) CR Bit: Command Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x03) Organization Code: (0x00000c) PID: CDP (0x2000) Discovery Protocol Version: 1 TTL: 180 seconds Checksum: 0xdff0 [correct] [Good: True] [Bad: False] Device ID: R1 Type: Device ID (0x0001) Length: 6 Device ID: R1 Addresses Type: Addresses (0x0002) Length: 17 Number of addresses: 1 IP address: 192.168.10.1 Protocol type: NLPID Protocol length: 1 Protocol: IP Address length: 4 IP address: 192.168.10.1 Port ID: Ethernet0 Type: Port ID (0x0003) Length: 13 Sent through Interface: Ethernet0 Capabilities Type: Capabilities (0x0004) Length: 8 Capabilities: 0x00000001 .... .... .... .... .... .... .... ...1 = Is a Router .... .... .... .... .... .... .... ..0. = Not a Transparent Bridge .... .... .... .... .... .... .... .0.. = Not a Source Route Bridge .... .... .... .... .... .... .... 0... = Not a Switch .... .... .... .... .... .... ...0 .... = Not a Host .... .... .... .... .... .... ..0. .... = Not IGMP capable .... .... .... .... .... .... .0.. .... = Not a Repeater Software Version Type: Software version (0x0005) Length: 216 Software Version: Internetwork Operating System Software IOS (tm) 1600 Software (C1600-NY-L), Version 11.2(12)P, RELEASE SOFTWARE (fc1) Copyright (c) 1986-1998 by Systems, Inc. Compiled Tue 03-Mar-98 06:33 by dschwart Platform: 1601 Type: Platform (0x0006) Length: 14 Platform: 1601
三、IEEE 802.3 SNAP以太帧参考标准
标准 | 描述 |
---|---|
IEEE 802.3 | Carrier sense multiple access with collision detection (CSMA/CD) access method and physical layer specifications |
IEEE 802.3ae | Media Access Control (MAC) Parameters, Physical Layers, and Management parameters for 10Gb/s Operation |
RFC 894 | A Standard for the Transmission of IP Datagrams over Ethernet Networks |
RFC 1042 | A Standard for the Transmission of IP Datagrams over IEEE 802 Networks |
发表评论