The TCP part of the TCP/IP set of protocols splits data up into easy-to-digest chunks known as datagrams or packets.

The TCP header consists of the following things.

  • Source Port
  • Destination Port
  • Sequence Number - Where in the sequence of packets this one is. TCP doesn't number the datagrams, but the octets. So if there are 500 octets of data in each datagram, the first datagram might be numbered 0, 500, 1000, 1500, etc.
  • Acknowledgement Number - For when an acknowledgement packet is sent, the highest packet number for which all the packets below have been recieved is put as the acknowledgement number.
  • Window - Used to restrict the number of packets sent depending on how much more time a slow computer takes to "absorb" packets. As more packets are processed the window goes up, as more are recieved it goes down. When the window is zero no packets are sent.
  • Checksum - Ensure data sent is correct.
  • Urgent Pointer

The Transmission Control Protocol (TCP) is the reliable, connection-oriented transport layer protocol of the TCP/IP protocol suite. TCP is reliable, in that its data packets (properly referred to as segments) are guaranteed to arrive at the destination host in order. The receiving host sends an acknowledgement (ACK) of received segment numbers back to the sender. TCP contains a retransmission scheme. TCP is connection-oriented, in that a connection-initiation handshake sequence precedes any data transmission, after which the client (the host that initiates the connection) and the server (the host that accepts the connection) maintain a virtual connection with each other by means of keepalive packets and/or ongoing bidirectional data transmissions. The notion of a TCP session, while not absolutely technically correct, makes sense.

Most application layer protocols used on the Internet use TCP as their transport layer protocols, including HTTP, FTP, SMTP, TELNET, and POP.

Contrast TCP with UDP, a connectionless, unreliable transport layer protocol. The choice between TCP and UDP is usually the choice between the convenience of built-in reliability (TCP) versus reduced overhead and speed (UDP)--TCP usually wins out. Application designers are typically willing to sacrifice some speed and packet overhead for not having to design their own reliability mechanisms into the application.

Log in or register to write something here or to contact authors.