TCP UDP and ports
Transport connects application endpoints
IP handles addressing and delivery of packets; transport protocols help applications exchange data. A port is a numeric transport identifier, not a physical socket on a device. TCP and UDP each use 16-bit port numbers. An operating-system socket is a communication endpoint that a program can use. A listening service accepts or receives traffic at an endpoint, subject to the operating system and network policy.
TCP and UDP solve different problems
TCP provides a connection-oriented, ordered byte stream with mechanisms to recover from loss. A connection normally begins with a handshake. TCP does not preserve application message boundaries, encrypt data by itself, or promise that an application will complete a request. UDP carries separate datagrams and does not itself guarantee delivery, ordering or duplicate suppression. Applications can add their own reliability or security; QUIC is an example of a protocol built over UDP.
Read a synthetic connection record
A fictional record contains source 192.0.2.10:51000, destination 198.51.100.20:443, protocol TCP and state established. The two addresses, two ports and protocol form the five-tuple used to describe this flow. Port 443 is commonly associated with HTTPS, but the record alone does not establish that TLS was used or that any HTTP request succeeded. The source port is just part of the endpoint description.
Transport evidence has limits
A timeout may reflect filtering, congestion or a failed service; it is not enough to distinguish the cause. A TCP connection can be established while the application rejects the user. HTTPS ordinarily means HTTP protected by TLS; it protects the connection under its trust assumptions, but does not guarantee the application is safe. A firewall rule must distinguish TCP from UDP when protocol matters.
Apply the distinction
Compare a UDP record to destination port 443 with the TCP record above. They describe different transport flows, even if addresses and port numbers match. Do not infer a successful login from either. Next, see how a client learns its configuration and the destination address.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
TCP UDP and ports — Knowledge check
Interpret fictional networking evidence and security boundaries.
What does TCP deliver to an application?
What is not guaranteed by UDP itself?
What distinguishes two otherwise identical flows using TCP and UDP?
A TCP connection to port 443 is established. What can you conclude?
A connection times out. What is the next sound inference?