>_
EngineeringNotes
Back to Computer Networks
Module 05 • Transport Layer

Transport Layer

The 4th layer of the OSI model, ensuring reliable end-to-end communication between applications.

01

Overview & Functions

The Transport Layer works between the Application Layer and the Network Layer. Its main job is to provide end-to-end communication between applications running on different devices.

When you open a website, send an email, watch YouTube, or use WhatsApp, the transport layer ensures the data reaches the correct application properly.

End-to-End

From the source application directly to the destination application.

Functions of the Transport Layer

1. Process-to-Process Delivery

Delivers data from one application/process to another (e.g., Browser → Web server).

2. Segmentation & Reassembly

Large data is divided into smaller segments and reconstructed at the receiver side.

3. Port Addressing

Uses port numbers (HTTP: 80, HTTPS: 443, DNS: 53) to identify which application should receive the data.

4. Flow Control

Controls the speed of data transmission so that the sender does not overwhelm the receiver.

5. Error Control

Checks for lost, duplicate, or damaged packets and corrects them if needed.

6. Multiplexing

Combines data from many applications before transmission and demultiplexes upon receipt.

02

TCP (Transmission Control Protocol)

Connection-Oriented & Reliable

TCP is a secure transport protocol that guarantees delivery, correct order, and error checking. It establishes a connection before communication starts using the Three-Way Handshake.

Client
1. SYN
2. SYN + ACK
3. ACK
Server

Features of TCP

  • Reliable Communication Ensures no packet loss and retransmits if packets are lost.
  • Ordered Delivery Packets arrive in the exact order they were sent.
  • Error Checking Uses checksum to detect and recover from errors.
  • Flow & Congestion Control Uses Sliding Window Protocol to control data amount and reduces traffic on congestion.

TCP Segment Header (32-Bit Grid Diagram)

TCP headers are relatively heavy, requiring 20 to 60 bytes depending on options. Click on any field block in the 32-bit memory row layout below to explore its specific function:

0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15
16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31
💡 Click on any field in the 32-bit TCP header grid diagram above to explore its operation and network use.
Advantages
  • Reliable and accurate delivery
  • Ordered transmission
  • Error recovery
Disadvantages
  • Slower transmission speed
  • More overhead
  • Requires connection setup time

Applications of TCP

Used where reliability is crucial:

WebHTTP/HTTPS
EmailSMTP/IMAP
FilesFTP
BankingSecure Tx
03

UDP (User Datagram Protocol)

Connectionless & Fast

UDP sends data without establishing a connection. It is faster and lightweight, but it is unreliable because it does not guarantee delivery, order, or error recovery.

Features of UDP

  • Connectionless No handshake process; data is directly sent.
  • Faster Transmission Less overhead means higher speed.
  • No Reliability Does not guarantee delivery, and does not retransmit lost packets.
  • Low Latency Best suited for real-time communication.

UDP Datagram Header (32-Bit Grid Diagram)

UDP headers are extremely lightweight, requiring only 8 bytes total. Click on any field block in the 32-bit memory row layout below to explore its specific function:

0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15
16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31
💡 Click on any field in the 32-bit UDP header grid diagram above to explore its operation and network use.
Advantages
  • Very fast transmission
  • Low overhead
  • Suitable for real-time systems
Disadvantages
  • Unreliable (no acknowledgment)
  • No packet ordering
  • Possible packet loss

Applications of UDP

Used where speed matters more than absolute reliability:

VideoStreaming
GamingLow Latency
VoIPReal-time
DNSFast Query
04

Difference Between TCP and UDP

FeatureTCPUDP
ConnectionConnection-orientedConnectionless
ReliabilityReliableUnreliable
SpeedSlowerFaster
Error RecoveryYesNo
Packet OrderingMaintainedNot maintained
OverheadHighLow
AcknowledgmentRequiredNot required
ApplicationsWeb, Email, FTPGaming, Streaming, DNS
05

Simple Real-Life Analogy

Registered Courier Service

= TCP
  • Delivery confirmation
  • Safe and reliable
  • Ordered processing

Normal Broadcasting

= UDP
  • Fast transmission
  • No confirmation
  • Some data may be lost