What's the minimum size of a TCP packet

Solution 1:

Packet is an ambiguous term here because it is sometimes misused to refer to different elements for your transmission. Lets see what your data is wrapped up in and you'll see what I mean, and hopefully get the answer you wanted:


Lets assume you're sending 1 byte of data1 over the internet, on the TCP/IP model.

The data starts on the application level and needs to be wrapped up in headers for the lower levels so that it can be passed around.

First that data is wrapped in a TCP Segment, which adds a header of 20 bytes (min size now 21 bytes).
This puts us on the transport level.

This is then wrapped in an IP Packet, which adds another header of 20 bytes (min size now 41 bytes).
Now we're on internet level.
Note that this wrapping is changed each time a new router forwards your data to a new subnet.

This is wrapped in a link frame of some type - of which the header and footer size vary depending on the type of frame used, which depends on the type of link being used.
This is on link level.
This wrapping is changed each time the unit if transmitted between two entities.

Finally is the physical transmission (eg, electrical signals down a cable, radio waves, etc).

Here's some informative images available from the Wikipedia TCP/IP model page that hep to visually explain what is happening:


Data encapsulation using UDP/IP


Connection via layers in the TCP/IP model


1. I guess you might be able to send 0 bytes... but haven't checked that. In fact I haven't checked if 1 byte is allowed either, but hey.

Solution 2:

That is incorrect, there is no minimum size for a download. You can verify this by creating a tiny file on your webserver and using wireshark to watch the network traffic when you download that file.

The minimum size of a standard ethernet packet is 64 bytes.

Solution 3:

On the face of it, the blog posting you are quoting from is incorrect. There is no "minimum download size" for HTTP. (And your theory about minimum packet sizes is also incorrect.)

However, there is a grain of truth to this. And that is that if the size of the file you are downloading is small enough, the HTTP response message (consisting of the file and the HTTP response headers) will fit into a single network packet. If that happens, the browser is likely to get the file faster than if it took two or more packets to send the response.

(With one packet in the response, there is less chance that a packet will be dropped and need to be resent, and a greater chance that the TCP/IP flow-control window won't add extra round-trip delays for packet acknowledgment.)

The typical maximum size of a packet sent / received (the MTU) is 1500 bytes for ethernet. When you factor in the IP and TCP overheads, and the size of a typical HTTP response header, that could well leave you ~1K left for file data in the first packet of a response. Hence the grain of truth in the blogger's comment.