IPv4 基本报头(20 ~ 60 Byte)
IPv6 基本报头(40 Byte)
IPv4 Header vs IPv6 Header
-
黄色 为 IPv6 与 IPv4 相同
-
红色 为 IPv6 删除的
-
蓝色 为名称不同功能相同
-
中青色 为新增的
Type of service = Traffic Class (用于 QoS)
Total Length = Ppayload Length ( IPV6 中包头定长,不需要包头长度)
Protocol = Next Header (上层协议)
TTL = Hop Limit (跳数限制 )
Flow Label 此字段为 IPv6 新增字段,20 bit,可以在无状态和有状态的场景中用作 QoS(Quality of Service,服务质量)控制。
只有流标签、源地址以及目标地址三元组完全一致时,才能被认为是同一条流。通过结合流标签、源地址和目标地址三元组,可以准确识别和分类数据流,使得网络能够更高效地分配资源、优化传输路径和提高服务质量。
IPv4 总长度(Total Length)
长度 16 bit,包括报文头部和数据。单位是 Byte,最大数值为 65535。
IPv6 载荷长度(Payload Length)
长度 16 bit,数据包的有效载荷,指基本报头后的数据内容长度,包含扩展头部分。单位是 Byte,最大数值为 65535。
IPv4 总长度(Total Length) 与 IPv6 载荷长度(Payload Length)的字段不同点
IPv4 报头中总长度字段是指报头和数据两部分的长度 ,而 IPv6 的有效载荷字段是指仅数据部分的长度,不包括 IPv6 基本报头。
IP 协议号列表(List of IP Protocol Numbers)
This is a list of the IP protocol numbers found in the field Protocol of the IPv4 header and the Next Header field of the IPv6 header. It is an identifier for the encapsulated protocol and determines the layout of the data that immediately follows the header.
Both fields are eight bits wide. Protocol numbers are maintained and published by the Internet Assigned Numbers Authority (IANA).
IPv4 报头的 protocol 字段和 IPv6 报头的 Next header 字段中是封装协议的标识符,它决定了紧跟在报头后面的数据的布局。两个字段都是 8 位宽。
协议号由互联网号码分配机构 (IANA) 维护和发布。
Hex | Protocol Number | Keyword | Protocol | References/RFC |
---|---|---|---|---|
0x00 | 0 | HOPOPT | IPv6 Hop-by-Hop Option | RFC 8200 |
0x01 | 1 | ICMP | Internet Control Message Protocol | RFC 792 |
0x02 | 2 | IGMP | Internet Group Management Protocol | RFC 1112 |
0x03 | 3 | GGP | Gateway-to-Gateway Protocol | RFC 823 |
0x04 | 4 | IP-in-IP | IP in IP (encapsulation) | RFC 2003 |
0x05 | 5 | ST | Internet Stream Protocol | RFC 1190, RFC 1819 |
0x06 | 6 | TCP | Transmission Control Protocol | RFC 793 |
0x07 | 7 | CBT | Core-based trees | RFC 2189 |
0x08 | 8 | EGP | Exterior Gateway Protocol | RFC 888 |
0x09 | 9 | IGP | Interior Gateway Protocol (any private interior gateway, for example Cisco’s IGRP) | |
0x0A | 10 | BBN-RCC-MON | BBN RCC Monitoring | |
0x0B | 11 | NVP-II | Network Voice Protocol | RFC 741 |
0x0C | 12 | PUP | Xerox PUP | |
0x0D | 13 | ARGUS | ARGUS | |
0x0E | 14 | EMCON | EMCON | |
0x0F | 15 | XNET |