LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

How does a switch learn MAC addresses? (The "Learn" process)

By reading the SOURCE MAC of every incoming frame and recording it against the port it arrived on — adding new ones, refreshing the 5-minute timer on existing ones, and moving an entry if the same MAC shows up on a different port.

The clever part of learning is that a switch builds its table from the source address, not the destination. The logic: if a frame arrived on port 3 carrying source MAC (Media Access Control) address X, then device X must be reachable through port 3 — so the switch can record that and use it later when something needs to reach X. For every incoming frame it reads the source MAC and checks the table:

Decision flow of a switch learning MAC addresses from incoming source MACs: add new entries, refresh the timer on same-port matches, or move the entry when a MAC appears on a different port

* The switch reads each frame's source MAC and either adds it, refreshes its 5-minute timer, or moves the entry to a new port. *

  • Source MAC not in the table → add it, associated with the port it came in on.
  • Source MAC already there, same port → just refresh the aging timer. Entries expire after a default 5 minutes of inactivity so the table self-cleans when devices unplug.
  • Source MAC already there, but on a different portupdate the entry to the new port. This handles a device being moved to another switch port (or roaming).

Example: PC-A (MAC 00-0A) sends a frame in on port 1 → the switch records "port 1 = 00-0A." It learns the source, but it still hasn't learned where PC-A's intended destination is — that gets learned the same way when the other host replies.

Go deeper:

From Quiz: NETW1 / Ethernet Switching | Updated: Jul 05, 2026