Switch MAC Table – How is it Filled When Connected to a Hub?

switchswitching

enter image description here

I understand the switch learns the addresses using flooding. But what happens when there is a hub connected? What address do I write in the table if for example computer d sends a message to a through port 3, and also c sends a message to b through port 3?

Whose address does the switch take? or does it add another listing in the table for port 3 ?

Best Answer

First, let me clarify: the switch does not learn addresses by flooding. The switch learns addresses by examining the source address of each frame received, then updating the MAC address if necessary.

The mac address table lists each mac address received and the associated port (among other things). So your switch would have an entry for mac D listing port 3, and an entry for mac C, also listing port 3.

Now if the switch gets a frame destined for either C or D, it knows to forward it out port 3.