03-04-2010 07:15 AM - edited 03-03-2019 05:52 AM
Hello All,
I have two machines---Host A ( 10.1.1.1/8 ) & Host B( 10.1.1.2/24 ) connected to a Layer 2 switch. Where this Layer 2 switch is connected to a Router A. What will be the steps if I have to ping Host A to Host B, we wont be able to ping because both are in different subnets. But still how Host A would come to know this. Would that traffic go to Router or Layer 2 switch would send it directly to Host B.
Solved! Go to Solution.
03-04-2010 01:06 PM
subodh121 wrote:
Hello All,
I have two machines---Host A ( 10.1.1.1/8 ) & Host B( 10.1.1.2/24 ) connected to a Layer 2 switch. Where this Layer 2 switch is connected to a Router A. What will be the steps if I have to ping Host A to Host B, we wont be able to ping because both are in different subnets. But still how Host A would come to know this. Would that traffic go to Router or Layer 2 switch would send it directly to Host B.
Subodh
Actually they should be able to ping each other via the L2 switch.
Host A sends traffic to Host B.
Host A works out it's own network by using it's IP address and it's subnet mask - 10.1.1.1 255.0.0.0 means the network is 10.0.0.0
Host A then compares Host B's address with it's own subnet mask - 10.1.1.2 255.0.0.0 means host A thinks host B is on 10.0.0.0 which is the same network. Note host A has to use it's own subnet mask in this comparison because it doesn't know what subnet mask host B is configured with.
So because Host A thinks B is on the same network it just arps out for it.
When host B replies to Host A it does the same comparison as Host A did ie.
B's IP = 10.1.1.2 255.255.255.0 so it is on network 10.1.1.0. B compares A's IP with it's own subnet mask - 10.1.1.1 255.255.255.0 so B thinks A is on 10.1.1.0 which is the same network. So it can talk directly with A via the L2 switch.
So even though they have different subnet masks they both think they are on the same subnet.
Jon
03-04-2010 01:06 PM
subodh121 wrote:
Hello All,
I have two machines---Host A ( 10.1.1.1/8 ) & Host B( 10.1.1.2/24 ) connected to a Layer 2 switch. Where this Layer 2 switch is connected to a Router A. What will be the steps if I have to ping Host A to Host B, we wont be able to ping because both are in different subnets. But still how Host A would come to know this. Would that traffic go to Router or Layer 2 switch would send it directly to Host B.
Subodh
Actually they should be able to ping each other via the L2 switch.
Host A sends traffic to Host B.
Host A works out it's own network by using it's IP address and it's subnet mask - 10.1.1.1 255.0.0.0 means the network is 10.0.0.0
Host A then compares Host B's address with it's own subnet mask - 10.1.1.2 255.0.0.0 means host A thinks host B is on 10.0.0.0 which is the same network. Note host A has to use it's own subnet mask in this comparison because it doesn't know what subnet mask host B is configured with.
So because Host A thinks B is on the same network it just arps out for it.
When host B replies to Host A it does the same comparison as Host A did ie.
B's IP = 10.1.1.2 255.255.255.0 so it is on network 10.1.1.0. B compares A's IP with it's own subnet mask - 10.1.1.1 255.255.255.0 so B thinks A is on 10.1.1.0 which is the same network. So it can talk directly with A via the L2 switch.
So even though they have different subnet masks they both think they are on the same subnet.
Jon
03-04-2010 05:13 PM
Thanks Jon, you made it clear with brief explanation.
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