
The TCP/IP Guide - Version 3.0 (Contents) ` 913 _ © 2001-2005 Charles M. Kozierok. All Rights Reserved.
This has a couple of interesting impacts on how applications work. One is that TCP does
not provide any natural indication of the dividing point between pieces of data, such as
database records or files. The application must take care of this. Another result of TCP's
byte orientation is that TCP cannot decide when to form a segment and send bytes
between devices based on the contents of the data. TCP will generally accumulate data
sent to it by an application process in a buffer. It chooses when and how to send data based
solely on the sliding window system discussed in the previous topic, in combination with
logic that helps to ensure efficient operation of the protocol.
This means that while an application can control the rate and timing with which it sends
data to TCP, it cannot inherently control the timing with which TCP itself sends the data over
the internetwork. Now, if we are sending a large file, for example, this isn't a big problem. As
long as we keep sending data, TCP will keep forwarding it over the internetwork. It's
generally fine in such a case to let TCP fill its internal transmit buffer with data and form a
segment to be sent when TCP feels it is appropriate.
Problems with Accumulating Data for Transmission
However, there are situations where letting TCP accumulate data before transmitting it can
cause serious application problems. The classic example of this is an interactive application
such as the Telnet Protocol. When you are using such a program, you want each keystroke
to be sent immediately to the other application; you don't want TCP to accumulate hundreds
of keystrokes and then send them all at once. The latter may be more “efficient” but it
makes the application unusable, which is really putting the cart before the horse.
Even with a more mundane protocol that transfers files, there are many situations in which
we need to say “send the data now”. For example, many protocols begin with a client
sending a request to a server—like the hypothetical one in the example in the preceding
topic, or a request for a Web page sent by a Web browser. In that circumstance, we want
the client's request sent immediately; we don't want to wait until enough requests have
been accumulated by TCP to fill an “optimal-sized” segment.
Forcing Immediate Data Transfer
Naturally, the designers of TCP realized that a way was needed to handle these situations.
When an application has data that it needs to have sent across the internetwork immedi-
ately, it sends the data to TCP, and then uses the TCP push function. This tells the sending
TCP to immediately “push” all the data it has to the recipient's TCP as soon as it is able to
do so, without waiting for more data.
When this function is invoked, TCP will create a segment (or segments) that contains all the
data it has outstanding, and will transmit it with the PSH control bit set to 1. The destination
device's TCP software, seeing this bit sent, will know that it should not just take the data in
the segment it received and buffer it, but rather push it through directly to the application.
It's important to realize that the push function only forces immediate delivery of data. It
does not change the fact that TCP provides no boundaries between data elements. It may
seem that an application could send one record of data and then “push” it to the recipient;