When the data sent in an Ethernet frame is less than 46 bytes, extra padding needs to be added to the payload. The question is:

  • Which is the value of that Ethernet padding?

I'm asking since in real captures I checked this padding seems random, i.e. a changing combination of 1s and 0s.

IEEE 802 packets may have a minimum size restriction. When necessary, the data field should be padded (with octets of zero) to meet the IEEE 802 minimum frame size requirements. This padding is not part of the IP datagram and is not included in the total length field of the IP header.

The padding can have any values, decided by the network interface card, the operating system and the driver.

Conservative OS might pad with zeros. Lazy OS might leave whatever was in those memory locations alone, and you'll see leftovers from the previous frame.

  • 7
    Leaving data from a previous frame seems like a security problem, since the previous frame would likely have been destined to a different remote device, application, or user. – Barmar Sep 24 at 21:11
  • @Barmar Yes, which can be fixed by enforcing longer dataframes so no padding will be added. – Mast Sep 25 at 6:12

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.