6

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.

Boni García
  • 163
  • 1
  • 4

2 Answers2

7

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.

Pikamander2
  • 105
  • 3
Datagram.Network
  • 1,577
  • 9
  • 16
7

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.

jonathanjo
  • 16,104
  • 2
  • 23
  • 53
  • 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 '18 at 21:11
  • @Barmar Yes, which can be fixed by enforcing longer dataframes so no padding will be added. – Mast Sep 25 '18 at 06:12