Switches come in many sizes. Some are quite small, offering just a few ports to connect to, while others, used mainly by companies, can have tens of ports. In the simplest terms, a switch enables multiple computer to connect to a network using a physical cable, called an Ethernet cable (or RJ45 cable).
Each computer is connected to the switch, and multiple switches can be connected to each other. This allows hundreds of computers, let’s say on the floor of an office building, to be connected to the floors above and below, as well as to the company’s servers and routers.
Switches also come with different backbone speeds, which is the physical limit the data can travel to and from each of the ports. These speeds range from 10Mb/s, to 100Gb/s. The most popular, and the one that’s likely built into your router is 1Gb/s, although 100Mb/s is still possible to find on some routers. While Ethernet is the primary connection port type, a lot of switches will also fibre port connections too, which is much faster. This allows multiple switches to connect to each other and form a much faster bandwidth backbone connection.
The primary function of a switch is to transport data around the network, usually from areas of the network that are out of reach from its core. For example, you can have all your computers connected to your router’s switch, but if you want the computers upstairs connecting you’ll need to factor in a switch. You would purchase a switch with the required number of ports, use one of the ports for a cable that will run downstairs to the router’s switch, then connect your upstairs computers to the new switch. You’ve now created a multi-switch network; the one upstairs is connected to the switch that’s built into the router, and all the computers can happily gain access to the network and the Internet.
That’s a very simplistic example, but it’s not too different from how a real-world situation will work. In the office you would have multiple floors, teams, rooms and so on. Each of those probably has its own switch, which is in turn connected to the main switch that the company’s servers are connected to. Naturally, depending on the size of the company and how many computers, printers and so on are connected to the network, the setup can quickly become quite large, involving many switches across multiple floors and even buildings.
Another core function of a switch is to manage the network. This means that a switch is capable of building a map of its connected devices, and ensuring that the correct data is sent to the correct device in as little time as possible, and as cleanly as possible by the shortest route.
A good example is if computer A needs to send something to Computer B, both computers are located in different parts of the network. A switch is able to monitor and deliver the data package from computer A directly to computer B without having to interrogate any other connected device on the system. Should computer A or B be moved in the future, the switch can intelligently alter its understanding of the location of the devices and change the route accordingly; building a map of the network for better efficiency and avoiding packet collisions on the network, which will greatly degrade the overall speed of the network.
The types of switches found built into routers are usually unmanaged, but this doesn’t mean they don’t manage the network to some small degree. An unmanaged switch will still automatically learn and map the network, avoiding collisions by routing data to its intended devices, they just won’t feature some of more complex elements of a managed switch.
Switches also offer different functionality in form of layers. These layers perform different operations depending the layer type, and they generally gain in complexity the higher the layer number.
A layer 1 switch transfers data, but does not manage any of the traffic coming through it, an example is an Ethernet hub. Any packet entering a port is repeated to the output of every other port except for the port of entry. Specifically, each bit or symbol is repeated as it flows in. A repeater hub can therefore only receive and forward at a single speed. Since every packet is repeated on every other port, packet collisions affect the entire network, limiting its overall capacity.
A layer 2 switch is a multiport device that uses hardware addresses, MAC address, to process and forward data at the data link layer (layer 2). A switch operating as a network bridge may interconnect devices in a home or office. The bridge learns the MAC address of each connected device. Bridges also buffer an incoming packet and adapt the transmission speed to that of the outgoing port.
A layer-3 switch can perform some or all of the functions normally performed by a router. Most network switches, however, are limited to supporting a single type of physical network, typically Ethernet, whereas a router may support different kinds of physical networks on different ports.
Layer 4 switches commonly offer Network Address Translation, improved Quality of Service (QoS) capabilities and may include a firewall, Virtual Private Network connection or higher-level forms of security gateways.
Layer 7 switches are able to distribute the data load based on the target Uniform Resource Locator (URL), and may include a web cache.
Switches at Home
If you have no wireless devices in your home, then using switches to connect all the computers on the network is your best bet. A switch could therefore be positioned upstairs, feeding to the built in switch in the router, another could be located in the garage, feeding to the router, and another could be in your shed at the bottom of the garden, again feeding into the router.
The router will now be lacking in ports, so one more switch for the downstairs will satisfy any computers connected and feed into the router. In this scenario, everything is connected to each other and ultimately the router. They can all ‘see’ each other, as well as gain access to the Internet and other network resources.