Why UDP Is the Wild West of Internet Protocols and How TCP Tames It
This article compares UDP and TCP by using vivid analogies, explaining UDP's connectionless, fast but unreliable nature and TCP's reliable, connection‑oriented handshake and termination processes, while highlighting their respective advantages, drawbacks, and typical real‑time application scenarios.
Preface
In the world of the Internet, UDP is like a reckless swordsman cutting through data streams without caring about packet loss, while TCP behaves like a courteous gentleman who establishes a three‑handshake connection and ensures reliable transmission, together forming the communication philosophy of the digital realm.
Wildman: UDP Protocol
UDP sends data directly to the known IP address without any prior handshake, acting as a pure data‑packet courier.
Connectionless
Connectionless (knowing the peer IP, send data directly)
Just a Data Courier
Just moves data packets without adding extra header (only 8 bytes overhead)
No Order or Reliability
No guarantee of packet order No guarantee of reliability (packet loss)
No Congestion Control
Because UDP lacks congestion control, its transmission rate stays constant regardless of network conditions, which can lead to packet loss.
Efficiency
Without congestion control, UDP can maintain a steady speed even on poor networks, making it efficient for certain use cases.
UDP Summary
Connectionless (send data once the IP is known) Data courier with minimal header (8 bytes overhead) No guarantee of packet order No guarantee of reliability (packet loss) No congestion control Efficient (the first five points contribute to efficiency)
Typical scenarios: live streaming, video, games, real‑time applications
Gentleman: TCP Protocol
TCP establishes a reliable connection through a three‑handshake process and ends it with a four‑way termination, ensuring ordered and dependable data delivery.
Header Contains More Information
TCP adds several fields to the packet header:
Sequence Number
Acknowledgment Number
Window Size (how many bytes the network can currently handle)
Flags
TCP Flags
URG – urgent packet
ACK – acknowledgment (packet is valid)
PSH – push data to the application layer immediately
SYN – establish connection
RST – reset / need reconnection
FIN – close connection
TCP Three‑Way Handshake
Client sends SYN, enters SYN‑SEND state. Server replies SYN+ACK, enters SYN‑RECEIVED state. Client replies ACK, both enter ESTABLISHED state.
Why Three Handshakes?
If the initial SYN is lost, the client retransmits it; the extra step prevents half‑open connections and resource waste.
TCP Four‑Way Termination
Client sends FIN, enters FIN‑WAIT‑1. Server replies ACK, enters CLOSE‑WAIT. Server sends its FIN, enters LAST‑ACK. Client replies ACK, enters TIME‑WAIT then CLOSED; server also moves to CLOSED.
TCP Summary
Reliable, connection‑oriented. Slow start and congestion control (adjusts sending rate based on network conditions). Ordered delivery via sequence numbers.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
