Networking: TCP (Transmission Control Protocol)
What It Is
TCP is a connection-oriented transport-layer protocol that guarantees reliable, ordered delivery of data between two devices. Unlike UDP, TCP establishes a formal connection before any data is exchanged, tracks every segment sent with sequence numbers, and automatically retransmits anything that gets lost or arrives out of order. Its header is a minimum of 20 bytes — noticeably larger than UDP's fixed 8-byte header (see Networking: UDP) — because it has to carry all the extra bookkeeping (sequence numbers, acknowledgment numbers, window size, control flags) that makes reliability possible.
The Three-Way Handshake
Before exchanging data, TCP establishes a connection using a three-step process:
- SYN — the initiating device sends a "synchronize" segment containing an initial sequence number.
- SYN-ACK — the receiving device replies with its own synchronize segment plus an acknowledgment of the first device's sequence number.
- ACK — the initiating device acknowledges the second device's sequence number, completing the handshake.
Only after this exchange completes does actual data transmission begin, ensuring both sides agree on initial sequence numbers and are ready to communicate. This handshake happens once per connection, not once per message — after it completes, the same connection can carry many messages/segments back and forth until it's explicitly closed.

How Reliability Actually Works
Once connected, TCP keeps its "reliable, ordered" promise through a few mechanisms working together:
- Sequence numbers and acknowledgments (ACKs) — every byte sent is numbered, and the receiver acknowledges what it has successfully received; a missing acknowledgment after a timeout tells the sender to retransmit that data, and out-of-order segments are re-assembled into the correct order using their sequence numbers before being handed to the application.
- Flow control (the sliding window) — the receiver advertises, in each ACK, how much more data it's currently able to accept ("window size"), preventing a fast sender from overwhelming a slower receiver's buffer.
- Congestion control — separately from flow control, TCP paces how fast it sends based on inferred network congestion (not just the receiver's buffer capacity), starting conservatively and increasing its sending rate as long as segments keep arriving successfully, and backing off sharply when loss suggests the network path is congested.
Connection Termination: the Four-Way Close
Just as opening a TCP connection is a defined handshake, so is closing one — a four-way close: each side independently sends a FIN ("I'm done sending") and receives an ACK for it, so either side can finish sending while still being able to receive from the other side until it, too, sends its own FIN. This explicit close is exactly what UDP lacks (see Networking: UDP) — it's why a firewall or NAT device can definitively know when a TCP conversation has ended, versus having to guess based on an idle timeout the way it must for UDP.
Common Misunderstandings
- "TCP guarantees fast delivery" — it guarantees eventual, correct-order delivery, not speed; retransmission and flow/congestion control can all add latency, which is exactly why TCP is the wrong choice for latency-sensitive live media (see below).
- "The handshake repeats for every request" — no; a single TCP connection, once established, is normally reused for many segments/messages until explicitly closed (or it times out). Application protocols built on top of TCP commonly include their own "keep-alive"/connection-reuse behavior specifically to avoid paying the handshake cost repeatedly for every request.
- "A TCP connection failing to close cleanly is always a problem" — an abrupt disconnection (cable pulled, device power lost) skips the four-way close, and the other end eventually notices via its own timeout logic rather than an explicit signal; this is a normal, expected failure mode, not evidence of a protocol malfunction.
Why This Matters for Radio-over-IP
Because TCP guarantees delivery and correct ordering, it's the right choice for signaling and control traffic — such as SIP session setup or configuration/management traffic to gateways and consoles — where losing or misordering a message could break a call setup entirely.
Troubleshooting Implications
- Firewalls track TCP connection state explicitly (SYN seen, established, FIN seen) in a way they can't for UDP, which is why a stateful firewall's TCP rules can be more precise about "only allow return traffic for connections we actually opened" — see Firewall Types: Stateful vs. Stateless.
- Duplicate ACKs and retransmissions in a packet capture are a direct sign of packet loss somewhere on the path — Wireshark flags these explicitly, making a capture a fast way to confirm "is data actually being lost" rather than guessing from application-level symptoms alone; see Wireshark and Packet Capture.
- A shrinking TCP window / stalled throughput despite a healthy-looking link can point at a slow or overloaded receiver (flow control) rather than the network path itself (congestion control) — worth distinguishing before chasing a network-side fix for what's actually an endpoint performance problem.
- "Connects but immediately drops" or "hangs on connect" often means the three-way handshake completes (proving the TCP port itself is reachable) but something at the application layer above it — credentials, version mismatch, an unexpected protocol — fails right after; see Troubleshooting RoIP and Gateway Connectivity for the layered approach to isolating where in the stack a connectivity problem actually lives.
Related Pages
- Networking: UDP
- Firewall Types: Stateful vs. Stateless
- Wireshark and Packet Capture
- Troubleshooting RoIP and Gateway Connectivity
- IP Networking in Two-Way Radio Systems
References
This article is part of the CTI Products Knowledge Base. Questions about RadioPro or MCN products? Call +1 (513) 595-5900 or email info@ctiproducts.com.
Informational only. This article is general background and is not engineering, safety, legal or regulatory advice. Verify requirements with the equipment manufacturer and the applicable authority before relying on it. Product names and trademarks belong to their respective owners.