Study FAQ
How does an Ethernet switch learn MAC addresses and forward unknown unicasts?
Also asked as 2
- What does a switch learn from incoming Ethernet frames, and when does it flood a unicast?
- Why does an Ethernet switch flood a unicast before it learns the destination MAC?
Answer
An Ethernet switch learns the source MAC address from a frame it receives and associates it with the ingress port and VLAN. It then looks up the destination MAC in the same VLAN. A known unicast goes toward the recorded port if it is eligible for forwarding. An unknown unicast is flooded out other forwarding ports in that VLAN. Dynamic entries eventually age out if traffic from that source does not refresh them.
In a simple lab, suppose Host A sends a frame to Host B and the switch has no entry for B. The switch learns A immediately and floods the frame within the VLAN. When B replies, the switch learns B from the reply and can use the resulting entry for later frames sent to B. On a Catalyst 9300 running IOS XE 17.15.x, use show mac address-table and compare the address, VLAN, and port with the intended path. A valid lookup is evidence about local Layer 2 learning. Test the routed or application path separately if that is the symptom.
References
Full explanation
Ethernet, Cabling, TCP, UDP, and Switching Fundamentals
Study guide · 200-301
Read the full explanation