What is the "in-the-wire" size of a ethernet frame? 1518 or 1542?

Solution 1:

The diagram on Wikipedia is horrible. Hopefully what I'm about to write is clearer.

The maximum payload in 802.3 ethernet is 1500 bytes.
This is the data you're trying to send out over the wire (and what the MTU is referring to).
[payload] <- 1500 Bytes

The payload is encapsulated in an Ethernet Frame (which adds the Source/Destination MAC, VLAN tag, Length, and CRC Checksum. This is a total of 22 bytes of additional "stuff"
[SRC+DST+VLAN+LENGTH+[payload]+CRC] <- 1522 Bytes

The Frame is transmitted over the wire -- before your ethernet card does that it basically stands up and shouts really loud to make sure nobody else is using the wire (CSMA/CD) -- This is the Preamble and Start-of-Frame delimiter (SFD) -- an additional 8 bytes, so now we have:
[Preamble+SFD+[Ethernet Frame]] <- 1530 Bytes

Finally when an ethernet transceiver is done sending a frame it is required by 802.3 to transmit 12 bytes of silence ("Interframe Gap") before it's allowed to send its next frame.
[Preamble+SFD+[Ethernet Frame]+Silence] <- 1542 bytes transmitted on the wire.

The Preamble, SFD and Interframe Gap do not count as part of the frame. They are support structure for the Ethernet protocol itself.

The MTU applies to the payload -- it is the largest unit of data you can cram into the packet. Thus an ethernet packet with an MTU of 1500 bytes will actually be a 1522 byte frame, and 1542 bytes on the wire (assuming there's a vLAN tag).

So the answer to your question - What is the biggest packet I can send out over 802.3 ethernet without fragmentation? - is 1500 bytes of payload data.

HOWEVER the ethernet layer may not be your limiting factor. To discover if something along the way is restricting the MTU to be smaller than 1500 bytes of payload data use one of the following:

  • Windows: ping hostname -f -l sizeofdata (technique John K mentioned)
  • BSD: ping -D -s sizeofdata hostname
  • Linux: ping -M do -s sizeofdata hostname

The largest value of sizeofdata that works is the MTU (over the particular path your data is taking).

Solution 2:

It depends on the amount of data you put in the frame. If you put 1500 bytes of data in a frame, your total frame size is going to be 1518 bytes. With 1472 bytes of data, you'll end up with a total frame size of 1500..


That being said, if you're truly interested in testing fragmentation, a good way to test this is with a good old ping with a few flags:

ping hostname -f -l sizeofdata

The -f flag will cause the ping to fail if the packet is fragmented. The key to understand here is "sizeofdata" is the amount of data you can put in a message without fragmenting - so if you send a payload of 1500, you'll start fragmenting as you go over 1500 bytes. Turn that down to 1472 though (1500 - the 18 byte overhead), and you'll see the pings go through.