Transport Layer in Computer Networks: Functions, Design Issues & Connection Management

COMPUTER NETWORKS • CHAPTER 29
Transport Layer in Computer Networks: Functions, Design Issues & Connection Management
Suppose you are using a browser, WhatsApp, email and a music app at the same time.

All these applications may use the network together. IP can take packets to the correct computer, but one more question remains:

Inside that computer, which application should receive the data?

This is where the Transport Layer becomes important.
Direct Answer

The Transport Layer is Layer 4 of the OSI model. It provides logical communication between application processes running on different end systems.

Its major functions include process-to-process delivery, port addressing, segmentation, reassembly, multiplexing, demultiplexing, connection management, flow control and error control.

The two most important Transport Layer protocols in the TCP/IP suite are TCP and UDP.

What Is the Transport Layer?

Transport Layer in Computer Networks: Functions, Design Issues & Connection Management

The Transport Layer provides communication between application processes running on different hosts.

The Network Layer may deliver a packet to the correct computer, but that computer can run many applications at the same time.

The Transport Layer makes sure the data reaches the correct application process.

Simple Definition: The Transport Layer provides end-to-end process communication between applications running on different computers.

Position of Transport Layer in the OSI Model

Application / Session / Presentation Side
TRANSPORT LAYER
Layer 4
Network Layer
Layer 3

The Transport Layer receives data from upper layers and uses Network Layer services to move that data between end systems.

Why Is the Transport Layer Needed?

Suppose a computer is running:

  • A web browser
  • An email application
  • A video call
  • A game

All of them may use the same IP address.

So IP address alone is not enough to identify the correct application.

The Transport Layer uses port numbers to identify application processes.

Remember: IP Address = Which host?
Port Number = Which application?

Process-to-Process Delivery

The Network Layer provides host-to-host delivery.

The Transport Layer goes one step further and provides process-to-process delivery.

Host A Browser Process
Port 51000
Transport Service
Process-to-Process
Host B Web Server
Port 443
Layer 3: Host-to-Host

Layer 4: Process-to-Process

Functions of the Transport Layer

1
Process-to-Process Delivery Delivers data between application processes.
2
Port Addressing Uses port numbers to identify applications.
3
Segmentation Divides application data into smaller transport units.
4
Reassembly Reconstructs the original data at the destination.
5
Multiplexing Allows many applications to share network communication.
6
Demultiplexing Delivers incoming data to the correct application.
7
Connection Management Establishes, maintains and releases connections when required.
8
Flow Control Prevents a fast sender from overwhelming a slower receiver.
9
Error Control Reliable protocols can detect loss and arrange retransmission.

Port Addressing

A port number identifies an application process.

Transport protocols use source and destination port numbers.

One Host — Different Application Doors
80 / 443 Web Services
25 SMTP
53 DNS
Dynamic Ports Client Applications

Port Number Range

TCP and UDP port numbers are 16 bits long.

Port Range = 0 to 65,535
Port Range Name General Use
0–1023 Well-Known Ports Common standard services
1024–49151 Registered Ports Registered applications and services
49152–65535 Dynamic / Private Ports Often used temporarily by client applications

Socket Address

A socket endpoint is commonly identified using an IP address and a port number.

IP Address
192.0.2.20
+
Port
443
Socket Endpoint = IP Address + Port Number

Segmentation

Applications may generate large amounts of data.

The Transport Layer can divide this data into smaller units before sending it to the Network Layer.

ORIGINAL APPLICATION DATA
Large Message
Segment 1 Data Part
Segment 2 Data Part
Segment 3 Data Part
Segment 4 Data Part
Segmentation: Large application message → smaller transport units

Reassembly

At the destination, the Transport Layer combines received data so the receiving application obtains the original information.

S1
S2
S3
S4
→
Original Application Data

Multiplexing

Many applications can send data through the Transport Layer at the same time.

The Transport Layer accepts data from multiple application processes and passes it toward the Network Layer.

Browser
Email
Game
Chat
Transport Layer Multiplexing
Network Layer
Multiplexing: Many application streams → Transport Layer → Network

Demultiplexing

At the receiver, Transport Layer information helps deliver incoming data to the correct application process.

Multiplexing: Many senders into transport.

Demultiplexing: Transport sends received data to the correct application.

Connection-Oriented Transport Service

A connection-oriented transport service establishes logical communication before normal data transfer begins.

TCP is the most important example.

Connection-Oriented

  • Connection setup first
  • Reliable delivery can be provided
  • Sequence numbers
  • Acknowledgements
  • Retransmission
  • Flow control
  • Order preservation

Connectionless

  • No connection setup
  • Each datagram sent independently
  • Lower protocol overhead
  • No built-in TCP-style reliability
  • No TCP-style ordered byte stream

Connectionless Transport Service

In a connectionless transport service, data can be sent without establishing a logical connection first.

UDP is the main example in the TCP/IP protocol suite.

TCP: Connect → Communicate → Close

UDP: Send without TCP connection setup

TCP vs UDP at the Transport Layer

TCP
  • Connection-oriented
  • Reliable byte stream
  • Sequencing
  • Acknowledgement
  • Retransmission
  • Flow control
  • Congestion control
UDP
  • Connectionless
  • Datagram-oriented
  • No connection setup
  • No TCP-style retransmission
  • No TCP-style ordering
  • Small header
  • Low protocol overhead

Transport Layer Design Issues

Designing a transport service is not only about moving data.

Several practical problems must be handled correctly.

Addressing How will the correct application process be identified?
Connection Establishment How do two endpoints start communication safely?
Connection Release How should communication end without losing important data?
Flow Control How can a fast sender avoid overwhelming a slow receiver?
Buffering Where should temporary data be stored?
Error Control How are lost or damaged units handled?
Multiplexing How can many applications share network service?
Crash Recovery What happens if one endpoint fails during communication?
Sequencing How is correct order maintained when reliable delivery is required?

1. Addressing as a Design Issue

The Transport Layer must identify the correct communicating application.

It does this using transport addresses such as port numbers.

A host can have one IP address but many application processes. Ports make process-level delivery possible.

2. Connection Establishment

When a connection-oriented protocol is used, both endpoints must agree that the connection exists before normal data transfer starts.

This prevents confusion caused by old duplicate packets and ensures both sides are ready.

Main Goal: Create a reliable logical connection between two transport endpoints before normal data transfer.

3. Connection Release

A connection should not simply disappear while data is still being transferred.

A proper release mechanism allows endpoints to finish communication in an orderly way.

Connection Lifecycle: Establish → Transfer → Release

4. Flow Control

Flow control prevents a fast sender from sending data faster than the receiver can process or buffer it.

Fast Sender
Sends quickly
Flow Control
Controls sending rate
Receiver
Processes at safe rate
Flow Control Trick: Protect the receiver.

5. Buffering

Transport protocols may temporarily store data in memory buffers.

Buffers are useful when:

  • Sender and receiver work at different speeds.
  • Segments arrive while an application is temporarily busy.
  • Reliable protocols need data for possible retransmission.
  • Out-of-order data must wait for missing data.
Too little buffering can reduce performance. Too much buffering can consume unnecessary memory and may increase delay.

6. Error Control

Reliable transport services need mechanisms to deal with data loss, duplication and ordering problems.

Sender transmits transport data.
Receiver detects what has arrived.
Acknowledgements provide delivery information.
Missing data can trigger retransmission.
Sequence information helps maintain correct order.
Reliable Transport: Sequence + ACK + Timer + Retransmission

7. Crash Recovery

A host may crash while a connection is active.

After recovery, one side may no longer remember the old connection state.

Transport protocols therefore need mechanisms such as sequence numbers, timers and connection-state management to reduce confusion caused by old or duplicate communication.

What Is Connection Management?

Connection management includes the procedures used to:

  1. Establish a transport connection.
  2. Maintain communication state.
  3. Transfer data.
  4. Terminate the connection safely.

TCP is the best example of connection-oriented transport management.

TCP Three-Way Handshake

TCP establishes a connection using a three-step handshake.

TCP Connection Establishment
CLIENT Wants Connection
SERVER Accepts Connection
Client
SYN
Server
Client
SYN + ACK
Server
Client
ACK
Server
Step 1 — SYN Client sends SYN to request a connection and synchronize sequence-number information.
Step 2 — SYN + ACK Server acknowledges the request and sends its own synchronization information.
Step 3 — ACK Client acknowledges the server's response.
Handshake Trick: SYN → SYN-ACK → ACK

Why Is Three-Way Handshake Needed?

The handshake confirms that communication works in both directions and that both endpoints are ready to begin the connection.

It also helps establish initial TCP sequence-number state.

After Connection Establishment

After the handshake is complete, TCP can begin normal data transfer.

During transfer, TCP can use:

  • Sequence numbers
  • Acknowledgements
  • Retransmission
  • Sliding-window flow control
  • Congestion-control mechanisms

TCP Connection Termination

TCP supports communication in both directions.

Therefore each direction is closed independently.

A common orderly termination uses four control exchanges.

1. FIN One side says it has finished sending.
2. ACK The other side acknowledges the FIN.
3. FIN The second side later closes its sending direction.
4. ACK Final acknowledgement completes the normal exchange.
TCP Close Trick: FIN → ACK → FIN → ACK

Important TCP Connection States

TCP uses states to remember the current condition of a connection.

CLOSED → SYN-SENT → ESTABLISHED → FIN-WAIT → TIME-WAIT → CLOSED

The exact state path depends on which side opens or closes the connection.

Why TIME-WAIT Exists

TIME-WAIT helps prevent delayed old segments from being confused with a later connection using the same endpoint information.

It also allows retransmission of the final acknowledgement if necessary.

Flow Control vs Congestion Control

Students often mix these two concepts.

Point Flow Control Congestion Control
Main Goal Protect receiver Protect network
Problem Sender too fast for receiver Too much traffic inside network
Main Focus Sender–receiver rate difference Network capacity and congestion
TCP Example Receive window Congestion window and congestion algorithms
Easy Trick: Flow Control → Receiver problem
Congestion Control → Network problem

Services Provided to Applications

Depending on the protocol, the Transport Layer can provide:

  • Connection-oriented communication
  • Connectionless communication
  • Reliable delivery
  • Ordered delivery
  • Port-based process identification
  • Segmentation and reassembly
  • Flow control
  • Error recovery

Quick TCP and UDP Header Difference

Feature TCP UDP
Minimum Header 20 bytes 8 bytes
Connection Connection-oriented Connectionless
Reliability Provides reliable transport mechanisms No built-in TCP-style reliability
Sequence Number Present Not present
Acknowledgement Supported No TCP-style ACK mechanism
Flow Control Yes No TCP-style flow control

Simple Transport Layer Numericals

Numerical 1: Maximum Number of Port Values

Port number field size:

Port Size = 16 bits
Number of Values = 2^16
= 65,536
Port Values = 0 to 65,535

Numerical 2: Number of Segments

Suppose:

Application Data = 5000 bytes
Maximum Data per TCP Segment = 1000 bytes
Number of Segments = 5000 / 1000
= 5
Answer = 5 segments

Numerical 3: TCP Header Overhead

Suppose:

Application Data = 1000 bytes
TCP Header = 20 bytes
TCP Segment Size = 1000 + 20
= 1020 bytes
Answer = 1020 bytes

Numerical 4: UDP Header Overhead

Suppose:

Application Data = 1000 bytes
UDP Header = 8 bytes
UDP Datagram = 1000 + 8
= 1008 bytes
Answer = 1008 bytes

Numerical 5: Sequence Range Example

If a simplified protocol uses a 4-bit sequence field:

Sequence Values = 2^4
= 16 values

Possible values:

0 to 15

Transport Layer Remember Tricks

Main Job: Transport = Process-to-Process Delivery
Addressing: IP = Host
Port = Process
Segmentation: Big Data → Small Pieces
Multiplexing: Many Apps → One Transport Service
Connection Lifecycle: Setup → Transfer → Close
TCP Setup: SYN → SYN-ACK → ACK
TCP Close: FIN → ACK → FIN → ACK
Flow vs Congestion: Flow protects receiver.
Congestion protects network.

Common Transport Layer Exam Mistakes

1. Transport Layer provides only host-to-host communication.

Not complete. Network Layer provides host-level delivery, while Transport Layer provides process-to-process communication.
2. IP address identifies the application process.

Wrong. A port number identifies the application process.
3. TCP and UDP are both connection-oriented.

Wrong. TCP is connection-oriented; UDP is connectionless.
4. UDP performs TCP-style retransmission.

Wrong. UDP does not provide TCP-style retransmission and reliability.
5. Segmentation and fragmentation are the same.

Wrong. Segmentation is a Transport Layer concept. IP fragmentation is a Network Layer concept.
6. TCP connection starts with ACK only.

Wrong. TCP normally starts using SYN → SYN-ACK → ACK.
7. Flow control and congestion control are identical.

Wrong. Flow control protects the receiver; congestion control handles network overload.
8. TCP connection termination is always one message.

Wrong. Normal full-duplex TCP termination commonly involves FIN and ACK exchanges in both directions.
9. Well-known ports begin at 49152.

Wrong. Well-known ports are 0–1023.
10. Port numbers are 32 bits.

Wrong. TCP and UDP port fields are 16 bits.
11. TCP minimum header is 8 bytes.

Wrong. TCP minimum header is 20 bytes. UDP header is 8 bytes.
12. Demultiplexing happens only at sender.

Wrong. Demultiplexing is mainly associated with directing received transport data to the correct application process.

40 Important Transport Layer Questions With Answers

1. What is the Transport Layer?
The Transport Layer is Layer 4 of the OSI model and provides process-to-process communication between application processes on different hosts.
2. What is the main function of the Transport Layer?
Its main function is end-to-end process communication.
3. Which OSI layer is the Transport Layer?
Layer 4.
4. What is process-to-process delivery?
It means delivering data from a specific application process on one host to the correct application process on another host.
5. What identifies a process at the Transport Layer?
A port number identifies a process or service endpoint.
6. What is the size of a TCP or UDP port number?
16 bits.
7. What is the complete port-number range?
0 to 65,535.
8. What are well-known ports?
Ports from 0 to 1023 are commonly called well-known ports and are associated with standard services.
9. What is segmentation?
Segmentation is the process of dividing larger application data into smaller transport units.
10. What is reassembly?
Reassembly reconstructs received transport data into the form required by the destination application.
11. What is multiplexing?
Multiplexing allows data from multiple application processes to share Transport Layer and lower-layer network services.
12. What is demultiplexing?
Demultiplexing directs received transport data to the correct destination application process.
13. Name two important Transport Layer protocols.
TCP and UDP.
14. What is TCP?
TCP is a reliable, connection-oriented transport protocol that provides ordered byte-stream communication.
15. What is UDP?
UDP is a connectionless transport protocol with low overhead and no TCP-style reliability or retransmission.
16. What is a socket endpoint?
A socket endpoint is commonly identified using an IP address together with a port number.
17. What is flow control?
Flow control prevents a fast sender from overwhelming a slower receiver.
18. What is error control?
Error control uses mechanisms such as sequence information, acknowledgements, timers and retransmission to support reliable delivery.
19. What is buffering?
Buffering temporarily stores transport data while it waits to be transmitted, processed, reordered or acknowledged.
20. What is connection management?
Connection management includes establishing, maintaining and releasing transport connections.
21. What is the TCP three-way handshake?
It is the TCP connection-establishment process using SYN, SYN-ACK and ACK messages.
22. What is the first step of the TCP handshake?
The client sends a SYN segment.
23. What is the second handshake message?
The server replies with SYN plus ACK.
24. What is the final step in connection establishment?
The client sends an ACK.
25. Why is connection establishment required?
It confirms both endpoints are ready and synchronizes connection state such as initial sequence-number information.
26. What does FIN mean in TCP?
FIN indicates that one endpoint has finished sending data in that direction.
27. What is a normal TCP close sequence?
A common orderly close uses FIN, ACK, FIN and ACK.
28. What is TIME-WAIT?
TIME-WAIT is a TCP state that helps prevent delayed old segments from interfering with a later connection and allows final acknowledgement retransmission if required.
29. What is the difference between flow control and congestion control?
Flow control protects the receiver from a fast sender, while congestion control protects the network from excessive traffic.
30. What is connection-oriented service?
It is a transport service in which a logical connection is established before normal communication begins.
31. What is connectionless service?
It allows data to be sent without first establishing a transport connection.
32. Which protocol is connection-oriented?
TCP.
33. Which protocol is connectionless?
UDP.
34. What is the minimum TCP header size?
20 bytes.
35. What is the UDP header size?
8 bytes.
36. If application data is 1000 bytes and TCP header is 20 bytes, what is the TCP segment size?
1000 + 20 = 1020 bytes.
37. If application data is 1000 bytes and UDP header is 8 bytes, what is the UDP datagram size?
1000 + 8 = 1008 bytes.
38. Why are sequence numbers useful?
They help reliable protocols detect missing, duplicate or out-of-order data and restore the correct delivery sequence.
39. Why are acknowledgements useful?
Acknowledgements tell the sender that data has been received and help support retransmission decisions.
40. Give the easiest Transport Layer memory line.
Transport Layer means process-to-process delivery using ports, segmentation, multiplexing and connection or reliability mechanisms when required.

20 Transport Layer MCQs With Answers

1. Transport Layer is OSI Layer:

A. 2
B. 3
C. 4
D. 7

Answer: C — Layer 4
2. Transport Layer provides:

A. Process-to-process delivery
B. Only electrical transmission
C. Only MAC addressing
D. Only routing

Answer: A
3. Which identifies an application process?

A. Port number
B. MAC vendor name
C. TTL
D. Subnet mask

Answer: A — Port number
4. Port numbers are:

A. 8 bits
B. 16 bits
C. 32 bits
D. 64 bits

Answer: B — 16 bits
5. Maximum port value is:

A. 255
B. 1024
C. 65535
D. 65536

Answer: C — 65535
6. TCP is:

A. Connection-oriented
B. Connectionless only
C. Physical Layer protocol
D. Routing protocol

Answer: A
7. UDP is:

A. Connectionless
B. Connection-oriented only
C. Network Layer protocol
D. Data Link protocol

Answer: A
8. TCP connection establishment uses:

A. Two-way handshake only
B. Three-way handshake
C. Five-way handshake
D. No handshake

Answer: B
9. First TCP handshake message is:

A. FIN
B. ACK
C. SYN
D. RST

Answer: C — SYN
10. Second TCP handshake message is:

A. SYN + ACK
B. FIN
C. ACK only
D. UDP

Answer: A
11. Segmentation means:

A. Breaking application data into smaller transport units
B. Breaking one IP packet due to MTU
C. Converting IPv4 to IPv6
D. Resolving IP to MAC

Answer: A
12. Flow control mainly protects:

A. Receiver
B. Domain name
C. Router table only
D. Physical cable

Answer: A
13. Congestion control mainly deals with:

A. Network overload
B. Receiver application name
C. MAC address format
D. HTML files

Answer: A
14. Minimum TCP header is:

A. 8 bytes
B. 16 bytes
C. 20 bytes
D. 40 bytes

Answer: C
15. UDP header size is:

A. 8 bytes
B. 20 bytes
C. 32 bytes
D. 40 bytes

Answer: A
16. Which supports TCP-style reliable delivery?

A. TCP
B. UDP
C. IP only
D. ARP

Answer: A
17. Multiplexing allows:

A. Multiple applications to share transport/network service
B. One router to change IP version automatically
C. One packet to remove all headers
D. Only one application to use a network

Answer: A
18. FIN is used for:

A. Connection termination
B. Address resolution
C. Routing update
D. Fragmentation

Answer: A
19. Which is a TCP state?

A. ESTABLISHED
B. HEXTET
C. BROADCASTING
D. ROUTED

Answer: A
20. Socket endpoint is commonly represented by:

A. IP address + port number
B. MAC address + subnet only
C. TTL + checksum
D. IP version + frame size

Answer: A

Frequently Asked Questions

What is the Transport Layer in simple words?

The Transport Layer provides communication between application processes running on different end systems.

Which OSI layer is the Transport Layer?

The Transport Layer is Layer 4 of the OSI model.

What are the main functions of the Transport Layer?

Its main functions include process-to-process delivery, port addressing, segmentation, reassembly, multiplexing, demultiplexing, connection management, flow control and error control.

What is a port number?

A port number is a 16-bit identifier used by transport protocols to identify application processes or service endpoints.

What is segmentation?

Segmentation divides large application data into smaller transport units before they are sent to the Network Layer.

What is multiplexing?

Multiplexing allows data from multiple applications to share Transport Layer and lower-layer communication services.

What is connection management?

Connection management includes establishing, maintaining and terminating logical transport connections.

What is the TCP three-way handshake?

TCP establishes a connection using SYN, SYN-ACK and ACK messages.

What is the difference between flow control and congestion control?

Flow control prevents a sender from overwhelming the receiver, while congestion control reduces traffic when the network itself becomes overloaded.

What is the difference between TCP and UDP?

TCP is connection-oriented and provides reliable ordered transport, while UDP is connectionless and uses a smaller, simpler transport mechanism without TCP-style reliability.

What is a socket?

A socket endpoint is commonly identified using an IP address and a port number.

What is the normal TCP connection close sequence?

A common orderly TCP close uses FIN, ACK, FIN and ACK exchanges because the two communication directions can close separately.

Transport Layer Quick Revision
OSI Layer: 4
Main Delivery: Process-to-process
Application Identifier: Port number
Port Size: 16 bits
Port Range: 0–65535
Main Protocols: TCP and UDP
TCP: Connection-oriented
UDP: Connectionless
Segmentation: Break large data
Reassembly: Rebuild data
Multiplexing: Many apps share transport
Flow Control: Protect receiver
Congestion Control: Protect network
Handshake: SYN → SYN-ACK → ACK
TCP Close: FIN → ACK → FIN → ACK
Socket: IP + Port

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources