# Minimum size of the data part of TCP segment

My question has two parts:

1. I know that the "data" part of an Ethernet frame can be 46~1500 bytes. Considering the IP header of 20 bytes + TCP header of 20 bytes, the minimum "data" size of a TCP segment should be `(46-20-20) = 6 bytes`. Considering the UDP header of 8 bytes, the minimum "data" size of a UDP segment should be `(46-8-20) = 18 bytes`. So, can anyone explain why the lower bound of application data size becomes a high value like 6 bytes or 18 bytes; not a small value, like 1 byte? I believe I am missing something.

2. I found a couple of explanations[1][2] that the minimum size of an IP packet should be 64 bytes. I think the explanation in the above links are correct. In that case, why is not the minimum "data" size of an Ethernet frame `(64-20-20) = 24 bytes`?

Can anyone explain this more clearly?

-

The minimum frame size for Ethernet is dictated at 64 bytes (as also described in your references).

``````DMAC + SMAC + EtherType + Payload + CRC
6   +  6   +     2     +    46   +  4  = 64
``````

At layer 4 (TCP or UDP) the 'length' covers the layer 4 header and it is tracked in the IP header.
This means, for UDP the minimum expected is 8 bytes (for its header). And, for TCP it is 20 bytes (the minimum TCP header).

The part you seem to be missing starts now.
While the Ethernet data length is required to be a minimum of 46 bytes, the IP length does not have to be `46-20` bytes. It can be much lesser than that.

So, if we had a 8 byte UDP packet with no data at all, its IP length would be `20+8` but the Ethernet payload length will still be `46` bytes. What happens to the `18` byte hole? It is padded to make the Ethernet frame on wire `64` bytes (for reasons you already know).

``````[Eth: DMAC + SMAC + EtherType + [IP: Hdr + [UDP: Hdr + 0data ]] + PAD + CRC ]
``````

Bottomline: What you refer as the `application data size` has no minimum expectations based on this `64` byte Ethernet requirement. The `PAD` will compensate for any differences.

-
So, to make a minimum 64 bytes Ethernet Frame -(18 bytes Ethernet header/trailer + 20 bytes IP header + 20 (or 8) bytes Transport layer header + xxxx bytes of padding is used. I was confused with the statement "IP packet should be minimum of 64 bytes" made by many people, which is not true. Actually "an Ethernet frame should be minimum of 64 bytes" is correct. Am I right? – Adrian Feb 27 '12 at 15:31
@Adrian, yes. That is the way all descriptions for padding go. You started backwards -- or, from the wrong side of the network stack (the application layer) and missed padding on the way. – nik Feb 28 '12 at 16:05