Lesson
Lesson 21: TCP, UDP and ports
Learning goal
After this lesson, you can identify a transport endpoint by address, protocol and port and compare TCP and UDP within the stated use case.
Why this concept matters
Port 53 or 443 without protocol and context is not a complete endpoint. TCP and UDP offer different contracts that an application must choose deliberately.
Address, port and protocol together identify a communication endpoint.
192.0.2.10:51544198.51.100.20:443Local porttemporary client-side endpoint
Define the communication endpoint
- Write source and destination addresses.
- Name TCP or UDP.
- Identify local and remote ports.
- Interpret transport success, then test the application separately.
Address for host, port for application
A transport port names a logical endpoint within TCP or UDP. The protocol must be stated with the number because the port spaces are distinct.
Compare stream and datagram
State TCP or UDP with the port and interpret success only at the tested layer.
| Property | TCP | UDP |
|---|---|---|
| Data model | Byte stream | Independent datagrams |
| Ordering and retransmission | Mechanisms in the contract | Not guaranteed by default |
| Message boundaries | Not preserved | Preserved per datagram |
| Selection | Driven by application needs | Driven by application needs |
The choice is not fast versus slow
A transport endpoint combines address, protocol and port; its success is not application success. The page records no production measurement or learner execution.
Diagnostic exercise
Takeaway and the next lesson
A transport endpoint combines address, protocol and port; its success is not application success.
Quick review
- Do TCP and UDP share one port space?
- Does TCP preserve message boundaries?
- What does an open port prove?
Show the explained answers
- No.
- No; it is a byte stream.
- Only a transport response in the tested context.

