Skip to content
Getting Digital

Switching

Also: network switch, layer 2 switching, MAC address table, spanning tree, Ethernet switching

Switching is the forwarding of frames within a single network segment by a device that learns which hardware address sits on which port and sends each frame only where it needs to go.

Our take. A switch is the most reliable device in most networks and the most poorly understood, because it works without configuration. The moment it is asked to do more, VLANs, redundancy, security features, the engineer who never learned how it learns addresses is the one who creates a loop and takes the floor down.

Every network interface has a hardware address burned in by its maker, and a switch keeps a table of which address it has seen arriving on which port. A frame for an address the switch knows goes out one port; a frame for an address it has not yet seen goes out all of them, and the reply teaches the switch where that address lives. Within seconds of a device connecting, the switch knows exactly where it is, and traffic between two devices touches no other port. That is the entire mechanism, it needs no configuration, and it is why a switch works out of the box while a router needs a table before it does anything.

The mechanism has one fatal weakness. If two switches are connected by two cables, a frame for an unknown address goes out both, comes back in on the other, goes out again, and the network fills with copies of one frame within a second, which is a broadcast storm and takes down everything attached. Spanning tree exists to prevent it: switches elect a root, compute a loop-free tree of the links between them, and block the redundant ones until a link fails, at which point a blocked link is unblocked. A network with redundant switch links and no spanning tree is a network waiting for one careless patch cable.

  • Address learning: the switch builds its table by watching source addresses. Unplug a device and its entry ages out.
  • Flooding: unknown destinations and broadcasts go out every port in the segment, which is why segment size matters and VLANs exist.
  • Spanning tree: the protocol that blocks redundant links to prevent loops and unblocks them on failure.
  • Port security: limiting which or how many hardware addresses a port accepts, so a rogue device or a second switch cannot appear where a single desk was.
  • Layer-three switching: the same box also routing between VLANs at hardware speed, which is how most campus networks are built and where the two disciplines meet.

In practice

A facilities team adds a small unmanaged switch under a desk so two devices can share one wall port, and later plugs a second cable from the same small switch into a neighbouring wall port for good measure. Both wall ports lead to the same building switch, which now has two paths to the desk. The building switch runs spanning tree and blocks one path within seconds; nothing happens. In an identical building where spanning tree was disabled to speed up boot times, the same cable creates a loop, a broadcast storm follows, and the floor loses its network until somebody finds the desk. The certification exams ask which scenario is which; the second happens in real buildings every year.

  • Spanning tree on: the second path is blocked within seconds; nobody notices.
  • Spanning tree off: a broadcast storm, and the floor is down until the desk is found.

Often confused with

Routing
Switches forward by hardware address within a segment and learn by listening; routers forward by IP address between segments using a table. The layer differs, and so does what each device knows.
VLAN (Virtual LAN)
A VLAN is a feature of a switch that splits one physical switch into several logical segments. Switching is the forwarding; the VLAN decides which ports count as one segment for the purpose of that forwarding.
OSI Model
Switching is the archetypal layer-two activity in the model's vocabulary. The model is how engineers name it; the switch does the work whether anyone names it or not.

Key takeaways

  • A switch learns which address lives on which port by listening, and needs no configuration to do so.
  • Redundant links without spanning tree create loops, and a loop takes the segment down.
  • Flooding is why segments should be small, and VLANs are how switches make them so.

Certifications that test this

Vendor exams whose syllabus covers this concept — facts, cost and a preparation path on each page.

More courses from these shelves

A rotating selection from the course directory, drawn from the subcategories where this concept is taught rather than picked for it. Details, price and the provider link are on the course page.

Networking Full Course & Network + certification

This Class of Full Networking Fundamentals, will be fully illustrated with video lessons and sample to which it will ma…

Udemy

Microsoft Dynamics 365 Business Central- Manufacturing

Learn Every thing about getting started with Manufacturing in Microsoft Dynamics 365 Business Central.Dynamics 365 Busi…

Udemy

The Ultimate AWS Networking Training Course: All In One

Unlock the Future of Cloud: Master AWS Networking and Propel Your Career Forward!In a world powered by the cloud, Amazo…

Udemy

Linux & Networking: Real-World Scenarios - Practice Tests

Networking is a critical skill for any Linux administrator, security expert, or DevOps professional. This course provid…

Udemy

The Basics of DAO (Autonomous Organization) in Blockchain

You might have heard about Blockchain & Other Cryptocurrencies. Do you know Blockchain can run a completely automated d…

Udemy

Master Full stack .NET Architecture using C#

.NET is a modern, innovative, open source development platform and developers love it. NET best suits businesses that l…

Udemy

FAQ

Hub or switch: what changed?
A hub repeats every frame to every port; a switch learns where each address lives and sends frames only there. Hubs are obsolete, and the difference is still examined because it explains what a switch's table is for.
Do I need to configure a switch?
Not to make it forward frames. You configure it to create VLANs, to run spanning tree deliberately rather than by default, to secure ports against rogue devices, and to route between VLANs. Unmanaged switches do none of that and belong under a desk, not in a rack.
Why did one patch cable take down the whole floor?
A loop. Two paths between switches with spanning tree disabled or absent let a single broadcast multiply until the links saturated. Spanning tree exists to block the second path, and disabling it to save a few seconds at boot is the classic false economy.

Sources

The primary text this definition rests on. Read it before you trust ours.

  • IEEE 802.1D, Media Access Control (MAC) Bridges (2004)
  • IEEE 802.1Q, Bridges and Bridged Networks (2022)
  • IEEE 802.3, Ethernet

Last reviewed 13 September 2026 · Getting Digital