Multiplexing and Demultiplexing in Transport Layer


Multiplexing is the process of collecting the data from multiple application processes of the sender, enveloping that data with headers and sending them as a whole to the intended receiver.

  • In Multiplexing at the Transport Layer, the data is collected from various application processes. These segments contain the source port number, destination port number, header files, and data.
  • These segments are passed to the Network Layer which adds the source and destination IP address to get the datagram.


Delivering the received segments at the receiver side to the correct app layer processes is called demultiplexing.

  • The destination host receives the IP datagrams; each datagram has a source IP address and a destination IP address.
  • Each datagram carries 1 transport layer segment.
  • Each segment has the source and destination port number.
  • The destination host uses the IP addresses and port numbers to direct the segment to the appropriate socket.

Multiplexing and demultiplexing are just concepts that describe the process of the transmission of data generated by different applications simultaneously. When the data arrives at the Transport layer, each data segment is independently processed and sent to its appropriate application in the destination machine.

The main objective of multiplexing and demultiplexing is to allow us to use a multitude of applications simultaneously.

  • The above figure shows that the source computer is using Google, Outlook, and Chat applications at the same time.
  • All the data is forwarded to a destination computer.
  • Each application has a segment put on a wire to be transmitted. It signifies that all applications are running simultaneously.
  • Without multiplexing/demultiplexing exists, a user can use only one application at a time because only the segments of that application are put on the wire and transmitted. For clarification, see the figure below −

In the above figure, the Application layer has generated data, and then passed it down to the Transport layer to be segmented.

  • After segmenting the data, port numbers are given to each segment to be ready for transmission.
  • Then the segments are put on a wire to travel across the network to the destination. This process is called "multiplexing".
  • When the transmitted segments reach the Transport layer of the destination, they are automatically sent up to their appropriate applications. This process is called "demultiplexing".