[Hello guys firstly this question I myself have migrated from stack exchange to here as networking related questions are not supposed to be asked there. So please don't mark as duplicate. I am the owner of both.]
In the below diagram (click on the url below.consider the first diagram only for this question) assume switch has 2 interfaces E0(left) and E1(right) and Fred is connected to P0 of Hub and Wilma to P1 of Hub and switch to port P3 of Hub and assume MAC address table of switch is EMPTY.
Now assume Fred is sending a frame to Wilma, which is also on the E0 interface. As per my understanding, first Fred sends to Port0 of Hub and Hub should simply flash it to P1 and P3 ports simultaneously. Since the MAC table is empty along with Wilma even Barney and Betty should receive the frame and it will be discarded by them .When Wilma sends a reply back to Fred via port P1 of Hub,it will be again flashed to P0 as well as P1 and now mac table will be updated with Wilma against E0.So next time onwards,anything to Wilma will be filtered by switch.
But actually what happens is at the first time itself the frame is discarded at interface E1 of switch. Wilma then reply back to Fred via port P1 of Hub, saying I received the frame. Even before this reply from Wilma the switch decides to filter the frame because it received the frame on port E0, and it knows that Wilma’s MAC is also located out E0.
So what is confusing me is how switch intelligently comes to know Wilma is also on E0 interface. Because mac address table is empty in the beginning. [Guys please don't assume that its because of the reply message from Wilma to port P1 of Hub which is going to be forwarded to E0 of switch 1 and mac table is updated. Because I verified this on cisco packet tracer, frame at E1 is discarded even before reply from Wilma].
Sorry in advance for being so lengthy. Its just for easy understanding for readers. Consider only the first diagram in the website.[SWITCH FILTERING DECISION]: http://www.ciscotests.org/ccna.php?part=3&page=2