09-08-2006 01:42 AM - edited 03-03-2019 04:52 AM
In a layer 2 switch The diffrent networks can't communicate. i think the switch use only MAC address for taking forwarding dicision my qustion is that how will switch identify the diffrent networks. Because it is a layer 2 device it works the basis of MAC address
09-08-2006 01:58 AM
hi...
just think about how ARP works... you will automatically get your answer... even though to make communication between device it need to have MAC address but how one host can have the MAC of the other host for communication...?
how Address resolution will work in ARP...
rate this post if it helps
regards
Devang
09-08-2006 02:43 AM
Hi,
You are right! A layer 2 switch can't help in the communication between two different networks! It just can't do it, to facilitate that you need either a router or a layer 3 switch. You are again correct when you say that you think it uses MAC address for taking the forwarding decision.
The switch cannot identify different networks!!! If two different networks are connected to the same layer 2 switch, for it there is no difference between the two networks.
Hope this helps!
Regards,
AbhisheK
Please rate all helpful posts!
09-08-2006 03:19 AM
It's been pretty well said , if you take a layer 2 switch say a 2950 and you define mulltiple vlan (networks) and put the users into all these different vlans they cannot talk to each other because they would have to be routed at this point , so the traffic would have to be sent up a trunk to a layer 3 switch and or router to be able to talk to each other . The gateway for each of these networks would be defined on the router or l3 switch and all user devices within that vlan (subnet) would point their default gateway to that interface...
09-08-2006 03:21 AM
Hi,
Switches forward frames based on destination mac-address.
and they build their forwarding database based on the source-mac-address when they recieve frames
When a switch doesnot have the destination mac-address in its forwarding database it broadcast through all its ports out except on port it recieved the frame.
It also uses the mac-address of the router(gateway) to forward frames which belongs to other network.
HTH
Thanks
Raj
09-08-2006 04:20 AM
Minor correction: Unknown destinations MACs cause the switch/bridge to FLOOD, not broadcast.
With a broadcast, the destination is all ones, in a flood, the destination MAC is left intact, hopeing that the intended recipient hears the frame and responds.
Good Luck
Scott
09-08-2006 03:39 AM
If the device is looking for an address off the local network it will need to go to the default gateway, this is typically the router (L3 device).
The L2 switch doesn't understand any of this, it just learns which interface to use to reach a particular mac address or broadcasts out all interfaces.
Go back to the host and see what its gateway is.
09-08-2006 04:34 AM
Hi,
just as an info, two hosts (f.e. PCs) on the same VLAN can communicate with each other without router even if they are not in the same subnet. The trick is to use the PC routing table (route print) and set the host IP also as default gateway IP.
PC1:
192.168.1.1 !IP
255.255.255.0 !Mask
192.168.1.1 !default GW
PC1:
10.1.1.1 !IP
255.255.255.0 !Mask
10.1.1.1 !default GW
Both PCs will arp for any IP (they are default gateway!) thus ping 10.1.1.1 will work from PC1. In a router you get a similar behaviour by configuring f.e.
ip route 0.0.0.0 0.0.0.0 ethernet0
Hope this helps! Please rate all posts.
Regards, Martin
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide