1

I'm learning IP addressing and routing basics, but I'm facing a problem which I cannot understand, so i have the following structure:

enter image description here

Well in this situation, a ping from 130.190.0.16 to 130.190.4.30 works, which is obvious, but in the following structure:

enter image description here

I cannot ping from 130.190.0.2 to 130.190.4.30! I know that the masking is not coherent, but normally (based on the course I'm studying), the PC (130.190.0.2) makes a logical AND between 130.190.4.30 and 255.255.0.0, it finds 130.190.0.0, so it concludes that 130.190.4.30 is in the same network, so it sends an ARP request, searchig for the MAC@ to which belongs 130.190.4.30, the second PC responds, so the ICMP echo request will arrive to 130.190.4.30 successfully, then the latter will use the router to send the ICMP response to 130.190.0.2, so why it does not ping? PS: the default Gateway for the 2 PCs is 130.190.0.1 Thanks.

1
  • You should amend your question rather than changing it completely around so the answer doesn't make too much sense any more.
    – Zac67
    Jan 1, 2018 at 15:59

4 Answers 4

1

You didn't mention the mask on the left PC-PT, I'm assuming /16.

Ping works by sending ICMP echo requests and expecting echo replies in return. Now, when you ping from 130.190.0.16/16 to 130.9.4.30/24 the echo request will get there fine but when the reply is about to be sent, the local routing table indicates that it needs to be routed to the destination. In the absence of a viable router the reply packet can't be sent and is dropped.

After edit: as it is, the router is of no use. It's not located within 130.19.4.0/24, so it's out of reach from 130.190.4.30/24. If you change its IP address to 130.190.4.1 it'll work since it'll be located within reach from both PCs' perspectives. Alternatively and more conventionally, the router would have two IP addresses, one in each subnet. Since they overlap in this case, an IP address inside the overlap would work fine.

7
  • Yeah right, but I'v added a router and still! it does not ping! I edited the post please review Jan 1, 2018 at 15:29
  • The router needs to be within reach. As it's also (only) located in 130.190.0.0/16 it can't be used.
    – Zac67
    Jan 1, 2018 at 15:44
  • The router needs to have one interface on each subnet.
    – Ron Trunk
    Jan 1, 2018 at 15:48
  • @Zac67 What do you mean by the 'the router isn't within reach' ? Jan 1, 2018 at 15:59
  • @Ron Ah okey, would you please explain what really happens? Jan 1, 2018 at 16:00
1

The results are weird because your addressing is not correct. You have two hosts with overlapping address ranges. One host has a /16 mask. The other has a /24 mask, but it falls within the range of the /16:

130.190.4.30 is an address within the 130.190.0.0/16 subnet.

This is an incorrect configuration. Your hosts need to be on two separate subnets (i.e. without overlapping addresses), or they need to be on the same subnet with the same mask.

Two hosts on the same subnet should agree on the mask. For example, you can change the PC on the right to have a /16 mask. Then your PCs can ping each other.

If you want two hosts on different subnets (ex., change the right pc to 130.191.4.30/24), then you need a router to route between the two subnets. The router needs to have an interface in each subnet. You also need to set your default gateway on each PC to the address of the router interface on that subnet.

2
  • Yes, I'm convinced that the addressing is not coherent, but i wondered what is really happening to prevent this ping from happening. I understand from @Zac67 answer that the ping request arrives without problems to it's destination, but the reply is not even routed through the router because the latter is not in the same sub-net even if it is present in the right PC-PT's routing table. Jan 1, 2018 at 17:38
  • Left PCs address is not in right PCs routing table, so it doesn't know where to send it.
    – Ron Trunk
    Jan 1, 2018 at 18:35
0

As per Newbie perspective:

130.190.0.2/16 This IP uses CIDR /16, 16 bits represent Network ID Available hosts are 65534
130.190.4.30/24 This IP uses CIDR /24, 24 bits represent Network ID Available hosts are 254

Both can be considered to be in a different networks. To make this work, do static configuration in router for /24.

Regards, Raghavendra.

1
  • Well a machine that has an IP of 130.190.4.30 is considered to belong also the the sub-net 130.190.0.0/12, because 130.190.0.0/16 overlaps 130.190.4.0/24 Jan 2, 2018 at 10:30
0

Look at it from the perspective of 130.90.4.30. It thinks it's on the network 130.90.4.XXX. If it wants to send something to 130.90.0.2 (or to ANY other address not on 130.90.4.0/24), it needs to have a gateway on it's network, i.e. 130.90.4.1 using the standard of .1 for gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.