How do you send multiple messages across a single channel?

Multiplexing is a topic that applies most to communications but it also applies to computer networks. It’s an advanced topic that I won’t be able to fully explain in this podcast. But you will understand the basic concepts.

Imagine that you want to send multiple messages consisting of a series of bits but at some point in the network there’s only a single wire to transmit signals. One option is to devote the communication channel to one message at a time. You’ll need to hold the other messages for as long as it takes. This is probably not a very good idea though.

Multiplexing is just a way for you to share a limited communication channel across different messages and purposes. Whatever technique is used to multiplex the messages, there needs to be something on the other side called a demultiplexer.

Listen to the full episode, or read the full transcript below, for the full explanation where I use cars and traffic lights as examples.

Transcript

Multiplexing is a topic that applies most to communications but it also applies to computer networks. It’s an advanced topic that I won’t be able to fully explain in this podcast. But you will understand the basic concepts.

Imagine that you want to send multiple messages consisting of a series of bits but at some point in the network there’s only a single wire to transmit signals.

This might seem like an unlikely situation but I’m just simplifying things. All networks will have some maximum capacity they can support. It’s easier to think about a single wire first, and once you understand, then you can apply that knowledge to real situations.

This actually happens all the time with electronics. There’ll be times when you want to send messages to different destinations and have only a single wire.

One option is to devote the communication channel to one message at a time. You’ll need to hold the other messages for as long as it takes. This is probably not a very good idea though.

Imagine if you wanted to drive to the grocery store but get stuck at the first traffic light. It just stays red because everybody going the other way is going to work. And the sign says that your light will remain red the whole time until everybody going to work the other way has passed. You’re not going to be very happy.

That’s the whole purpose of traffic lights. To share a single intersection between cars that want to go in different directions. This is multiplexing.

To be more accurate, it’s time based multiplexing. And you can do the same thing when sending information. You can either switch between messages after every bit or you can give each message a little more time and maybe switch after every byte or more.

This is like the difference between stop signs that let single cars through an intersection vs. traffic lights that let multiple cars through.

Multiplexing is just a way for you to share a limited communication channel across different messages and purposes. Whatever technique is used to multiplex the messages, there needs to be something on the other side called a demultiplexer. You don’t really have this concept in traffic lights because the entire car gets to go through the intersection. When we’re talking about computers or electronics though, the size of the data being multiplexed is usually smaller than the whole message. Imagine if traffic lights were designed to slice your car into little pieces before letting each piece through the intersection. This is where you’d need a demultiplexer to put the car back together on the other side.

What actually happens in electronics is a little different. The bits arrive on their own wires, go through a multiplexer which pushes the bits across a shared channel, and then a demultiplexer on the other side separates the bits and puts them back on their own wires.

As long as we’re talking about cars, just think about really busy intersections. Traffic lights just don’t work anymore once the number of cars becomes too high. So the city decides to build an overpass. This is also multiplexing but now the channel can support multiple cars at the same time. I’m stretching the analogy a bit here. What I want to describe is a way for messages to coexist together on the same channel. Overpasses do this by adding a new dimension and allowing cars to pass over and under each other. But the cars don’t really pass through each other.

Some communication channels will support this coexistence. Even a single wire, you might think it can only hold a high voltage or a low voltage. Binary ones and zeros. But what if you could transmit more voltages. Maybe one message can use zero volts for zeros and one volt for ones. Then another message can use zero volts for zeros and two volts for ones. These two messages can now coexist over the same wire given a multiplexer that understands this.

The demultiplexer looks at the voltage on the other side and interprets zero volts as a zero for both messages, interprets one volt as a one for the first message and a zero for the second message, interprets two volts as a zero for the first message and a one for the second message, and interprets three volts as a one for both messages.

You could also multiplex based on frequency if you’re sending alternating current instead of direct current. I’ll probably need to have at least a few episodes to explain some basic electronics. I’ve been describing things like voltages and current that may not make sense. If you don’t understand these things, don’t worry. Just remember that there are different ways that communication channels can support multiple messages at the same time.

Multiplexing is just a term that describes the process of sharing a limited resource. It usually applies to communication channels and how you can send multiple messages over a limited channel at the same time.