This guide covers what does a switch actually do.

Plug five computers into a switch and they can talk to each other — but the switch is not just a splitter. A hub, its dumb ancestor, repeated every signal out of every port. A switch does something smarter, defined by the IEEE 802.1D bridging standard: it learns which device sits on which port, and then forwards each frame only where it needs to go. That one idea — learn, then forward — is the whole job, and everything else a switch does exists to keep that job safe at scale.
It forwards by hardware address, not by IP
A switch works at the layer of Ethernet frames, and the address it reads is the MAC address: the hardware address burned into every network interface. The switch never needs to understand IP addresses to do its core job. When a frame arrives, the switch reads the destination MAC, looks it up in its MAC address table (older documentation calls it the CAM table), and sends the frame out of exactly one port — the port where that address lives.
The table is learned, not configured
Nobody types that table in. The switch builds it by watching: every time a frame arrives on a port, the switch records the frame’s source MAC address against that port, with a timestamp. Entries age out — typically after about five minutes of silence — so a laptop that moves desks quietly relearns its new port. This is why a brand-new switch works the second you plug it in, and why the first frame to a new device behaves differently from the second.
When it does not know: flooding
If the destination MAC is not in the table yet, the switch floods: it sends the frame out of every port except the one it arrived on. The right device answers, the switch learns from the reply, and later frames go direct. Broadcast frames — addressed to everyone — and most multicast are flooded by design. Flooding is not a failure; it is the honest fallback of a device that would rather deliver a frame everywhere than drop it.
Loops are the danger — spanning tree is the guard
Flood a network with a wiring loop in it and broadcast frames circle forever, multiplying into a broadcast storm that melts the LAN. IEEE 802.1D’s answer is the Spanning Tree Protocol: switches exchange configuration messages, elect a root bridge, and deliberately block the redundant ports that would create loops, unblocking them if an active link fails. Its faster modern successor, Rapid Spanning Tree (IEEE 802.1w, folded into 802.1D-2004), cuts recovery from tens of seconds to about a second. The lesson for home and small-office wiring: one path between switches is a design, two paths without spanning tree is an outage waiting for its moment.
VLANs: many networks inside one switch
IEEE 802.1Q adds the second trick: a four-byte tag inserted into the Ethernet frame that names a virtual LAN. One physical switch can then carry several separate networks — office, guests, cameras — whose traffic never mixes, even though it shares the same hardware and cables. A port carrying several VLANs at once is a trunk; a port serving one VLAN for an end device is an access port. This is the mechanism underneath home network segmentation: the guest network and the IoT network are VLANs before they are anything else.

The bottom line
A switch learns source addresses, forwards by destination address, floods when it does not know, blocks loops with spanning tree, and separates networks with 802.1Q tags. It does not route between networks — that is the router’s job, and it is the next piece of the map. Learn the switch honestly and half of “the network is slow” stops being a mystery: it is a full table, a loop, or a flood, and now you know which questions to ask.
By Karl Amber
Sources
- IEEE 802.1D — Media Access Control (MAC) Bridges: the learning, forwarding, filtering and flooding behaviour, the MAC address table, and Spanning Tree (with Rapid Spanning Tree, originally IEEE 802.1w, incorporated into 802.1D-2004).
- IEEE 802.1Q — Virtual Bridged Local Area Networks: the VLAN tag, trunk and access port model.
- Cisco switching documentation — MAC address table operation and aging behaviour in production switches.
Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series. It was researched from IEEE 802.1D and 802.1Q and Cisco’s switching documentation — our coverage is original and educational throughout.
That is the complete picture on what does a switch actually do.
Featured image: Gaurav Dhwaj Khadka, CC BY-SA 4.0, via Wikimedia Commons

Leave a Reply