以太网标头是什么样的?

use*_*406 4 ethernet header frame

以太网标头是什么样的?

是吗:

1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|
..................................destination mac..................................
...................................|...................source mac..................
...................................................................................|
...............type................|
Run Code Online (Sandbox Code Playgroud)

或者:

1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|
..................................destination mac..................................
...................................|...................source mac..................
...................................................................................|
...............type................|.......................data....................
......................................up to 1500...................................|
crc/fcs|
Run Code Online (Sandbox Code Playgroud)

或者是:

1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|
...Preamble..|................................destination mac......................
...........................................................|source mac.............
...................................................................................
.............|.type........................................|data....................
......................................up to 1500...................................|
crc/fcs|
Run Code Online (Sandbox Code Playgroud)

我在网上发现了很多对此的不同看法。

Pat*_*rik 5

他们都不是。根据规格,框架如下所示:

  • 前导码:8字节
  • 目标mac:6字节
  • 源mac:6字节
  • 类型/长度:2字节
  • 数据:46-1500字节
  • 帧校验:4字节

规格在这里:http ://standards.ieee.org/about/get/802/802.3.html

更有用且更容易访问的解释在这里: http: //wiki.wireshark.org/Ethernet

标头是数据之前的帧。MAC 标头位于点 2-4(14 字节)。MAC 尾部为 4 个字节(最后一点)。因此,以太网帧由前导码(8 字节)、MAC 标头(14 字节)、数据和尾部(4 字节)组成。