TCP is an Acronym of TransmissionControlProtocol. It is part of the TCP/IP protocol stack.

TCP is connection-oriented: before two parties can communicate, they must open a common connection; after they have finished communicating, they close the connection. The initiation of the connection is asymmetric: one end needs to listen for connection attempts, while the other end initiates a connection during this time. However, once the connection is opened, it is symmetric and full-duplex--both ends are equally capable of transmitting arbitrary information at arbitrary times.

TCP is an ordered stream--data sent from one end will arrive at the other end in the same order. Communication is reliable--all transmissions are automatically acknowledged, with timeouts and retries if any lower-level packets are lost, including automatic sequencing to detect duplicates (as can happen when a lower-level packet wasn't "lost", but simply took too long to arrive). Compare XCP and DCCP.

Someone who's done 312 recently want to write a big long discussion about Nagle, Slow start, backoff, congestion control, window sizes etc?

We have separate pages discussing TcpStates, and the TcpWindow.

TCP Header:

|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31 ||||||||||||||||||||||||||||||||^IPv4/IPv6 Header ||||||||||||||||Source Port |||||||||||||||| Destination Port |||||||||||||||||||||||||||||||| Sequence Number |||||||||||||||||||||||||||||||| Acknowledgement ||||Data Offset||||Reserved|CWR|ECE|URG|ACK|PSH?|RST|SYN|FIN||||||||||||||||Window ||||||||||||||||Checksum||||||||||||||||Urgent Pointer ||||||||||||||||||||||||||||||||Optional Options / Padding ||||||||||||||||||||||||||||||||v Data

TCP Options:

End of option list

|00|01|02|03|04|05|06|07 |||||||| 0

No Op (Padding)

|00|01|02|03|04|05|06|07 |||||||| 1

Maximum Segement Size

|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31 |||||||| 2 |||||||| length (4) |||||||||||||||| MSS |||||||||||||||| MSS (Continued) ||||||||||||||||

Window Scale Option

|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31 |||||||| 3 |||||||| length (3) |||||||| Shift Count ||||||||


|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15 |||||||| 4 |||||||| length (2)

SACK Information

|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31 |||||||| 5 |||||||| length |||||||||||||||| Left edge of first block |||||||||||||||| Left edge of first block (continued) |||||||||||||||| Right edge of first block |||||||||||||||| Right edge of first block (continued) |||||||||||||||| ..... |||||||||||||||| ....... |||||||||||||||| Left edge of last block |||||||||||||||| left edge of last block (continued) |||||||||||||||| Right edge of last block |||||||||||||||| Right edge of last block (continued)

TCP Timestamps

|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31 |||||||| 8 |||||||| length (10) |||||||||||||||| TS Value |||||||||||||||| TS Value (Continued) |||||||||||||||| TS Echo Reply |||||||||||||||| TS Echo Reply (Continued) ||||||||||||||||

See also:

CategoryProtocols, CategoryNetworking