How a Switch Forwards Frames
Learn how switches send data only to the right port.
How a Switch Forwards Frames is a free Network+ Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Network+ Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Smarter Successor
A switch is the modern device that connects devices in a LAN, and it is far smarter than a hub. Instead of blindly repeating data, a switch reads addresses and forwards each frame only to the port where the destination actually is. This single change dramatically improves speed, efficiency, and security. This lesson explains exactly how a switch makes those forwarding decisions.
Operating at Layer 2
A switch works at the data link layer (Layer 2 of the OSI model). At this layer, data is organized into frames, and each device has a unique MAC address (Media Access Control address) burned into its network card. The switch reads the MAC addresses inside frames to decide where to send them, which is why it is called a Layer 2 device.
Frames Have Addresses
Every Ethernet frame carries two MAC addresses: a source (who sent it) and a destination (who should receive it). The switch examines these addresses on each frame. By tracking which MAC address lives on which port, the switch can deliver frames precisely, instead of flooding them everywhere as a hub does.
Learning MAC Addresses
A switch builds its knowledge by learning. When a frame arrives, the switch records the source MAC address and the port it came in on, storing that pair in its MAC address table. Over time, as devices send traffic, the switch learns where every device is. This automatic learning needs no configuration and happens continuously.
Forwarding Decisions
To forward a frame, the switch checks the destination MAC against its table:
- Known address — send the frame out only the matching port.
- Unknown address — flood it out all ports except the one it arrived on.
Once the destination replies, the switch learns its location too, so future frames go straight there.
Flooding Unknown Frames
When a switch does not yet know where a destination MAC lives, it floods the frame out every port except the source port, much like a hub. But this is temporary: as soon as the destination responds, the switch learns its port and stops flooding for that address. So flooding is a fallback, not the normal behavior, and the table fills in quickly.
Full-Duplex and Dedicated Bandwidth
Each switch port operates in full-duplex, sending and receiving at the same time, and gives the connected device its own dedicated bandwidth rather than a shared pipe. This eliminates the collisions that plagued hubs and lets every device run at full speed simultaneously. It is a key reason switched networks vastly outperform hub-based ones.
Aging Out Entries
The MAC table does not grow forever. Each entry has an aging timer; if the switch hears nothing more from a MAC address for a set time, it removes that entry. This keeps the table current as devices move or disconnect. If a device later sends again, the switch simply relearns its location, keeping forwarding accurate.
Unicast, Broadcast, Multicast
Switches handle frame types differently:
- Unicast — to one device; forwarded to that one port if known.
- Broadcast — to all devices; sent out every port.
- Multicast — to a group; flooded or, with extra features, sent selectively.
Broadcasts always spread across the whole switch, a point that matters for broadcast domains later.
Forwarding Methods
Switches can forward frames in different ways. Store-and-forward receives the entire frame, checks it for errors, then forwards it — accurate but slightly slower. Cut-through begins forwarding as soon as it reads the destination address — faster but it cannot catch errors. Most modern switches use store-and-forward for reliability. Knowing these two methods and their speed-versus-accuracy trade-off is useful for the exam.
Why Switches Win
By forwarding intelligently, switches deliver three big wins over hubs: better performance from dedicated full-duplex ports, fewer collisions because each port is its own collision domain, and improved security because frames are not sent to every device. These advantages are exactly why switches replaced hubs everywhere and form the backbone of every modern LAN.
Quick Check
Test your switching knowledge.
Recap
You learned that a switch is a Layer 2 device that reads MAC addresses in frames to forward them intelligently. It learns source MACs and their ports into a MAC address table, then forwards known destinations out a single port and floods unknown ones temporarily. Each port is full-duplex with dedicated bandwidth, eliminating collisions. Table entries age out to stay current. Switches outperform hubs in speed, collisions, and security, powering every modern LAN.
Frequently asked questions
Is the “How a Switch Forwards Frames” lesson free?
Yes — the full text of “How a Switch Forwards Frames” is free to read here on the web, and the Network+ Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Network+ Academy course, upgrade to CoddyKit PRO.
What will I learn in “How a Switch Forwards Frames”?
Learn how switches send data only to the right port. You practise Network+ Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Network+ Academy?
No prior experience is required. Network+ Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “How a Switch Forwards Frames” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Network+ Academy lesson?
Yes. Every Network+ Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why Hubs Belong to the Past
- How a Switch Forwards Frames
- MAC Addresses and the Address Table
- Collision and Broadcast Domains