Lesson 15: OSI Layer 4: The Transport Layer (Segmentation)
Layer 4 is the first layer focused on end-to-end communication and reliability. It is responsible for breaking down data and managing communication between specific applications.
Core Function: Segmentation and Reassembly
Large amounts of data from the upper layers cannot be sent as a single unit. The Transport Layer takes the data and segments it into smaller, manageable pieces (called Segments or Datagrams), which are easier to manage and retransmit if lost.
Key Functions:
- Segmentation: Breaking data into segments for transmission.
- Reassembly: Putting the segments back together in the correct order at the receiving end.
- Service Addressing (Port Numbers): Using port numbers to ensure that the received data is delivered to the correct application running on the host (e.g., web traffic goes to port 80/443, email goes to port 25).
- Connection Management: Deciding whether to use connection-oriented (reliable) or connectionless (unreliable) communication.
The Two Main Transport Protocols:
- TCP (Transmission Control Protocol) - Connection-oriented, reliable.
- UDP (User Datagram Protocol) - Connectionless, fast, unreliable.
Analogy: The Transport Layer is responsible for packaging a large book into numbered, small envelopes (segments) and ensuring that the mailman knows which specific recipient's apartment door (port number) the delivery must go to.