Skip to content
  • Layer 4 — Transport · Computer Networks

Layer 4 — Transport

LearnViaNotes @learnvianotes· 2 min read

The engine room, managing segment assembly, error correction, and application sockets.

PDU: Segment (TCP) / Datagram (UDP)

Focus: End-to-End Reliability

Hardware: OS Kernel / Sockets

Core Purpose & Function

While the Network Layer below routes packets to the correct *physical computer*, the Transport Layer is the one that gets the data to the correct *software process* on that computer. It acts as the supervisor of the connection, handling flow control, sequencing, and packet loss recovery.

Key Responsibilities

  • Port Addressing & Multiplexing: Attaching source and destination ports. This allows a laptop to run Slack, Zoom, and a browser simultaneously without their data streams mixing.

  • Segmentation & Reassembly: Dividing data into chunks size-optimized for the MTU (Maximum Transmission Unit) of the network, and re-assembling them in order at the destination.

  • Flow Control: Preventing a fast sender from overwhelming a slow receiver by negotiating window sizes.

  • Error Recovery & ACKs: Using checksums to spot corruption and retransmitting lost packets when timers expire.

TCP vs UDP — The Transport Split

FeatureTCP (Transmission Control Protocol)UDP (User Datagram Protocol)
ConnectionConnection-oriented (Requires 3-Way Handshake)Connectionless (Fire and Forget)
ReliabilityGuaranteed delivery (Retransmits lost segments)Best-effort delivery (No retransmission)
OrderingGuaranteed in-order reassemblyNo ordering guarantees
Header Size20 bytes minimum8 bytes fixed
Use CaseWeb browsing (HTTP), Email, File transfer (FTP)Voice calls (VoIP), Video streams, DNS

Analogy: The Shipment Box labeling and Tracking Numbers

Flow Control & Congestion Control

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report