7

What is reason to pad payload to mininum 46bytes, to form a ethernet frame of 64 bytes.

Following says min would be 41 bytes.

https://stackoverflow.com/questions/14526139/what-is-the-minimum-packet-size-for-tcp-over-ipv4

I could not connect the dots, can any one explain this.

16

The entire frame has to be at least 64 bytes. This is not just the payload, this includes the headers and the frame check sequence. The FCS takes up 4 bytes at the end. An Ethernet header consists of two 6 byte MAC addresses plus a 2 byte type field, 14 bytes in total. 64-4-14 = 46. IPv4 packets have an additional header of at least 20 bytes on top of the Ethernet header, making the minimum payload size 26 bytes. TCP and UDP add more headers on top of that.

Another thing to note is that the size of a minimum length frame on the wire is actually larger than 64 bytes - there is an 8 byte preamble/start of frame delimiter and a 12 byte interframe gap that get attached to every packet, making a 64 byte packet take up 64+8+12 = 84 bytes on the wire.

The 41 byte answer on the other question is only considering TCP and IP headers. If you send a TCP packet with 0 data bytes, it will have 40 bytes of headers; it's not possible to make a valid TCP packet smaller than this. But if you try to send this packet, it will get zero padded out to 46 bytes before the Ethernet FCS is attached.

The reason this was originally done with Ethernet was to ensure a minimum frame length on the wire so that collisions could be reliably detected by all devices over the specified maximum cable length. This is required because early incarnations of 10M Ethernet used a shared coaxial medium and connected devices had to be able to detect when two of them tried to transmit on the shared medium at the same time. Slightly less ancient 10M and 100M Ethernet networks over twisted pair that were built with hubs instead of switches also needed to be able to detect collisions. However, most modern Ethernet networks are switched and do not use a shared medium, so this is no longer strictly necessary, but it's still part of the spec for compatibility reasons. Frames shorter than 64 bytes are called runt frames, and if you see runt frames in a network that usually indicates some sort of configuration or hardware issue.

|improve this answer|||||
4

The question does not specify the transport medium. IPv4 can be used with almost anything including serial ports for example.

Ethernet frames have a minimum size, which also depend on speed: 10/100 MBit has 64 byte minimum, while gigabit has 512 byte minimum. This transport layer cannot send smaller packets and thus needs padding.

|improve this answer|||||
  • 2
    Wrong. Gigabit Ethernet also has a 64 byte minimum frame length. – alex.forencich Aug 19 '16 at 11:57
  • 3
    I think this is the source of the confusion, the minimum frame size is still 64bytes, but the slot size is 512 bytes: the minimum frame size is not increased, but the "carrier event" is extended. If the frame is shorter than 512 bytes, then it is padded with extension symbols. These are special symbols, which cannot occur in the payload. This process is called Carrier Extension. – Johnny Aug 19 '16 at 18:51
  • 1
    True, but carrier extension is not commonly used on gigabit links as most gigabit links are going to be point to point where there is no reason to check for collisions. – alex.forencich Aug 19 '16 at 22:31
  • 1
    Actually, I don't think half duplex gigabit Ethernet has ever been used. So yes, in the spec half duplex gigabit has to carrier extend packets to 512 bytes after the fcs...but nobody ever made a gigabit hub, so it's pretty much irrelevant. – alex.forencich Aug 19 '16 at 22:48
  • 1
    @juhist nope. The sending PHY is allowed to break the carrier extension and send another frame. So even with carrier extension enabled, you can hit full line rate with minimum length frames. Switches have PHYs on all ports, so they can forward minimum length frames at full line rate no problem, even if they came from different sources. Only hubs would show some difference, but as far as I can tell no gigabit hubs have ever been made, so there is effectively no way to detect if carrier extension is used or not unless you look at what the PHY is actually sending. – alex.forencich Jun 17 '19 at 18:51
3

In the original ethernet specification, 64 bytes would fill the cable from end-to-end, allowing collisions to be detected by all hosts. The original ethernet standard also specified 14 bytes for the header, and 4 bytes for the frame check sequence. That is 18 bytes. subtract 18 from 64, and you get 46 as the minimum payload. Since then, you can add a four byte VLAN tag. So, with the VLAN tag, the minimum payload size is 42. Without the VLAN tag, the minimum payload size remains 46.

|improve this answer|||||
  • You can also nest VLAN tags. Not sure if there is a maximum for the number you can nest, though. – alex.forencich Aug 19 '16 at 22:33
0

The minimum Ethernet frame size was defined for the original, half-duplex variants. With half duplex, you need to reliably detect and propagate collisions while they happen. A signal needs to propagate over the longest distance between two stations in a segment, allow collision detection, and propagate the jamming signal back to the sender while it is still transmitting. Putting everything together, you end up with 512 bits or 64 bytes in a frame.

For Fast Ethernet (100 Mbit/s), the inherently, half-duplex coax cable was abandoned and only full-duplex capable media are used (=media with dedicated signal paths per direction). This speeds up collision detection considerably and allows to use the same minimum frame size even though a frame over Fast Ethernet is much shorter in time.

Gigabit Ethernet initially included a half-duplex mode, requiring padding to increase the minimum Ethernet packet size (not the frame size). Half-duplex GbE wasn't actually used anywhere and is obsolete now.

Switched, full-duplex Ethernet makes these considerations obsolete. However, Ethernet is built on compatibility - all physical layer variants can coexist and interact with each other. So, the minimum frame size was never changed and an ancient 10 Mbit/s half-duplex node can still work in a modern multi-gigabit network without much ado.

However, there's much confusion about these details and much is quoted wrong. The reference is IEEE 802.3 Clause 4.4.2 MAC parameters.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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