Starting Off on the Right Foot Using a TCP Connection
So far in this chapter, you have learned about how TCP provides services to application layer protocols. Those services include basic delivery, segmentation, and error recovery. TCP also allows multiple programs to use it at the same time, keeping track of which segments are for which application using port numbers.
To do all these functions, TCP uses several fields in the TCP header. Before useful communication can occur with TCP, both endpoints must agree to the values to use in those fields initially.
TCP uses a process called TCP connection establishment to initialize several fields in the TCP header. Each time a browser connects to a new website, each time an e-mail client checks for incoming mail, and so on, a new TCP connection is created when the two computers participate in TCP connection establishment. Connection establishment is performed when the two computers send a specific set of three TCP segments to each other. After that, a TCP connection exists between the application programs on each computer, and the TCP header fields have valid initial values that both endpoints agree upon.
The term TCP connection refers to an agreement whereby one application on one computer agrees to talk with another application on another computer. For example, in Figure 9-12, before Keith's PC could request the web page shown in the figure, a TCP connection had to exist between browser2 and the web server software. To create that TCP connection, three TCP segments flow between the browser and the web server. After that is completed, a TCP connection exists, with agreement on such details as what port numbers the browser and server use, what values to start with in the sequence number field, and other details. Any time you start a new TCP-based application, a new TCP connection is formed before application messages or end user data can be transferred.
Figure 9-13 shows Keith once again, with his two browsers, one e-mail client, and one FTP client. In this case, the servers are also shown. The lines in the figure represent Keith's four TCP connections.Figure 9-13. Keith's TCP Connections