Network switches are devices that connect multiple computers together. They receive data from one input "port" and forward it to the best output "port". Normally we don't give much thought to what happens inside a switch (and this is mostly fine!) but it's interesting to think about how to build one.
The networking pioneer Sandy Fraser liked to describe switches being like a tree of "multiplexers", each squashing multiple inputs into a single output, until everything is squashed together in the middle of the switch, and then a tree of "demultiplexers" which split the data and direct the individual messages to the correct outputs.
This is a fun high-level way to think about it, but if the switch has a large number of ports, and is running at a very high data rate, then the middle multiplexer and demultiplexer have a lot of data to handle. Sandy was particularly interested in designing switches for the "access network" (the part of the network which connects homes to the Internet) and for that he needed a really big switch with as many ports as possible, and therefore he needed a really scalable switch design.
Earlier circuit-switched telephone networks used a design called a "CLOS network" which is a way of composing together individual small switches into a much larger switch with many stages. Formalised in 1952 by Charles Clos these networks have lots of interesting properties, for example they can be "non-blocking" meaning if an output port is free, a message can always get through, no matter how many other messages are being sent (i.e. the switch will not internally overload and have to drop messages).
Sandy used a CLOS network design for his switches, which looked something like this:
In the diagram above, the switch has 16 input ports and 16 output ports, and is made up of a series of smaller 2x2 switches wired together in a complicated pattern. The path taken by a single packet is shown the red arrows.
There is a pleasing correspondence between the CLOS network wiring diagram and the tree of multiplexers and demultiplexers. We can "twist" the nodes to make it obvious.
There was of course a lot more to the design of Sandy's switches than this. Back in the early 2000s I was lucky enough to work with him to help visualise the working of the switch and simulate how well it performed under various traffic load levels and traffic patterns. Fun times!