Lesson
How Switches Learn and Forward
Learning objective
Build and use a MAC address table to predict forwarding, filtering, and flooding.
The switch decision cycle
A switch connects devices inside a Layer 2 network and decides where each Ethernet frame should leave. It does not begin by asking for the sender's IP route or application. It works with the frame arriving on a physical or logical switch interface.
For every ordinary frame, remember this order:
- Receive the frame on an ingress interface.
- Learn the source MAC address on that ingress interface.
- Look up or classify the destination MAC address.
- Forward, filter or flood through eligible interfaces—never back through ingress.
Think of a receptionist recording the door through which a person entered, then consulting a directory for the recipient. The analogy stops at one important limit: a switch learns from observed source frames, not from a trusted identity system, and an entry can age or move.
Learn the source address
When a frame from 02:00:00:00:00:0A arrives on Gi0/1, the switch records or refreshes
02:00:00:00:00:0A → Gi0/1. That evidence answers one narrow question: where was this source
most recently observed in this Layer 2 scope?
The switch does not learn the destination from this frame. If the same source later arrives on
Gi0/3, source learning refreshes the entry to Gi0/3. This is how normal host movement is
learned; the table is dynamic rather than a permanent cabling inventory.
Look up the destination
After source learning, the switch examines the destination MAC:
- A current unicast entry on another interface identifies one egress interface.
- A current unicast entry on the ingress interface means no other interface is required.
- A missing unicast entry remains unicast, but its location is unknown.
FF:FF:FF:FF:FF:FFis explicitly broadcast and is not narrowed by a unicast table entry.
The source and destination fields have different jobs: the source teaches the switch; the destination guides the forwarding decision.
Forward, filter or flood
| Destination evidence | Decision | Eligible egress | What it means |
|---|---|---|---|
| Known on another interface | Forward | That learned interface | Known unicast |
| Known on ingress | Filter | None | The destination is already behind the arriving segment |
| Unknown unicast | Flood | All eligible interfaces except ingress | One destination, temporarily unknown location |
| Broadcast | Flood | All eligible interfaces except ingress | Every receiver in the Layer 2 broadcast domain examines it |
Flooding describes a switch action, not automatic acceptance by every endpoint. A network interface can receive a copy and discard it because the destination does not apply: receipt is not acceptance. The switch also stays within its current Layer 2 scope; routing and VLAN boundaries are separate decisions.
Interactive switch learning
Watch the frame enter a labelled interface, open its Ethernet fields, and follow the MAC table through source learning, destination lookup, egress selection and transmission. The player starts automatically unless reduced motion is enabled; all stages remain available through manual controls.
Watch the switch make one decision
Change the evidence, then replay the same receive → learn → look up → forward sequence.
The destination entry identifies Gi0/2, so one copy leaves that interface.
- Host A: Host A eth0Switch: Switch Gi0/1
- Switch: Switch Gi0/2Host B: Host B eth0
- Switch: Switch Gi0/3Host C: Host C eth0
Active: Host A, Switch; link Host A to Switch
Step 1 of 5
Frame arrives on Gi0/1
Host A transmits one Ethernet frame. The switch receives it on Gi0/1 before making any forwarding decision.
Packet inspector
Inside the packet
Ethernet frame
- Source MAC
- 02:00:00:00:00:0A
- Destination MAC
- 02:00:00:00:00:0B
Technical packet details
- Ingress interface
- Gi0/1
- MAC table before
- 02:00:00:00:00:0B → Gi0/2
Free account
Continue this lesson for free
Unlock the remaining explanation, Wireshark checks, quizzes, interview answers, and saved progress. No payment required.
Continue with Google or email