Transport Layer·Lesson 1 of 9
Transport Layer
What the Transport Layer Does
When you send a message on a chat app, the data has to leave the chat app on your phone and arrive at the chat app on your friend's phone — not their email, not their browser, but that one specific program. The transport layer is the part of networking responsible for this application-to-application delivery. It's the go-between that takes data from a program on one computer and gets it to the right program on another.
The one big idea
The layer below the transport layer can get data to the right computer. The transport layer's job is to get it to the right program on that computer — and, if you use TCP, to make sure it all arrives complete and in order.
Networking is usually pictured as a stack of , each handling one part of the journey and handing data to the layer below it. It helps to see where the transport layer sits: just below the apps you actually use, and just above the layer that carries data across the internet.
Where the transport layer sits
Application
The programs you use and their rules
Transport
Delivers data to the right program (this layer)
Network
Carries packets between computers across networks
Link
Sends raw bits over the cable or airwaves
A delivery to the right desk
Imagine a courier delivering a parcel to a large office building. Getting it to the building's street address is one job — that's the layer below. Getting it from the lobby to the exact person at the right desk, in one piece and with the pages in order, is a different job. That final, precise handoff is what the transport layer does for your data.
The Problem It Solves
The layer just below is the , which uses to move packets from one computer to another. But it only delivers to the machine, and it makes no promises — packets can be lost, arrive out of order, or get duplicated along the way. That's called best-effort delivery. The transport layer fills both gaps: it steers data to the correct program, and (with TCP) it turns that shaky best-effort service into delivery an app can trust.
The Two Main Protocols: TCP and UDP
The transport layer offers two ways to send data, and picking between them is one of the most common decisions in networking. is careful and reliable; is fast and simple. Neither is 'better' — they suit different needs.
TCP
Sets up a connection, then guarantees every byte arrives in order and without errors. Used by the web, email, and file transfers — anywhere correctness matters.
UDP
Sends data with no setup and no guarantees. Used by live video, voice calls, and gaming — where speed matters more than a perfect copy.
Here's the quick contrast that captures why you'd choose one over the other:
| TCP | UDP | |
|---|---|---|
| Connection | Set up first | None — just send |
| Reliability | Guaranteed delivery | Best-effort |
| Ordering | Keeps data in order | No ordering |
| Speed | Slower, more overhead | Faster, lightweight |
| Good for | Web, email, downloads | Live video, calls, gaming |
The Services It Provides
Underneath TCP and UDP, the transport layer offers a set of core services. Each one is a section of its own in this topic — this list is your map of what's coming:
What the transport layer handles
- Process-to-process delivery — getting data to the right program using port numbers.
- Multiplexing and demultiplexing — letting many programs share one network connection.
- Segmentation and reassembly — breaking big data into small pieces and rebuilding it.
- Reliable data transfer — detecting loss and resending, so data arrives intact (TCP).
- Flow control — stopping a fast sender from swamping a slow receiver.
- Congestion control — easing off so the shared network doesn't get overloaded.
Why It Matters
Almost everything you do online rests on the transport layer. Loading a web page, streaming a film, or joining a video call all depend on it to route data to the right app and, when needed, guarantee it arrives correctly. It's also a favourite interview area, because understanding it means understanding the difference between reaching a machine and reaching a program — and the trade-off between reliable TCP and speedy UDP.
“"The transport layer is what physically sends data across the cables."”
Q:What is the key difference between the network layer and the transport layer?
A: The network layer delivers data host-to-host — it gets a packet to the right computer using its IP address. The transport layer delivers data process-to-process — it gets that data to the right program on the computer using port numbers, and with TCP it also guarantees the data is complete and in order. In short: the network layer finds the machine, the transport layer finds the program.
Quick Revision Cheat Sheet
Transport layer: Delivers data program-to-program between two computers
Sits between: The application layer above and the network (IP) layer below
TCP: Reliable, ordered, connection-based — web, email, files
UDP: Fast, connectionless, best-effort — live media, gaming
Core services: Ports, mux/demux, segmentation, reliability, flow & congestion control