Eternet switch

An ethernet switch has a MAC address table. On receiving an ethernet frame, it will look at the destination MAC address, find the port in its table and forward it accordingly.

MAC address table

The switch builds up this MAC address table by looking at the source MAC address when it receives an ethernet frame and updates the corresponding entry in its table.
If the swtich does not know which port has the destination MAC address (unknown unicast), it sends the frame through all the ports (excluding the incoming port), and each NIC looks at the destination MAC and compares it with its own and discards or keeps the data.