Connection-Oriented vs Connectionless Communication
You'll learn the fundamental architectural difference between TCP's connection-oriented model and UDP's connectionless approach.
Two Ways to Communicate
Computer networks support two distinct communication paradigms that reflect different trade-offs between reliability and simplicity.
Connection-Oriented Communication (TCP)
TCP establishes a dedicated logical connection before any data flows. Think of it like making a phone call: you dial, wait for the other person to answer, confirm they can hear you (the three-way handshake), and only then begin your conversation. Throughout the call, you maintain this connection, ensuring every word is heard and acknowledged. When finished, you say goodbye and hang up (connection termination).
Key characteristics:
- Setup phase required (overhead)
- State maintained at both endpoints
- Reliable, ordered delivery guaranteed
- Full-duplex communication channel
- Connection must be explicitly closed
Connectionless Communication (UDP)
UDP sends data without establishing a connection first. This is like dropping postcards in a mailbox: you write your message, address it, and send it off immediately—no setup, no confirmation it arrived, no guaranteed order. Each datagram is independent and self-contained.
Key characteristics:
- No setup overhead—just send
- No connection state tracked
- No delivery guarantees
- No ordering promises
- Each datagram handled independently
The Trade-Off
Connection-oriented protocols trade efficiency for reliability: the handshake, state tracking, and acknowledgments add overhead but ensure data arrives intact. Connectionless protocols trade reliability for efficiency: minimal overhead and latency, but your application must handle any losses or reordering itself.
Key Takeaway: TCP uses connection-oriented communication with state and guarantees; UDP uses connectionless communication with no setup and no delivery promises—choose based on whether your application needs reliability or raw speed.