What's the Role of the Transport Layer?
The transport layer, told as a story about handing an envelope — once it reaches the right town — to the right counter, and choosing registered or plain mail.
The envelope reached the right town, but doesn't know which counter to go to.The same town has separate counters for web, for mail, and more.
You have to choose between certainty (registered) and speed (plain).You can't have both certainty and speed at once.
The transport layer = splitting by counter number and choosing registered vs plain.The transport layer hands the envelope to the right counter, the right way, once it's in the right town.
The transport layer handles port separation, reliability choice, segmentation, and flow and congestion control.The sender slows down when the receiver or the road can't keep up.
The transport layer doesn't decide the route itself.The actual route is decided one layer below, by the network layer.
The transport layer = the stage that splits envelopes arriving in town by counter number (port) and chooses between registered (TCP) and plain (UDP) mail.
The transport layer (OSI Layer 4) distinguishes multiple services on the same host by port number, exchanges data via either TCP (connection-oriented, reliable) or UDP (connectionless, fast), and, with TCP, also splits data into segments and regulates the sending rate through flow and congestion control. Its role is distinct from the network layer, which decides the destination address.
When grown-ups say it
- Port Number
- Which counter inside the town. Distinguishes services at the same address.
- TCP
- The registered envelope, with delivery confirmed. Connection-oriented and highly reliable.
- UDP
- The plain envelope, sent fast with no confirmation. Connectionless and fast, but envelopes can get lost.
- Segment
- The unit of data split at the transport layer. Similar to a packet, but this layer's own name for it.
- Flow/Congestion Control
- Slowing the sending rate to match the other side. One reason registered mail (TCP) can slow down.
- L4 Switch
- The sorter who splits by counter, reading the port too. A device that actually uses this layer's information. → the sorter who checks the port
- Network Layer (Subnetting)
- One layer below, deciding the town (address). The transport layer operates on top of this one. → splitting the town into smaller zip-code zones
- Network IPC
- The dedicated mailbox that picks its target by port. A direct example of using this layer's port concept. → the dedicated mailbox between processes