注:Ethernet II的最小data length为46,如果小于,会补全到46.
1.指定网卡抓取的,链路为ethernet。
IPv4

- Ethernet II 长度为 14 bytes - L1
- ipv4 header中的length包括header和payload的总长度 - L2
- wireshark中length表示抓取的packet的总长度 - L3
L3 = L1 + L2
134 = 14 + 120
IPv6

- Ethernet II 长度为 14 bytes - L1
- ipv6 header中的length 只表示payload的总长度 - L2
- wireshark中length表示抓取的packet的总长度 - L3
L3 = L1 + L2 + 40(IPv6 header length)
105 = 14 + 51 + 40
2.不指定网卡抓取,链路为ethernet。
IPv4

- Linux cooked capture v2 长度为 20 bytes - L1
- ipv4 header中的length包括header和payload的总长度 - L2
- wireshark中length表示抓取的packet的总长度 - L3
L3 = L1 + L2
172 = 20 + 152
IPv6

- Linux cooked capture v2 长度为 20 bytes - L1
- ipv6 header中的length 只表示payload的总长度 - L2
- wireshark中length表示抓取的packet的总长度 - L3
L3 = L1 + L2 + 40(IPv6 header length)
111 = 20 + 51 + 40