1.13 Describe how a switch forwards frames

CCNA 200-301 v1.1 · 1.0 Network Fundamentals

A switch builds a table that says which MAC address lives behind which port, by watching the source address of every frame it receives. It then uses the destination address to decide whether to forward out one port, flood out many, or drop.

What you must know

MAC learning and aging

Every time a frame arrives, the switch records its source MAC address against the ingress port and VLAN. A new host becomes known the first time it sends anything.

Entries are removed after they have not been seen for the aging time, 300 seconds by default on Cisco switches. Moving a host to another port works because its next frame simply overwrites the old entry.

Frame switching

When the destination MAC is in the table, the switch forwards the frame out of that single port only. This is what makes a switch faster and quieter than a hub. If the destination is on the same port the frame came from, the switch filters (drops) it, because the destination already saw it.

Frame flooding

Some frames cannot be sent to one port, so the switch floods them out of every port in the same VLAN except the one they arrived on:

  1. Host A sends to Host B and B is not in the table. The switch learns A on Fa0/1, then floods the frame.
  2. B replies. The switch learns B on Fa0/2 and, since A is known, forwards the reply out Fa0/1 only.
  3. From now on A and B talk without flooding.

The MAC address table

The table (also called the CAM table) is per VLAN. The same MAC may appear in more than one VLAN, and a frame is only ever switched inside its own VLAN.

SW1# show mac address-table
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
  10    0050.7966.6801    DYNAMIC     Fa0/1
  10    0050.7966.6802    DYNAMIC     Fa0/2
  20    0050.7966.6803    DYNAMIC     Fa0/3

Commands

show mac address-tableEverything the switch has learned, per VLAN and port.
show mac address-table dynamicOnly entries learned from traffic.
show mac address-table address 0050.7966.6801Where one specific host was last seen.
show mac address-table aging-timeThe current aging time (300 s by default).
clear mac address-table dynamicForget learned entries; useful when testing flooding.

Exam traps

Check yourself

A frame arrives on Fa0/1 for a destination that is not in the MAC table. What does the switch do?
It floods the frame out every port in that VLAN except Fa0/1. It also learns the frame's source address on Fa0/1.
Why does the very first ping between two hosts behave differently from the second?
The first exchange involves ARP broadcasts and frames to destinations the switch has not learned yet, so it floods. After both hosts have sent a frame, the switch knows both and forwards to single ports.
Host A is moved from Fa0/1 to Fa0/5. What happens to the old entry?
The next frame A sends arrives on Fa0/5, and the switch updates the entry to Fa0/5. Otherwise the old entry ages out after 300 seconds.

More topics in 1.0 Network Fundamentals