Multiplexing and Demultiplexing in TCP
Multiplexing and Demultiplexing in TCP
Demultiplexing in TCP
-Understanding How Data Flows
Efficiently in Networking
Submitted By:
Name: PULIKANTI RAJITH TEJA
Reg.No: 2201109073
Dept: INFORMATION
TECHNOLOGY
Contents
Introduction
Importance of data transfer
Brief overview of Transmission
Control Protocol (TCP): mechanisms:
Connection-Oriented Protocol
• Establishes a connection before data transfer using a three-way handshake (SYN, SYN-
ACK, ACK).
• Ensures both sender and receiver are ready for communication, providing a
reliable communication channel.
Reliable Delivery
• Ensures all data packets reach the destination accurately and in order.
• Uses acknowledgment mechanisms to confirm the receipt of each packet.
Error Checking and Retransmission
• Detects errors during transmission through checksum validation.
• Automatically retransmits lost or corrupted packets to maintain data integrity.
Multiplexing in TCP
•Combining Data Streams
•TCP gathers data from multiple applications running on a device (e.g., browser, email
client, file transfer software) and combines them into a single stream for efficient
transmission over the network.
•Role of Port Numbers
•Each application is assigned a unique port number, which acts like an identifier.
•Example:
•Web browsing: Port 80 or 443 (HTTP/HTTPS).
•Email: Port 25 (SMTP) or 993 (IMAP).
•These port numbers help distinguish between different applications, ensuring the data
for each app is properly labeled and routed.
•Efficient Resource Utilization
•By managing multiple application data streams in a single connection, TCP reduces the
overhead and maximizes network performance.
Demultiplexing in TCP
•Demultiplexing in TCP:
TCP ensures that incoming data is split and delivered to the correct application on the device.
•How It Works:
•Data arrives at the transport layer.
•TCP identifies the correct application using socket pairs:
Socket Pair = IP Address + Port Number.
•Key Role of Socket Pairs:
•IP Address: Identifies the device.
•Port Number: Identifies the specific application on the device.
Multiplexing Process
•Multiplexing in TCP:
Combining data from multiple applications for efficient transmission.
•Process:
1.Data Flows from Applications:
Multiple applications send data to the transport layer.
2.Encapsulation:
Each application's data is encapsulated into separate TCP segments with unique socket pairs
(IP + Port).
3.Transmission:
All TCP segments are transmitted over a single channel (network link) while preserving their
distinct identities.
Demultiplexing Process
•Demultiplexing in TCP:
The process of directing incoming data to the correct application.
•Steps:
1.TCP Header Decoding:
TCP examines the header of each segment to extract the socket pair (IP + Port).
2.Identification of the Destination Application:
The port number identifies the application that should receive the data.
3.Delivery of Data:
The segment's payload is forwarded to the appropriate application on the device.
Ports and Sockets
•What Are Ports?
•Logical identifiers (numbers) used to distinguish applications on a device.
•Examples:
•HTTP → Port 80
•HTTPS → Port 443
•How Ports Help:
•Each application is assigned a unique port number.
•TCP uses these port numbers to direct incoming and outgoing data to the correct application.
•Role of Sockets in Data Transfer:
•A socket = IP Address + Port Number.
•Sockets enable communication by uniquely identifying the source and destination of data.
•Example: 192.168.1.1:80 for a web server.
TCP Header Fields for
Multiplexing/Demultiplexing
•Source Port:
•Identifies the port of the sending application.
•Helps the receiver know where to send the acknowledgment.
•Destination Port:
•Identifies the port of the receiving application.
•Ensures data is delivered to the correct application.
•Sequence Number:
•Tracks the order of data segments.
•Enables proper reassembly of data at the receiver.
•Acknowledgment Number:
•Confirms receipt of data by the receiver.
•Ensures reliable communication.
Multiplexing Example
•Example Scenario:
•A web browser and an email client are running on the same computer.
•Both applications are sending and receiving data simultaneously.
•How TCP Handles This:
1.Unique Port Numbers:
•The web browser uses a port (e.g., 80 for HTTP).
•The email client uses another port (e.g., 25 for SMTP).
2.Socket Identification:
•TCP assigns a unique socket pair (IP + Port) to each application.
3.Encapsulation:
•Data from both applications is encapsulated into separate TCP segments.
4.Transmission and Routing:
•TCP sends the segments over the network, ensuring they reach the correct destination.
5.Demultiplexing at Receiver:
•The receiver uses the destination port to forward data to the correct application.
Demultiplexing Example
•Example Scenario:
•A server (e.g., web server) is receiving requests from multiple clients simultaneously.
•How TCP Handles This:
1.Client Identification:
•Each client request is tagged with a unique socket pair:
Client IP + Client Port ↔ Server IP + Server Port.
2.TCP Header Decoding:
•The server uses the source IP and port from the TCP header to identify the client.
3.Data Processing:
•The server processes each request individually.
4.Response Delivery:
•The server sends the correct response back to the client using the socket pair.
Benefits of TCP Multiplexing and
Demultiplexing
•Efficient Network Utilization:
•Multiple data streams are combined into a single channel for transmission, optimizing
bandwidth usage.
•Support for Concurrent Connections:
•Allows multiple applications or devices to communicate simultaneously without
interference.
•Scalability in Modern Networks:
•Easily handles a large number of connections, crucial for servers managing diverse
client requests.
Real-World Applications of TCP
• Online Gaming:
• Ensures reliable communication for game data, maintaining synchronization between players.
• Streaming Services:
• Supports video and audio streaming by delivering data in the correct order, ensuring a
seamless experience.
• TCP Connections:
• Netflix uses TCP to ensure reliable data transmission, handling video and audio data packets
over distinct socket pairs (IP + port combinations) for each client request.
• Demultiplexing at Server:
• Netflix servers decode incoming TCP packets, identify the correct session using destination
ports and IPs, and deliver the requested video stream to the corresponding client.
• Load Balancing:
• Multiple servers handle user requests, and traffic is distributed using multiplexing across
various paths, ensuring reliability and faster data delivery even under heavy demand.
• Conclusion:
• Netflix’s use of TCP multiplexing and demultiplexing allows efficient management
of large-scale, concurrent video streams, ensuring a seamless and reliable user
experience.
Summary