Multiplexing and Demultiplexing
Let's discuss how the transport layer handles so many simultaneous connections over one network!
What are Multiplexing & Demultiplexing? #
End-systems typically run a variety of applications at the same time. For example, at any given time a browser, a music streaming service, and an email agent could be running.
So how does the end-system know which process to deliver packets to? Well, that’s where the transport layer’s demultiplexing comes in.
What is Demultiplexing? #
Demultiplexing is the process of delivering the correct packets to the correct applications from one stream.
Here’s a useful analogy: deciphering the mail that should be delivered to which houses after a large shipment of packages are received at a post office.
What is Multiplexing? #
Also, multiplexing allows messages to be sent to more than one destination host via a single medium.
An analogy would be when several packages to several different locations are mailed out from one house.
Multiplexing and demultiplexing are usually a concern when one protocol (TCP for example) is used by many others (HTTP, SMTP, FTP) in an upper layer.
Here’s a simplified view of what multiplexing and demultiplexing are.
How Do They Work in the Transport Layer? #
Recall that sockets are gateways between applications and the network, i.e., if an application wants to send something over to the network, it will write the message to its socket.
Sockets have an associated port number with them. We looked at ports briefly in a previous lesson, but here’s a quick overview
- Port numbers are 16-bit long and range from 0 and 65,535.
- The first 1023 ports are reserved for certain applications and are called well-known ports. For example, port 80 is reserved for HTTP.
The transport layer labels packets with the port number of the application a message is from and the one it is addressed to. This is what allows the layer to multiplex and demultiplex data.
Feel free to ask any questions related to the lesson in the following widget. Our AI will answer them and help you better understand the topic
Quick Quiz! #
The transport layer in the TCP/IP reference model uses ______ to multiplex/demultiplex messages for different applications.
IP address
Port number
Application names
Let’s look at connectionless multiplexing and demultiplexing in the next lesson!
Get hands-on with 1400+ tech skills courses.