web analytics

Connection Establishment and Termination

TCP connection establishment occurs before any of the other TCP features can begin
their work. Connection establishment refers to the process of initializing Sequence and
Acknowledgment fields and agreeing on the port numbers used. Figure 5-5 shows an example
of connection establishment flow.
Free CISCO CCNA Routing and Switching ICND1 Study Guide
Figure 5-5 TCP Connection Establishment

This three-way connection establishment flow (also called a three-way handshake) must
complete before data transfer can begin. The connection exists between the two sockets,
although the TCP header has no single socket field. Of the three parts of a socket, the IP
addresses are implied based on the source and destination IP addresses in the IP header.
TCP is implied because a TCP header is in use, as specified by the protocol field value in
the IP header. Therefore, the only parts of the socket that need to be encoded in the TCP
header are the port numbers.

TCP signals connection establishment using 2 bits inside the flag fields of the TCP header. Called
th e SYN and ACK flags, these bits have a particularly interesting meaning. SYN means “synchronize
the sequence numbers,” which is one necessary component in initialization for TCP.

Figure 5-6 shows TCP connection termination. This four-way termination sequence is
straightforward and uses an additional flag, called the FIN bit. (FIN is short for “finished,”
as you might guess.) One interesting note: Before the device on the right sends the third TCP
segment in the sequence, it notifies the application that the connection is coming down. It
then waits on an acknowledgment from the application before sending the third segment in
the figure. Just in case the application takes some time to reply, the PC on the right sends the
second flow in the figure, acknowledging that the other PC wants to take down the connection.
Otherwise, the PC on the left might resend the first segment repeatedly.
Free CISCO CCNA Routing and Switching ICND1 Study Guide
Figure 5-6 TCP Connection Termination

TCP establishes and terminates connections between the endpoints, whereas UDP does not.
Many protocols operate under these same concepts, so the terms connection-oriented and
connectionless are used to refer to the general idea of each. More formally, these terms can
be defined as follows:

■ Connection-oriented protocol: A protocol that requires an exchange of messages
before data transfer begins, or that has a required pre-established correlation between
two endpoints.
■ Connectionless protocol: A protocol that does not require an exchange of messages and
that does not require a pre-established correlation between two endpoints.

Subscribe To Get

Latest IT certification News 

Help You Pass Any IT Exam