How does a switch learn MAC Addresses

Hello Rene,
As you described a switch as pretty “dumb” box, I would like to ask, if the sentence in brackets “(except the one it came from)” could be added to the second thing, in your explanation.

Then Your explanation could look like this:

The switch is a pretty “dumb” box…it only cares about a couple of things:

– When it receives an Ethernet frame, and it didn’t see the source MAC address before, it is stored in the mac address table.
– If the destination MAC address is known, it forwards it out of the correct interface (except the one it came from).
– If the destination MAC address is unknown, it is flooded on all ports (except the one where it came from).
– If the destination MAC address is a broadcast, it is flooded on all ports (except the one it came from).

I considered the situation, where we have 3 switches and 3 hosts (as shown in the attached picture http://imgur.com/SaBSnbd)
All switches have all MAC addresses in their mac-address-tables.
All hosts have all MAC addresses mapped to IP addresses in their memory.
PC1 sends the frame to the PC2. When a frame enters Switch1 in the same time mac-address-table in Switch2 is cleared.
When the frame enters Switch2, it is flooded on all ports (except the one it came from).
One frame enters the PC2 and second enters the Switch3.
Switch3 has MAC address of PC2, so the destination MAC address is known, but it does not forward it out of the correct port because outgoing port and incoming port are the same.
The Switch3 drops the frame.

In my simulator, this works similarly as I wrote.
Could you answer if my suggestion is ok?

Jarisk