The filter-versus-forward decision works best when the switch knows where all the MAC addresses are in the network. Switches dynamically learn the MAC address in the network to build its MAC address table. With a full, accurate MAC address tables, the switch can make accurate forwarding and filtering decisions.
Switches build the MAC address table by listening to incoming frames and examining the frame’s source MAC address. If a frame enters the switch, and the source MAC address is not in the address table, the switch creates an entry in the table. The MAC address is placed in the table, along with the interface in which the frame arrived. Switch learning logic is that simple!