Transport Layer



 Introduction to Transport Layer (Layer 4)

The Transport Layer is the 4th layer of the OSI Model.
Its main job is to ensure end-to-end (process-to-process) communication between applications running on different devices.

In simple words

The Transport Layer ensures that data sent by one application reaches the correct application on another computer, correctly and efficiently.

Process-to-Process Delivery

What does it mean?

  • Network Layer delivers data from computer to computer
  • Transport Layer delivers data from application to application

Real-Life Example

Sending a letter:

  • City → Network Layer
  • House number & person name → Transport Layer

How is this achieved?

Using:

  1. Port Numbers
  2. Socket Addresses

Port Addressing

A Port Number identifies a specific application running on a computer.

Example

ApplicationPort Number
HTTP (Web)80
HTTPS443
FTP21
SMTP (Email)25
DNS53

Real-Life Example

  • Building = Computer IP Address
  • Room number = Port Number
  • Person inside room = Application

Socket Addressing

A Socket = IP Address + Port Number

Example

192.168.1.10 : 80

This uniquely identifies:

  • Which computer?
  • Which application on that computer?

Reliable and Unreliable Connections

Reliable Connection

  • Data arrives correctly
  • Lost data is retransmitted
  • Order is maintained

Unreliable Connection

  • No guarantee of delivery
  • No retransmission
  • Faster but risky

Transport Layer Protocols

The main protocols are:

  1. UDP
  2. TCP
  3. SCTP

User Datagram Protocol (UDP)

Nature

  • Unreliable
  • Connectionless
  • Fast

Real-Life Example

WhatsApp voice call:

  • Speed is important
  • Small loss is acceptable

UDP Packet Format

FieldSize
Source Port16 bits
Destination Port16 bits
Length16 bits
Checksum16 bits

Features of UDP

  • No acknowledgements
  • No flow control
  • No congestion control

Uses

  • Video streaming
  • Online gaming
  • Voice calls (VoIP)

Transmission Control Protocol (TCP)

Nature

  • Reliable
  • Connection-oriented
  • Slower but safe

Real-Life Example

Online banking:

  • Data must be accurate
  • No loss is acceptable

TCP Packet Format (Simplified)

FieldPurpose
Source PortSender application
Destination PortReceiver application
Sequence NumberOrder of data
Acknowledgment NumberConfirms received data
Flags (ACK, SYN, FIN)Control
Window SizeFlow control
ChecksumError detection

TCP 3-Way Handshake

  • SYN – Request to connect
  • SYN-ACK – Connection accepted
  • ACK – Connection established

Uses

  • Web browsing (HTTP/HTTPS)
  • Email
  • File transfer

Stream Control Transmission Protocol (SCTP)

Nature

  • Reliable
  • Message-oriented
  • Supports multi-streaming

Real-Life Example

Video conference:

  • Chat, audio, and video sent separately
  • One stream failure doesn’t stop others

Key Features

  • Multiple streams in one connection
  • Better than TCP for multimedia
  • Used in telecom signaling (4G/5G)

Comparison Table: TCP vs UDP vs SCTP

FeatureTCPUDPSCTP
ConnectionYesNoYes
ReliabilityHighNoHigh
SpeedMediumFastMedium
Error ControlYesLimitedYes
Flow ControlYesNoYes
Use CaseWeb, EmailStreaming, GamesTelecom, Multimedia

Summary (Exam-Friendly)

  • Transport Layer ensures process-to-process delivery
  • Uses port and socket addressing
  • TCP → Reliable, safe, slower
  • UDP → Fast, unreliable
  • SCTP → Advanced, multi-stream, telecom-friendly

Congestion Control

What is Congestion?

Congestion occurs when:

The amount of data sent into the network is more than the network can handle.

Real-Life Example

A busy road during peak hours:

  • Too many vehicles
  • Slow movement
  • Accidents and delays

Similarly, in a network:

  • Too many packets
  • Delay, packet loss, retransmissions

Causes of Congestion

CauseExplanation
High trafficToo many users sending data
Limited bandwidthNetwork capacity is low
Slow routersProcessing delay
Packet retransmissionLost packets resent again
Buffer overflowRouter memory full

Effects of Congestion

  • Increased delay
  • Packet loss
  • Reduced throughput
  • Network collapse (worst case)

Congestion Control vs Flow Control

AspectCongestion ControlFlow Control
ConcernNetwork capacityReceiver capacity
ControlsToo much trafficSender speed
ExampleTraffic jamSmall bucket filling

Techniques for Congestion Control

A. Open Loop Congestion Control (Prevention)

These techniques prevent congestion before it happens.

1. Traffic Shaping

Controls the rate of data sent.

a) Leaky Bucket Algorithm

  • Data exits at fixed rate
  • Excess data discarded

Real Life: Water leaking from a bucket at constant speed

b) Token Bucket Algorithm

  • Tokens allow data transmission
  • More flexible than leaky bucket

2. Admission Control

  • New connection allowed only if resources are available

Example: Cinema hall allowing entry only if seats are available

Closed Loop Congestion Control (Cure)

These techniques detect and reduce congestion.

1. Backpressure

  • Router informs previous router to slow down

2. Choke Packet

  • Router sends warning message to sender

3. Implicit Signaling

  • Sender detects congestion by delay or packet loss

4. Explicit Signaling

  • Router explicitly informs congestion status

TCP Congestion Control Mechanisms

1. Slow Start

  • Start with small transmission
  • Gradually increase speed

2. Congestion Avoidance

  • Increase data rate slowly
  • Prevent congestion

3. Fast Retransmit

  • Resend lost packets quickly

4. Fast Recovery

  • Reduce transmission rate, not restart completely

Quality of Service (QoS)

What is Quality of Service?

QoS refers to:

The ability of a network to provide better service to selected traffic.

Real-Life Example: Emergency vehicles get priority on roads.

Flow Characteristics (QoS Parameters)

ParameterMeaning
BandwidthData transmission capacity
DelayTime taken for data to arrive
JitterVariation in delay
ReliabilityPacket loss rate

Why QoS is Required?

ApplicationQoS Need
Video callingLow delay & jitter
Online gamingFast response
EmailReliability
StreamingContinuous bandwidth

Techniques to Improve QoS

1. Scheduling Techniques

TechniqueExplanation
FIFOFirst packet served first
Priority SchedulingHigh priority first
Weighted Fair QueuingFair bandwidth distribution

2. Traffic Shaping

Controls data flow to avoid congestion.

3. Resource Reservation

  • Reserve bandwidth before transmission
  • Used in multimedia communication

4. Admission Control

Reject new flows if QoS cannot be guaranteed.

5. Differentiated Services (DiffServ)

  • Packets classified into priority classes
  • High priority gets better service

Congestion Control vs QoS

FeatureCongestion ControlQoS
GoalAvoid overloadEnsure service quality
FocusNetwork stabilityUser experience
TechniquesTCP control, shapingScheduling, reservation

Exam-Ready Summary

  • Congestion Control manages excess traffic
  • QoS ensures performance for critical applications
  • Open loop prevents congestion
  • Closed loop detects and corrects congestion
  • QoS parameters: bandwidth, delay, jitter, reliability