Can computer A talks to Computer B?

Answered Question
Mar 24th, 2009

Maybe this is stupid question. But I really need you help. Please see attachment. Can computer A talks to computer B? If yes or no, please give explanation. Thanks.

Attachment: 
I have this problem too.
0 votes
Correct Answer by rpfinneran about 7 years 7 months ago

Absolutely A should be able to talk to B. This question confuses many people, but if the link between Sw1 and Sw2 is NOT a trunk, then A can talk to B.

Why? Okay, when A wants to talk to B it does a calculation and finds that B is on the same subnet. So, A would then ARP for B. The ARP comes into SW1 on Vlan8, thus SW1 would broadcast the ARP out all interfaces in Vlan8 (including the connection to SW2 if it is not a trunk, thus untagged). So, then the ARP comes into Vlan9 in SW2 (keep in mind it is not tagged since this is an access link). SW2 will then broadcast the ARP to all interfaces in Vlan9, which would include computer B. The reply would flow in a similar fashion.

See the attachment. Hope this helps,

Ryan

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Leo Laohoo Tue, 03/24/2009 - 22:57

Nope because the link between switch 1 & 2 are on different VLANs.

You can get it to work by making this a Trunk link and allowing the two vlans.

guo6688 Wed, 03/25/2009 - 01:31

Thank you for your quick reply. But my question is why this different VLAN interconnection can prevent their communication. Please see attachement. I put a hub in between. So the computer A can talks to computer C. Computer B can talks to computer c as well. What mechanism (vtp, stp or else?) prevent computer A from talking computer B?

Attachment: 
Leo Laohoo Wed, 03/25/2009 - 15:02

Computer C can talk to A because the data packet is tagged with VLAN 8. VLAN C can talk to B because data packet is also tagged with VLAN 9.

Computer B can't talk to A (and vice versa) because their data packet tagging is not the same. It's like talking to your office mate when you can speak Cantonese and your office mate can only speak in German.

If you want Computer A & B to talk to each other, you can either make one of the switch have the same VLAN or you configure VLAN Trunking.

Creating Ethernet VLANs on Catalyst Switches

http://www.cisco.com/en/US/tech/tk389/tk689/technologies_configuration_example09186a008009478e.shtml

guo6688 Fri, 04/10/2009 - 05:15

Thank you very much, Leolaohoo.

From my understanding when the frame enter switch it is tagged by VLAN NO and when it exit switch the VLAN tag is removed. Therefore I think when computer B talks to computer A, its frame has no VLAN tag 9 when it exits switch 2. And when the frame enters switch 1, it retages with VLAN 8. This is similar to computer C talking to computer A. My point is when the frame leaves the switch the VLAN tag is removed. Is this correct?

Thank you again. I am thinking this for long time. But still not clear.

Correct Answer
rpfinneran Sat, 04/11/2009 - 03:36

Absolutely A should be able to talk to B. This question confuses many people, but if the link between Sw1 and Sw2 is NOT a trunk, then A can talk to B.

Why? Okay, when A wants to talk to B it does a calculation and finds that B is on the same subnet. So, A would then ARP for B. The ARP comes into SW1 on Vlan8, thus SW1 would broadcast the ARP out all interfaces in Vlan8 (including the connection to SW2 if it is not a trunk, thus untagged). So, then the ARP comes into Vlan9 in SW2 (keep in mind it is not tagged since this is an access link). SW2 will then broadcast the ARP to all interfaces in Vlan9, which would include computer B. The reply would flow in a similar fashion.

See the attachment. Hope this helps,

Ryan

Leo Laohoo Sat, 04/11/2009 - 03:46

So are you saying that A can ping B even though they are on different VLANs and the interlink is NOT a trunk?

rpfinneran Sat, 04/11/2009 - 03:49

Exactly right. Because the link is not a trunk, SW2 isnt aware of which VLAN A is in, and vice versa.

Tagging only occurs on trunk links, and thus the two switches have no idea what VLAN's exist on eachother.

scottmac Sat, 04/11/2009 - 05:07

VLAN tags are stripped when traffic leaves a switchport.

If the addressing is correct for the function, traffic passes.

rpfinneran Sat, 04/11/2009 - 20:30

Just to clarify...

VLAN tags are stripped when traffic leaves an access port.

viyuan700 Sat, 04/11/2009 - 20:58

Hi Ryan,

As per my understanding there is no tag involved here but CAM table has 3 entries MAC, VLAN, Port on the basis of which it switches.

I agree with ur nice explnation that when A wants to talk to B and sends out an ARP and it reaches switch 2 vlan 9. Host B on switch 2 in vlan 9 answers that ARP.

Sw2 have entry of host B MAC with vlan 9. When sw2 pass this info to sw1 that MAC address of B (mapped to IP)is on vlan 9.

after all this learning Switch 1 has to decide it has A MAC in vlan 8 and it has MAC of B with VLAN 9.

Now my question is will Switch 1, switch this frame or do something else as MAC match but not the Vlanin the CAM.

rpfinneran Sat, 04/11/2009 - 22:28

Your understanding is close.

"Sw2 have entry of host B MAC with vlan 9"

ANS: True, Sw2 sees the MAC of B in Vlan9.

"When sw2 pass this info to sw1 that MAC address of B (mapped to IP)is on vlan 9."

ANS: Not quite. The ARP reply leaves Sw2 (vlan9 interface to SW1), but is not tagged. So, when the frame arrives at SW1 it comes in on Vlan8, thus SW1 adds MAC entry for B to Vlan8.

"after all this learning Switch 1 has to decide it has A MAC in vlan 8 and it has MAC of B with VLAN 9"

ANS: Nope, they are both in Vlan8 on Sw1 and both in Vlan9 on Sw2. This is referred to as bridging Vlans, and can have some serious negative consequences as you have now merged two different broadcast domains.

"Now my question is will Switch 1, switch this frame or do something else as MAC match but not the Vlan in the CAM."

ANS: As per my answers above, Sw1 will switch traffic just the way a switch should. So, since both MAC's are in Vlan8 on SW1, then it will switch frames from A to SW2. SW2 has both MAC's in Vlan9 and thus would switch this traffic to B.

I hope I am making this clear. If not, lab this up and sniff traffic between the two switches and you shall see.

guo6688 Sun, 04/12/2009 - 03:29

All mates, thank you for your answers and explanations. This is very tricky question and I really met this situation in real environment and felt very interesting. My personal view is same as rpfinneran. But in order to verify lab may need to be setup for testing.

Anyway, thank you all and happy Easter!

rpfinneran Sun, 04/12/2009 - 03:32

I could save you the time. I addressed this question a few years ago and labbed it up to see...

It is a hard question only because it is so easy, it is just fundamental L2 switching.

Actions

This Discussion