The Transmission Control Protocol

TCP provides error-correction through the use of a connection-oriented transaction. Whenever an application needs to send data to another host, TCP builds a “start” segment and sends it to the destination node. When the other system sends a “start” segment back (along with an acknowledgment that it got the first segment), a monitored conversation between the two systems begins.

TCP works in much the same way as a telephone conversation. When an application wants to trade data with another system, it first tries to establish a workable session. This is similar to you calling another person on the phone. When the other party answers (“Hello?”), they are acknowledging that the call went through. You then acknowledge the other party’s acknowledgment (“Hi Joe, this is Eric”), and begin exchanging information.

If at any time during the call parts of the data exchange are lost (“Sorry, what did you say?”), the sender retransmits the questionable data. If the connection degrades to a point where no communication is possible, then sooner or later both parties simply stop talking. Otherwise, once all of the data has been exchanged, the parties agree to disconnect (“See ya”), and close the call gracefully. TCP follows most of these same rules, as is illustrated in Figure 1.12.

TCP virtual circuits versus telephone calls
Figure 1.12. TCP virtual circuits versus telephone calls

TCP segments are encapsulated ...

Get Internet Core Protocols: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.