1 How a switch forwards: the MAC address table
A switch is a Layer-2 device that forwards Ethernet frames based on their destination MAC address. It builds a MAC address table (also called a CAM table) by learning: when a frame arrives on a port, the switch records the frame’s source MAC address against that port.
To forward a frame the switch looks up the destination MAC. If it knows the port, it sends the frame out that one port only (unicast forwarding). If the destination is unknown, it floods the frame out every port except the one it arrived on. Entries age out (typically after 300 seconds) if no further traffic is seen.