Big Box, Small TruckWhat Do You Do?
When you ship something, the shipper can easily handle your package, using the normal trucks, with a single driver stopping by to pick up your package. But the shipper does have a limit to the dimensions and weight of the package; otherwise, the package might not fit on the truck, or it might be too heavy for the driver to pick up.
However, sometimes, companies need to send lots of stuffstuff that, when packaged, far exceeds the shipper's limitations for the size of a package. In some cases, the shipper sends special trucks to pick up the stuff, and maybe uses a forklift to load the truck. Or, the company wanting to ship something works with the shipping company to package the stuff so that the packages can be handled more easily.
In networking, if a large piece of data needs to be sent, it's easy to break up a large number of bits into smaller pieces. As it turns out, Those Who Came Before Us decided to have the transport layer protocol break the data into pieces before transmission. If an application has a large amount of data to send, it gives the whole chunk of data to the transport layer protocol, and the transport layer protocol worries about breaking the data into manageable pieces.
A maximum number of bytes can be put into a TCP segment (including the TCP header). 1480 is the typical maximum, although it can be larger in some instances. The maximum size of a segment is called the maximum segment size (mss).
The application layer protocol does not have a limit to the size of bytes it chooses to send; it just lets the transport layer protocol worry about it. Here's how the application layer protocol thinks about the size of the data that should be sent:
"I just need to send a big bunch of bytes. Transport layer, please send these bits to the other computer."
The transport layer gets the bytes from the application layer, but it has an mss to worry about. So, the transport layer thinks something like this:
"I need to send this big bunch of bytes. I'll break them up into pieces, no larger than mss each, before sending it to the other device."
The process of breaking the data into parts is called segmentation. The bytes that include the data and the TCP header are called TCP segments because TCP often breaks up, or segments, a large chunk of data received from the applications. Figure 9-8 shows an example, where the file that contains the home page has 3000 bytes of data.