Share via


Transmission Control Protocol (TCP)

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP) is a required TCP/IP standard defined in RFC 793, "Transmission Control Protocol (TCP)," that provides a reliable, connection-oriented packet delivery service. The Transmission Control Protocol:

  • Guarantees delivery of IP datagrams.

  • Performs segmentation and reassembly of large blocks of data sent by programs.

  • Ensures proper sequencing and ordered delivery of segmented data.

  • Performs checks on the integrity of transmitted data by using checksum calculations.

  • Sends positive messages depending on whether data was received successfully. By using selective acknowledgments, negative acknowledgments for data not received are also sent.

  • Offers a preferred method of transport for programs that must use reliable session-based data transmission, such as client/server database and e-mail programs.

How TCP works

TCP is based on point-to-point communication between two network hosts. TCP receives data from programs and processes this data as a stream of bytes. Bytes are grouped into segments that TCP then numbers and sequences for delivery.

Before two TCP hosts can exchange data, they must first establish a session with each other. A TCP session is initialized through a process known as a three-way handshake. This process synchronizes sequence numbers and provides control information that is needed to establish a virtual connection between both hosts.

Once the initial three-way handshake completes, segments are sent and acknowledged in a sequential manner between both the sending and receiving hosts. A similar handshake process is used by TCP before closing a connection to verify that both hosts are finished sending and receiving all data.

TCP segments are encapsulated and sent within IP datagrams, as shown in the following illustration.

TCP encapsulation in an IP datagram

TCP ports

TCP ports use a specific program port for delivery of data sent by using Transmission Control Protocol (TCP). TCP ports are more complex and operate differently from UDP ports.

While a UDP port operates as a single message queue and the network endpoint for UDP-based communication, the final endpoint for all TCP communication is a unique connection. Each TCP connection is uniquely identified by dual endpoints.

Each single TCP server port is capable of offering shared access to multiple connections because all TCP connections are uniquely identified by two pairs of IP address and TCP ports (one address/port pairing for each connected host).

TCP programs use reserved or well-known port numbers, as shown in the following illustration.

TCP ports as used by programs

The server side of each program that uses TCP ports listens for messages arriving on their well-known port number. All TCP server port numbers less than 1,024 (and some higher numbers) are reserved and registered by the Internet Assigned Numbers Authority (IANA).

The following table is a partial list of some well-known TCP server ports used by standard TCP-based programs.

TCP port number Description

20

FTP server (data channel)

21

FTP server (control channel)

23

Telnet server

53

Domain Name System zone transfers

80

Web server (HTTP)

139

NetBIOS session service

For an updated, complete list of all currently registered well-known TCP ports, see the see the Internet Assigned Numbers Authority (IANA) Web site.

Note