cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8360
Views
0
Helpful
2
Replies

Ping to different Subnet.

subodh121
Level 1
Level 1

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.Image_1.bmp

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

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

View solution in original post

2 Replies 2

Jon Marshall
Hall of Fame
Hall of Fame

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

Thanks Jon, you made it clear with brief explanation.

Review Cisco Networking for a $25 gift card