Network+ (N10-009) · ELI Explains Networking Layers (book)
Layer 4 — Transport
On this page 3 sections
The college version
What This Layer Does
A packet arriving at your laptop has reached the right device. It has not reached the right program. At any moment your machine may be running a browser, a music app, a video call, and a background update, all using the network at once. Something has to sort the arriving data between them.
That is the first job of the Transport layer, and it is done with port numbers. A Port number a number identifying one network conversation on a device, identifies one specific network conversation on a device. Data leaves with a source port and a destination port, and the receiving system uses the destination port to decide which program gets it. Web servers listen on port 443 for encrypted traffic and port 80 for unencrypted traffic; a browser opens a temporary high-numbered port for its own side.
The second job is deciding how carefully to deliver. This is where the layer offers a real choice, and the choice is between two protocols.
TCP a connection-based protocol that checks delivery, resends lost data, — the Transmission Control Protocol — is the careful one. Before sending anything it establishes a connection with the other side. It numbers the data it sends, waits for the receiver to acknowledge what arrived, resends anything that went missing, and restores the original order before handing the data up. If delivery fails, TCP reports it rather than pretending. Its unit is a Segment the unit of data TCP works with..
UDP a protocol that sends data without those checks, trading reliability — the User Datagram the unit of data UDP works with. Protocol — is the fast one. It sends data without setting up a connection first, and it does not number, acknowledge, resend, or reorder anything. If something is lost, UDP neither knows nor cares. Its unit is a datagram.
UDP is not a worse TCP. It is a different trade. TCP's checking costs time, and in a live call a chunk of audio that arrives late is worthless anyway — better a momentary glitch than a conversation falling further behind every second. Applications that value timing over completeness choose UDP and handle the gaps themselves.
Common Examples
- TCP, used by web browsing, email, and file transfer
- UDP, used by many live video and voice calls and by most DNS lookups
- Port 443, used by HTTPS
- Port 53, used by DNS
- Temporary high-numbered ports, opened by client programs for their side of a conversation
Port numbers run from 0 to 65535. The lowest range is reserved for well-known services, the middle range is registered for particular applications, and the highest is left free for temporary use. IANA maintains the registry, and it is not worth memorizing.
Simple Real-World Example
You open two browser tabs: one loading a news site, one playing a video from a different site. Both arrive at your laptop over the same connection, with the same IP address on the outside.
Your laptop keeps them apart because each conversation uses a different source port number. Data for port 51314 goes to the first tab's connection; data for port 51315 goes to the second. Without port numbers, your machine could not tell the two streams apart.
MAC address → which device on the local network
IP address → which network, and which device on it
Port number → which conversation on that device
Building analogy:
street address = IP address
name on the door = MAC address
room number = port numberWhat Can Go Wrong?
- The port is blocked. A firewall between the two devices allows the packets through at Layer 3 and drops them at Layer 4, so the connection simply times out.
- Nothing is listening on the port. The data arrives at the right device and no program is waiting for it, so the connection is refused.
- The wrong port is configured. The application is running and reachable and still fails, because the client is knocking on a different door.
- UDP data is lost silently. Nothing reports an error, because reporting errors was never UDP's job. The symptom is a stuttering call, not a message.
Remember This
Layer 4 uses TCP or UDP and port numbers to deliver data to the correct application.

Eli explains
The same idea, in plain words
Explain it like I’m 10
Imagine sending a letter to a school.
The street address gets your letter to the right building. But a school has dozens of classrooms, and the letter is meant for one of them. So you also write a room number on the envelope. The front office reads that number and walks the letter to the correct room.
The street address is the IP address. The room number is the port number. Your computer runs many programs at once, and the port number is how it knows which one a message belongs to.
Now the second part: you choose how the letter is sent.
TCP is like sending a package that needs a signature. The other person confirms they got it. If a box goes missing, you send another. If boxes arrive out of order, they are put back in order before anyone opens them. Slower, and nothing is lost.
UDP is like tossing balls to a friend across the yard, one after another, without stopping to check each catch. Quick. If your friend misses one, you both keep going.
Why have both? Downloading a file needs every piece, so it uses TCP. A live video call has to keep up with real time, so it usually uses UDP — a lost moment of sound beats a call that drifts further behind.
TCP UDP
────────────────────────── ──────────────────────────
Sets up a connection first Just sends
Confirms what arrived No confirmation
Resends what was lost Never resends
Puts data back in order No ordering
Slower, complete Faster, may have gaps
Web pages, email, files Live voice and video, DNSStudy tools & related lessonsKey vocabulary · Related
Key vocabulary
- Port number
- a number identifying one network conversation on a device,
- TCP
- a connection-based protocol that checks delivery, resends lost data,
- UDP
- a protocol that sends data without those checks, trading reliability
- Segment
- the unit of data TCP works with.
- Datagram
- the unit of data UDP works with.
Educational content only. It is not medical, legal or professional advice. Found an error? Tell us.
