TCP vs UDP Connection Differences | Generated by AI

Home 2025.11

You’ve got the right intuition! Let me clarify the key differences:

TCP Connection

When a TCP connection is established (via the 3-way handshake), both sides maintain state information about each other:

What each side stores:

So yes, “connected” means both client and server have allocated memory and resources to track this specific conversation. They know about each other and maintain this relationship until the connection is closed.

UDP - No Connection

UDP is connectionless. There’s no handshake, no stored state:

The Key Difference

TCP: “Hello, I’m Client X. Let’s talk. Here’s my info, I have yours. We’re now connected.” → Stateful

UDP: “Here’s a packet for address Y:port Z” → Fire and forget → Stateless

You’re absolutely right that UDP is much more lightweight because there’s no connection state to maintain, no buffers to manage, and no acknowledgments to track. The tradeoff is that TCP provides reliability, ordering, and flow control, while UDP provides speed and simplicity.


Back

anthropic/claude-4.5-sonnet

Donate