☰

Main Menu

✕

What Is TCP? Full Form, How It Works & Uses 🌐

TCP (Transmission Control Protocol) is the transport-layer protocol that delivers data from one application to another — complete and in order. It sets up a connection between two hosts, numbers every byte, waits for the receiver to confirm what arrived, and resends whatever went missing. IP (Internet Protocol) handles addressing and routing. Together they form the core of the TCP/IP suite, which is why the stack carries both names.

This guide covers what TCP stands for, how it works, the three-way handshake, how it closes connections, the TCP header, TCP vs UDP, the 4 layers of the TCP/IP model, common ports, and whether TCP is actually secure.

❓ What Does TCP Stand For?

The full form of TCP is Transmission Control Protocol. The current specification is RFC 9293, published by the IETF. It replaced the original RFC 793 from 1981 and describes TCP as a connection-oriented protocol that delivers a reliable, in-order byte stream — even though the network underneath regularly drops and reorders packets.

TCP is a fundamental internet component established through the Internet Engineering Task Force (IETF). Before TCP begins to send data, it verifies that the link between the source and target is stable. Then it breaks the data into numbered packets so transmission doesn't fail. Protocols like Telnet, Secure Shell (SSH), File Transfer Protocol (FTP), and email services (POP, IMAP, HTTP, SMTP) all rely on TCP.

🔀 TCP vs IP: Who Does What

IP handles addressing and routing, moving packets between IP addresses across many networks. It's connectionless and best effort, so a packet may never arrive, arrive twice, or arrive out of order. TCP sits one layer above and covers those gaps for applications. If IP is the postal network, TCP is the clerk who numbers every page, tracks the receipts and resends anything lost.

Aspect TCP IP
Layer Transport Internet
Main job Reliable delivery between applications Addressing and routing packets between hosts
Identifies endpoints by Port numbers IP addresses
Connection Connection-oriented (handshake first) Connectionless
Reliability Acknowledgments, retransmission, ordering Best effort, no guarantees

Every device needs a unique IP address to send and receive data. For a breakdown of the different formats, see the different types of IP addresses.

⚙️ How TCP Works

When your browser loads a web page, it hands the request to TCP:

  1. The application writes data into a TCP socket — the pairing of an IP address with a port.
  2. TCP splits the byte stream into segments no larger than the maximum segment size (MSS) the two hosts agreed on.
  3. Each segment carries source and destination ports, so the receiving host knows which service gets it (port 443 for the web server, for example), plus a sequence number marking where its bytes belong in the stream.
  4. The receiver sends acknowledgments (ACKs) for the data it has received.
  5. If an ACK doesn't come back before a timeout — which TCP calculates from the measured round-trip time — the sender retransmits that segment. Duplicate ACKs can trigger an earlier retransmit.
  6. The receiver puts the segments back in sequence order and passes a continuous stream up to the application.
TCP diagram showing lost segment 3, duplicate ACKs, retransmission, and reassembled ordered data

🔒 Why TCP Is Considered Reliable

Sequence numbers and ordered delivery

Every byte has a position in the stream. The receiver buffers out-of-order segments until the gap is filled, so the application never sees scrambled data.

Checksums

Each segment includes a checksum over the header and the data. The receiver drops a corrupted segment, and normal retransmission replaces it.

Flow control with a sliding window

The receiver advertises a window size — the number of bytes it can accept right now — and the sender stays under it. That keeps a fast server from flooding a slow client.

Congestion control

Flow control protects the receiver; congestion control protects the network. RFC 9293 requires TCP endpoints to implement congestion control. Common algorithms such as slow start and congestion avoidance raise the sending rate gradually and back off when they detect packet loss.

Packets still get lost under TCP. It detects the loss and repairs it — and you pay for that in extra latency.

🤝 TCP Three-Way Handshake Explained

Before any data moves, the client and server open the connection in three steps:

SYN

The client sends a segment with the SYN flag set and its initial sequence number.

SYN-ACK

The server replies with SYN and ACK set, acknowledging the client's sequence number and sending its own.

ACK

The client acknowledges the server's sequence number. Both sides are now in the ESTABLISHED state, and data can flow.

TCP three-way handshake diagram with Client and Server timelines and SYN, SYN-ACK, ACK steps.

🔌 How TCP Closes a Connection

FIN and ACK

A graceful close takes four segments because each direction shuts down on its own. One side sends FIN and the other ACKs it; then the second side sends its own FIN, which the first side ACKs. The side that closed first waits in TIME_WAIT briefly so late segments don't confuse a new connection.

RST resets

An RST segment ends a connection immediately. You'll see one when a client hits a closed port, an application aborts, or a firewall kills a session. In troubleshooting, "connection reset by peer" means an RST arrived.

📦 TCP Header and Its Main Fields

A TCP header is at least 20 bytes. The fields you'll meet most often in Wireshark or tcpdump are:

  • Source and destination ports (16 bits each, 0 to 65535)
  • Sequence number and acknowledgment number
  • Flags, including SYN, ACK, FIN, RST and PSH
  • Window size, used for flow control
  • Checksum, used for error detection
  • Options, such as MSS and window scaling
Annotated TCP header diagram in 32-bit rows with labeled fields and bit lengths.

⚖️ TCP vs UDP

UDP (User Datagram Protocol) is TCP's lightweight sibling at the transport layer, with no handshake, acknowledgments or retransmission. The choice comes down to whether complete data or low delay matters more to the application.

Feature TCP UDP
Connection Connection-oriented Connectionless
Delivery Reliable, lost data is retransmitted Best effort
Ordering Guaranteed Not guaranteed
Overhead Higher (20+ byte header, ACKs) Lower (8-byte header)
Typical uses Web, email, SSH, file transfer, databases DNS lookups, VoIP, video calls, online games, streaming

Use TCP when every byte has to arrive — a file download or a database query. UDP fits real-time traffic, where a late packet is worthless and resending it only adds lag. HTTP/3 runs over QUIC, which is built on UDP, so not all web traffic uses TCP anymore.

🗂️ The 4 Layers of the TCP/IP Model

  • Link (network interface) layer: moves frames over the physical network — Ethernet, Wi-Fi, drivers, and NICs.
  • Internet layer: handles IP addressing and routing between networks.
  • Transport layer: TCP and UDP carry data between applications, identified by ports.
  • Application layer: protocols like HTTP, SMTP, SSH and DNS.

To see how these four layers map onto the seven-layer reference model, read OSI model explained. For how traffic leaves your network, see how internet access works.

🚪 Common TCP Ports and Protocol Examples

A port number tells the receiving host which service a segment is for. IANA keeps the official service name and port number registry.

Service Default TCP port
HTTP / HTTPS 80 / 443
SSH 22
FTP (control / data) 21 / 20
SMTP / submission 25 / 587
IMAP / IMAPS 143 / 993
POP3 / POP3S 110 / 995
RDP 3389
SMB 445

FTP's active and passive modes are covered in FTP port number, and SMB ports 135 and 445 explains Windows file sharing. There are also guides to secure remote access with SSH and to changing the default RDP port on a Windows server.

🔐 Is TCP Secure?

TCP doesn't encrypt anything. Anyone on the path can read a plain TCP stream, and TCP can't authenticate who's on the other end. RFC 9293 notes that applications usually get security from TLS above TCP or IPsec below it. HTTPS is HTTP over TLS over TCP, and SSH encrypts its session on top of a TCP connection. If an article calls TCP "one of the most secure protocols," treat it as wrong.

📡 How TCP/IP Is Used in Practice

TCP/IP is not a proprietary service — no one controls or organizes it. IP is open, works on all operating systems and hardware, and communicates across platforms. TCP is extremely scalable and identifies the best paths for data. The stack uses a client-server model: the client is the user or machine making a request; the server is the machine responding. TCP/IP is stateless at the application level — every request is new and unrelated to previous ones — but the transport layer is stateful and keeps the connection open until all packets are delivered and reassembled.

Example: sending an email through SMTP. The email server's TCP layer splits the message into numbered packets and hands them to IP for transport. Each packet may take a different route. When they arrive, IP hands them back to TCP, which reassembles them and delivers the email to the recipient's client — landing in their inbox.

⚠️ Advantages and Limitations of TCP

Advantages:

  • Stable connection between devices regardless of distance.
  • Works flawlessly across different operating systems.
  • Supports different routing protocols (IGP/EGP, classful and classless).
  • Client-server architecture that scales.
  • Open and lightweight.

Limitations:

  • A handshake round trip before the first byte moves.
  • Extra header and ACK traffic.
  • Head-of-line blocking — one lost segment holds up everything queued behind it.
  • Not always easy to set up and monitor; the transport layer can be troublesome.
  • Hard to replace protocols within TCP/IP.

For a web app, mail server or SSH session, those costs barely register. For live voice or game state, UDP is usually the better choice.

🧩 Conclusion

TCP/IP is the backbone of the internet — a pair of protocols that make reliable communication possible across any distance. IP initiates communication between data series over the internet, and TCP adds connections, acknowledgments, ordering, and retransmission to guarantee complete delivery. Together they connect different computers, send large volumes of data, and control flow to keep the network free of congestion. You now know what TCP stands for, how it works, the three-way handshake, how it closes connections, the TCP header fields, the difference between TCP and UDP, and the 4 layers of the model — and that TCP itself doesn't encrypt anything, which is why TLS sits on top. To put these protocols to work on a reliable network, explore Linux VPS hosting from MonoVM — high-performance servers with full root access.

Category: Networking

Write Comment