Switch MAC Learning: Predict Frame Forwarding
A switch remembers where a sender was seen
An Ethernet switch builds a forwarding database (FDB), often called a MAC address table. When a normal frame arrives on a learning-enabled port, the switch can associate its individual source MAC with that ingress port in the relevant forwarding domain (often a VLAN, a logical Layer 2 segment). It uses the destination to decide where to forward. Learning and forwarding are different actions. Assume one VLAN, three active forwarding ports, no special filtering, no loops and an initially empty table.
First frame: unknown unicast
A on port 1 sends to B on port 2. The switch learns A → 1. B is not in the table, so it copies the frame to eligible ports 2 and 3, not ingress port 1. This is unknown-unicast flooding; the destination MAC remains B, not the broadcast address. C may receive a copy on its link, but it is not the addressed receiver.
Reply and next request
B replies from port 2 to A. The switch learns B → 2 and forwards only to port 1, because A is already known. A then sends another frame to B. The table still holds A → 1 and B → 2, so the switch forwards only to port 2. Read the diagram as three consecutive events, not simultaneous traffic.
A -- p1 [SW] p2 -- B p3 -- C1: A > B | out 2,3 | A:12: B > A | out 1 | A:1 B:23: A > B | out 2 | A:1 B:2Known destination on the incoming port
Imagine A and D are behind another bridge connected to port 1. Once both are learned on port 1, a frame arriving there from A to D needs no copy onto another port. The switch filters it instead. For a broadcast, it normally floods to eligible ports in the same VLAN except ingress. Multicast forwarding can be more selective depending on configuration and group-learning mechanisms.
Aging and address movement
Dynamic entries expire after a configured period without relevant source activity; the exact timer depends on the device. If a valid source appears on a new port, ordinary learning can update the entry. Persistent movement may suggest a topology issue, but one observation is not proof. The FDB maps MAC addresses to ports, not IP addresses to MAC addresses (a neighbor cache) and not IP prefixes to next hops (a routing table).
Practice with an empty table
Predict the egress ports and table entries when C sends to A, A replies, and C sends again. Explain why flooding alone does not establish a fault. Use the offline fixture; no switch or live traffic is required.