Common link layer packet format and length

Common link layer packet format and length

 

classification:

2011-09-20 13:13:24

 

1. Ethernet frame (after removal of the upper load length of 18 bytes)

Ethernet frame has a good variety, we are the most commonly used Ethernet II

Namely Ethernet II DIX 2.0: Xerox Ethernet standard frame format DEC, Intel developed in 1982. Cisco name: ARPA

 

 

The minimum length of the Ethernet II Ethernet frame type is 64 bytes (6 + 6 + 2 + 4 + 46), a maximum length of 1518 bytes (6 + 6 + 2 + 4 + 1500). Wherein the first 12 bytes of each destination node identifies the data frame transmission source MAC address of the received data frame and the MAC address. (Note: ISL up to 1548 bytes after packaging, 802.1Q up to 1522 bytes after packaging)

 

The next two bytes identify the type of data carried by an upper layer of the Ethernet frame, as follows:

IPv4: 0x0800

ARP:0x0806

PPPoE:0x8864

802.1Q tag: 0x8100

IPV6: 0x86DD

MPLS Label:0x8847

 

After the variable length data field is a 4-byte frame check sequence (Frame. Check Sequence, FCS)

 

2. ARP (ARP Header length: 8 bytes)

Hardware Type: 1 for Ethernet

Protocol Type: Ethernet data frames and fields of the same type

Operation field OP: 1 indicates an ARP request

2 represents an ARP reply

3 represents a RARP request

4 shows the RARP response

 

 

3. 802.1q VLAN frame data (4 bytes)

 

802.1Q-based VLAN frame format

  • Type: length of 2 bytes, a value of 0x8100, indicating the type of the frame is a frame 802.1Q Tag.
  • PRI: It is a 3-bit, assume values ​​between 0 to 7, indicating the priority of the frame, the greater the value the higher the priority. The main priority to provide reference (COS) for the QoS differentiated services.
  • VLAN Identifier (VID): length 12bits, VLAN ID may be configured in the range of 1 to 4094. Vlan 0 and is generally reserved vlan 4095, vlan1 default vlan, generally used for network management.

     

    QinQ frame format

     

     

    4. PPP frames (the length of the information field is removed: 8 bytes)

     

    PPP Packet Format

     

    PPP报文的内容是指Address、Control、Protocol和Information四个域的内容。各字段的含义如下。

  • Flag域Flag域标识了一个物理帧的起始和结束,该字节为0x7E。
  • Address域PPP协议是被运用在点对点的链路上,它可以唯一标识对方。因此使用PPP协议互连的两个通信设备无须知道对方的数据链路层地址。所以该字节已无任何意义,按照协议的规定将该字节填充为全1的广播地址。
  • Control域同Address域一样,PPP数据帧的Control域也没有实际意义,按照协议的规定通信双方将该字节的内容填充为0x03。Address和Control域一起表示了此报文为PPP报文,即PPP报文头为FF03。
  • Protocol域协议域可用来区分PPP数据帧中信息域所承载的数据报文的内容。

协议代码

协议类型

0021

Internet Protocol

8021

Internet Protocol Control Protocol

C021

Link Control Protocol

C023

Password Authentication Protocol

C223

Challenge Handshake Authentication Protocol

  • Information域信息域最大长度是1500字节,其中包括填充域的内容。信息域的最大长度等于PPP协议中MRU(Maximum Receive Unit)的缺省值。

     

    5. HDLC帧(除去信息字段后长度为:8字节)

     

    HDLC帧格式

     

    各字段的含义解释:

字段

长度(字节)

含义

Protocol

2

协议字段。表示Information域中的数据封装的协议类型。

Information

N

信息字段。可以是任意的二进制比特串,长度未作限定。其上限由FCS字段或通信节点的缓冲容量来决定,目前国际上用得较多的是1000~2000比特,而下限可以是0,即无信息字段。但是监控帧中不可有信息字段。

 

 

6. PPPoE报文(报文头长度为6字节)

windows系统pppoe MTU大小

默认和最大 PPPoE MTU 大小为 1,480 字节。对于某些 Internet 服务提供商 (ISP),您可能需要将 PPPoE 连接的 MTU 大小降至 1,400 和 1,480 之间的一个值(例如 1,454)。不要将 MTU 大小设置为小于 1,400。

 

路由器pppoe拨号时MTU为1492

 

7. MPLS Label

Label报文格式:

MPLS uses a 32-bit label field that contains the following information:

  • 20-bit label (a number)
  • 3-bit experimental field (usually used to carry IP precedence value)
  • 1-bit bottom-of-stack indicator (indicates whether this is the last label before the IP header)
  • 8-bit TTL (equal to the TTL in IP header),used to prevent indefinite looping of packets.

Guess you like

Origin blog.csdn.net/weixin_40654382/article/details/81416806