How the switch decides destination is also on the same interface similar to that of source?

1

[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

Poorvi

Posted 2013-06-28T10:52:56.960

Reputation: 11

If there is a duplicate on the other site, perhaps you could flag it and have it migrated. – None – 2013-06-28T11:18:03.493

Could you inline the diagram into the question please – None – 2013-06-28T11:18:43.467

@axrwkr>I have added link in the end of the question.Pasting the link again here.http://www.ciscotests.org/ccna.php?part=3&page=2

– Poorvi – 2013-06-28T11:26:21.267

It doesn't know. It just pushes the packets to the whole range for everybody to know. – Piotr Kula – 2013-06-28T11:35:09.283

@ppumkin>so even you are agreeing to my understanding that for the first time it will flood and next time onwards,it starts filtering..am i right?But in the actual scenario,even for the 1st time ,it just filtersout.I tried the topology in packet tracer and got to know this. – Poorvi – 2013-06-28T11:45:57.620

Well I realised that diagram is using HUB's - HUB's suck and I dont really remember how they work. Switches will just "flood" as you say – Piotr Kula – 2013-06-28T11:50:46.700

@ppumkin>i have uploaded the packettracer file (x.pkt) in this link.You can check out and can see the same what i have mentioned in question.http://ge.tt/7PCPVTk.

– Poorvi – 2013-06-28T12:00:19.903

Are your computers doing ARP before sending packets to each other? Or are you sending packets in a "brute force" manner (that is - without arping first)? – prateek61 – 2013-06-28T12:26:32.243

@prateek61>nO.only ICMP packets are captured. – Poorvi – 2013-06-28T12:34:07.757

Hmm, I just tested this in a lab scenario and I got the correct behavior. Could this be an artifact of packet tracer? – prateek61 – 2013-06-28T12:44:43.837

@prateek61>OK in that case it may be a drawback of packet tracer.Thanks prateek for trying out with actual switches and hub and giving a solution.This is just for summarizing my understanding.So you meant to say,flooding first and once the mac table is updated,switch will filter out for any further transmissions.correct na? – Poorvi – 2013-06-28T12:54:50.600

Yea - so the first packet caused a flood - then after a response the switch started filtering packets on the same side of the switch. – prateek61 – 2013-06-28T13:03:40.533

Answers

0

The explanation I can come up with is that the switch will be recording the MAC addresses of all frames that pass through it, per interface, not just those it delivers traffic successfully to.

The first time Fred talks to Wilma, since it's also flooded out to E0 due to the hub, at that point the switch puts that MAC in its CAM. So it knows at that point that Wilma's MAC is "behind" E0.

LawrenceC

Posted 2013-06-28T10:52:56.960

Reputation: 63 487

ockquote>

i agree .but at the point when frame reaches E0 of the switch,Wilma has not send any reply to Fred(ack-saying that i received the frame) via port P1 of Hub.So there is no way of getting mac address of wilma for the switch to update its mac table.Then how come it filters?

– Poorvi – 2013-06-28T13:01:52.850

Good point. Maybe port security or such is enabled on E1 and it is only allowing specific MAC's through? Maybe E1 is shutdown? – LawrenceC – 2013-06-28T15:51:11.140