TCP
Also known as: Transmission Control Protocol
Transmission Control Protocol — a reliable, connection-oriented transport protocol that guarantees ordered, error-checked delivery of packets between applications.
Last updated:
What is TCP?
TCP (Transmission Control Protocol) is the reliable, connection-oriented transport layer protocol used by most internet applications. Defined in RFC 9293 (the 2022 modernization of the original RFC 793), TCP sits on top of IP and guarantees that data sent by one application arrives in order, without duplication, and without corruption at the other end. HTTP, HTTPS, SSH, SMTP, FTP, and most other common protocols run on TCP.
The three-way handshake
Before any data flows, TCP establishes a connection with a three-way handshake:
- SYN — client sends a SYN packet with an initial sequence number
- SYN-ACK — server replies acknowledging the client's SYN and sending its own
- ACK — client acknowledges the server's SYN; connection is now open
This handshake is also the mechanism used by port scanners — if the SYN-ACK comes back, the port is open; if RST comes back, it's closed; if nothing comes back, it's filtered by a firewall.
Reliability features
TCP provides guarantees that IP alone doesn't:
- Sequence numbers let the receiver reassemble packets into the right order even if they arrive out of order
- Acknowledgments (ACKs) confirm every segment was received; unacknowledged segments are retransmitted
- Checksums detect packet corruption
- Flow control (sliding window) prevents the sender from overrunning a slow receiver
- Congestion control (slow start, congestion avoidance, fast retransmit) backs off when the network is overloaded
TCP vs. UDP
UDP trades all of these guarantees for lower overhead — no handshake, no retransmission, no ordering. TCP is the right choice when correctness matters (web, email, SSH). UDP is right when latency and simplicity matter more (DNS, video calls, games).
TCP connections are identified by the 4-tuple (source IP, source port, destination IP, destination port). See our glossary entry on ports for how port numbers are assigned.