Before application processes can send data by using TCP, they must establish a connection. The connections are made between the port numbers of the sender and the receiver nodes. A TCP connection identifies the end points involved in the connection. The end point on picture below is formally defined as a pair that includes the IP address and port number:
(IP address, port numbers)
The IP address is the internetwork address of the network interface over which the TCP/IP application communicates. The port number is the TCP port number that identifies the application. The end point contains both the IP address and port numbers because port identifiers are selected independently by each TCP, and they may not be unique. By concatenating the unique IP address with port numbers, a unique value for
the end point is created.
A TCP connection is established between two end points. The TCP connection is identified by the parameters of both end points, as follows:
(IP address1, port number1, IP address2, port number2)
These parameters make it possible to have several application processes connect to the same remote end point. Picture above shows that several application processes connect to the same remote end point (199.11.23.1, 2001). The TCP module at 199.11.23.1 can keep the different TCP connections separate because TCP uses both the local and remote end points to identify the connection. In that picture, the end point (199.11.23.1, 2001) is the same, but the end points at the other end of the connection are different. This difference enables TCP to keep these connections separate.
The picture also illustrates that TCP can support multiple connections concurrently. These connections are multiplexed over the same network interface.
A connection is fully specified by the pair of end points. A local end point can participate in many connections to different foreign end points. A TCP connection can carry data in both directions; that is, it is full duplex.
In relationship to TCP connections, it is also helpful to define the notion of a half association and a full association. A half association is an end point that also includes the transport protocol name, as follows:
(TransportProtocol, IP address, port number)
The half associations in picture are, therefore, the following:
(tcp, 199.21.32.2, 1400)
(tcp, 196.62.132.1, 21)
A full association consists of two half associations and is expressed by the following ordered pair:
(TransportProtocol, IP address1, port number1, IP address2, port number2)
The TransportProtocol is listed only once because it has to be the same on both parts of the half association. The concept of half and full associations is useful when dealing with different transport protocols. As an example, the full association in picture is listed as follows:
(tcp, 199.21.32.2, 1400, 196.62.132.1, 21)
A full association consisting of source and destination IP addresses, and source and destination port numbers uniquely identifies a TCP connection.