Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an ethernet header look like?

What does the ethernet header look like?

Is it:

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................|

Or:

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|

Or is it:

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|

I found many different opinions on this in the web.

like image 582
user2025406 Avatar asked Sep 16 '25 00:09

user2025406


1 Answers

Neither of them. Following the specs the frame looks like:

  • Preamble: 8 bytes
  • Destination mac: 6 bytes
  • Source mac: 6 bytes
  • Type/length: 2 bytes
  • Data: 46-1500 bytes
  • Frame check: 4 bytes

The specs are here: http://standards.ieee.org/about/get/802/802.3.html

A more useful and easily accessible explanation is here: http://wiki.wireshark.org/Ethernet

The header is the frame before the data. The MAC header is point 2-4 (14 bytes). The MAC trailer is 4 bytes (last point). The ethernet frame thus consists of the preamble (8 bytes), the MAC header (14 bytes), data and the trailer (4 bytes).

like image 152
Patrik Avatar answered Sep 17 '25 18:09

Patrik