Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Switching Concepts

Direct answer

A switch learns which MAC address is behind which port by reading the source address of every frame it receives. It forwards a frame out of the one port where the destination was learned — or floods it to all ports in the VLAN if the destination is unknown or broadcast.

When to use this

Use it to find where a device is connected, and to explain flooding or a MAC address that keeps moving.

First 30 seconds

1. Get the device's MAC address (show ip arp <ip> on the gateway).

2. show mac address-table address <mac> — which port?

3. That port leads to another switch (show cdp neighbors) → repeat there.

4. Not in the table → the device is silent or in another VLAN; ping it and look again.

5. "MAC flapping" in the log → a loop: find the two ports named.

Operational verification

frame arrives → source MAC learned on the ingress port and VLAN → destination looked up → known: forwarded out of one port; unknown or broadcast: flooded in the VLAN → entry refreshed by traffic or aged out

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · IOS/IOS XE · Cisco IOS XE
Key commandshow mac address-table [dynamic]
Scope / prerequisiteUse it to find where a device is connected, and to explain flooding or a MAC address that keeps moving.
Show · 2
What next?3 suggested next steps
Catalog command links2
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show mac address-table [dynamic]

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Commands & verification Verify boundary
CommandShows
show mac address-tableAll entries: VLAN, MAC address, type, port
show mac address-table address <mac>Where one address was learned
show mac address-table interface <interface>The addresses behind one port
show mac address-table vlan <id>One VLAN
show mac address-table countNumber of entries per VLAN
show mac address-table aging-timeThe ageing timer
clear mac address-table dynamicRemove learned entries so they are relearned

Cisco writes MAC addresses as three groups of four hexadecimal digits: 0011.2233.4455.

Step 2 MAC table as evidence Verify boundary

Use the MAC table to ask where the switch last learned an endpoint. A missing MAC suggests the endpoint has not sourced frames on that VLAN/path; a MAC moving rapidly between ports may indicate topology/looping or endpoint mobility.

Step 3 Troubleshooting approach Narrow the fault

Finding where a device is connected.

1. Get its MAC address — from the device, or from the gateway with show ip arp <ip>.

2. show mac address-table address <mac> on a switch.

3. If the port leads to another switch (show cdp neighbors), go there and repeat until the port is an access port.

The address is not in the table. The device has not sent anything recently, is in another VLAN, or is not connected. Ping it from the gateway and look again.

"MAC flapping between ports" in the log. The same address is seen on two ports in turn: a loop, a device connected twice without a proper bundle, or a duplicated address (cloned virtual machines). The message names both ports.

Unexpected flooding. The table is full, entries age out before the device answers, or spanning-tree topology changes keep flushing the table.

Step 4 Common mistakes Narrow the fault
  • "The switch learns from the destination address." It learns from the source and forwards by the destination.
  • "A device not in the table is not connected." It may simply have been silent for five minutes.
  • "A switch sends every frame only where it belongs." Broadcasts and unknown unicasts go to every port in the VLAN.
  • "Switches forward between VLANs." A Layer 2 switch never does; that requires routing.
  • "Many addresses on one port is a fault." It is normal on a port leading to another switch.
  • "MAC flapping is cosmetic." It usually indicates a loop.
Command lookup Jump straight to Cisco syntax
Key points

Learning is from the source address, forwarding by the destination. Entries age out after 300 seconds without traffic. Unknown unicast, broadcast and multicast are flooded within the VLAN. The same MAC address appearing on two ports in turn points to a loop or a duplicate.

Key checks
  • show mac address-table — all learned addresses with VLAN and port.
  • show mac address-table address <mac> — where one address is.
  • show mac address-table interface <interface> — what is behind one port.
  • show mac address-table aging-time — the ageing timer.
  • show mac address-table count — table size per VLAN.
ReferenceWhat it is1 section · depth on demand

What it is

A switch connects devices in a local network and forwards Ethernet frames between them. It learns where each device is by noting the source MAC address of every frame it receives, and uses that table to send each frame only to the port where its destination lives.

ReferenceWhy it matters1 section · depth on demand

Why it matters

The MAC address table is the switch's record of what it has seen, and it answers the most practical question in a LAN: which port is this device connected to? Its behaviour also explains what a switch does when it does not know — it floods — and why a loop in a switched network is so destructive.

ReferenceHow it works1 section · depth on demand

How a switch learns and forwards

For every frame, a switch does three things.

1. Learn. It records the frame's source MAC address together with the port it arrived on and the VLAN. If the address was already known on another port, the entry is moved.

2. Look up. It searches the table for the frame's destination MAC address in that VLAN.

3. Forward, flood or filter.

DestinationAction
Known, on another portForward out of that one port
Unknown unicastFlood: send out of every port in the VLAN except the one it came in on
Broadcast (ffff.ffff.ffff)Flood
MulticastFlood, unless IGMP snooping limits it
Known, on the same port it arrived onFilter: drop it

Ageing. An entry that is not refreshed by new frames from that address is removed after 300 seconds by default. A silent device therefore disappears from the table, and the next frame to it is flooded until it speaks again.

VLANs. Learning and flooding happen per VLAN. A frame is never forwarded or flooded into another VLAN; that takes a router or a Layer 3 switch.

Trunks and uplinks. Many addresses are learned on a port that leads to another switch — everything behind it. Following a device through the network means following its address from table to table.

Why loops are fatal. Ethernet frames have no hop limit. With a loop, a flooded frame circulates and multiplies endlessly, and the switches see the same source address arriving on different ports in turn — reported as MAC flapping. Spanning tree exists to block such loops.

Static and secure entries. An address can be entered by hand, and port security can limit which or how many addresses a port may learn.

ReferenceImportant terms & boundaries3 sections · depth on demand

Important terms & boundaries

TermMeaning
MAC address table (CAM table)Address, VLAN and port for each learned device
Dynamic entryLearned from traffic; ages out
Static entryConfigured; does not age
Unknown unicastA frame to an address not in the table
FloodingSending out of all ports in the VLAN except the ingress port
Ageing time300 seconds by default
Collision domainEach switch port is its own
Broadcast domainEach VLAN is one

In depth

Switching concepts: learn, look up, forward

For every frame, a switch learns the source MAC address against the incoming port and VLAN. It then looks up the destination MAC in the same VLAN, and forwards, floods or filters the frame. Cisco's MAC Address Table Manager technote for Catalyst 9000 shows how this works on a modern switch:

  • Learning creates entries in a software table (IOS MATM) and in the hardware table (FED MATM).
  • Forwarding uses the hardware table.
  • The table has a fixed size: 32,768 entries on a C9300.
  • When it's full, the switch logs MATM-3-MAX_ENTRIES and can't learn new addresses.

Learn, look up, forward

StepUsesResult
LearnSource MAC, ingress port, VLANTable entry, refreshed while traffic continues
Look upDestination MAC, VLANKnown or unknown
ForwardKnown unicastOut of one port
FloodUnknown unicast, broadcast, most multicastOut of all ports in the VLAN except the ingress
FilterDestination on the ingress portDropped

Switching compared with routing

Switch (Layer 2)Router (Layer 3)
Decides onDestination MAC addressDestination IP address
ScopeWithin a VLANBetween networks
TableMAC address tableRouting table, FIB
Unknown destinationFloodDrop (or use a default route)
Loop protectionSpanning treeTTL

Concepts checked in practice

QuestionCommand
Where is this MAC?show mac address-table address <mac>
How many MACs are learned?show mac address-table count
Is the table filling up?show platform hardware fed switch active fwd-asic resource tcam utilization
How long do entries last?show mac address-table aging-time
SW1# show mac address-table address a4bb.6d55.0164
 110    a4bb.6d55.0164    DYNAMIC     Gi1/0/14
SW1# show mac address-table count vlan 110 | include Total
SW1# show mac address-table interface TenGigabitEthernet1/1/1 | include Total
Total Mac Addresses for this criterion: 386

Many MACs learned on an uplink is normal, because every host beyond it appears there. A host MAC learned on an unexpected access port points to a moved device, a loop or a duplicated MAC address.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

A switch builds its forwarding decisions from what it sees. It learns which MAC addresses sit behind which ports by reading the source address of every frame, forwards frames to known destinations on just one port, and floods frames whose destination it does not know. Understanding these basic behaviours explains most of what happens in a Layer 2 network.

Switching concepts: switches learn source MACs per port and VLAN, forward known unicast to one port, flood unknown unicast/broadcast/multicast within the VLAN, and block loops with STP.

show mac address-table dynamic vlan 20
show mac address-table count
show interfaces counters errors
show spanning-tree vlan 20

VLANs split broadcast domains; routing between them happens on a Layer 3 switch or router.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Network Fundamentals → Switching Concepts. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Depth when you need it

Deep reference

Exam focus

Exam focus

  • CCNA-1.13 — Describe switching concepts. MAC learning/aging, frame switching/flooding and MAC table.
  • CCNA-1.13.a — MAC learning and aging. MAC learning/aging.
  • CCNA-1.13.b — Frame switching. Frame switching behavior.
  • CCNA-1.13.c — Frame flooding. Frame flooding behavior.
  • CCNA-1.13.d — MAC address table. MAC table purpose/behavior.
Confirmation

Confirm action

Continue?