1

I just learnt about this concept and I have a query which was also asked by someone earlier but was grossly misinterpreted.

Suppose my Router has Routes for Networks: 192.168.22.0/23 and 192.168.22.0/25 in its routing table and if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet but what if the Destination Network doesn't have the intended IP Address according to my Schema.

Wouldn't it cause connectivity/ packet drops and break my network?

I, as a Network Engineer, would have to setup my network by giving the Overlapping IPs Uniquely to the 192.168.22.0/25 Network or is it sorted/ handled in a different manner?

Please keep in mind that I understand that I cannot configure Networks/ IP Addresses with overlapping subnets on the same router and the topology in consideration is kinda like a router connected to 2 other routers and they are connected to these networks respectively.

1
  • If your destination network doesn't have the intended IP or a route to it, then the packet will be dropped Commented Feb 9, 2022 at 5:22

3 Answers 3

1

If a router does not have a route to the destination network, it will drop the packet. If the network is directly attached, the router will arp for the MAC. if there’s no response it will send a ICMP host unreachable message.

Don’t confuse routes with subnets. You can have overlapping routes but not overlapping subnets. So 192.168.22.1 can only exist in one subnet.

5
  • Hey Ron, so I would have to keep it in mind right otherwise my packets will get dropped due to poor network topology planning?
    – user464141
    Commented Feb 8, 2022 at 21:28
  • If your subnets overlap you’ve built an invalid network.
    – Ron Trunk
    Commented Feb 8, 2022 at 21:30
  • Thanks for the quick response, My subnets have not overlapped and the IP addressing is uniquely done, my query was that if my packet goes to that particular network/ subnet due to overlapping routes, and I have not used that particular IP Address in that subnet, wouldn't that cause a problem?
    – user464141
    Commented Feb 8, 2022 at 21:32
  • Basically, my packet is not reaching the intended user.
    – user464141
    Commented Feb 8, 2022 at 21:33
  • That means you have incorrect routing information. You will need more specific routes to forward the packet out the right interface
    – Ron Trunk
    Commented Feb 8, 2022 at 23:45
1

if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet

Yes, that's how it works.

what if the Destination Network doesn't have the intended IP Address according to my Schema

Then your network design is flawed.

Sometimes, overlapping prefixes are OK - but they might not be. It all depends on your overall design.

Having different gateways for 192.168.22.0/23 and 192.168.22.0/25 means that you want packets for 192.168.22.0/25 go one way and all other packets from 192.168.22.0/23 go the other way. Effectively, 192.168.22.128/23 works here as a summary route for 192.168.22.128/25, 192.168.23.0/25, and 192.168.23.128/25 - if you're using all of them with /25 subnets.

Note that you cannot have any IP address from 192.168.22.0/25 behind the 'other way' router. You do need to keep your addressing unambiguous and cannot have overlapping subnets, whatever you do.

A scenario where that routing might make sense is a branch router that attaches 192.168.22.0/23 to a larger network. It's got an uplink (possibly towards 192.168.0.0/16) and a directly attached subnet 192.168.22.0/25. Within that subnet is a layer-3 switch that routes between the other local subnets from 192.168.22.0/23.

Overlapping prefixes may be counter-intuitive, so you might want to avoid them altogether. After all, somewhat modern devices usually don't mind a few more or less routing entries, and being transparent and avoiding human error may be much more important.

0

Routing is very very deterministic, and routers cannot guess where to send a datagram. If a routing table has two or more than two paths toward a destination, it uses the longest match and other methods to break a tie.Routers cannot have overlapping networks that conflicts. If a router has no path, even a default route, toward a destination, it drops the packet as undeliverable. Routers route packets between networks, not from a network back to the same network, so router interfaces must be in different, non-overlapping networks.

2
  • Hey Alok, my router interfaces are in different/ non overlapping subnets as the subnet mask is different. I was simply trying to understand that lets say Router A & B are connected to Router C (routes of which are in consideration) Router B is connected to Network 1 and Router A is connected to Network 2. Both the Networks have some IP Overlapping but there's no IP Conflict, so due to Longest Prefix Matching, the packet is routed to Network 1 instead of Network 2, where I have used that IP Address.
    – user464141
    Commented Feb 8, 2022 at 21:40
  • router C maintain two routing table for router Aand B. Whenever packets come in router C, it conflicts(due to address overlapping) where to send router A or B , but router couldn't determine uniquely and silently discard the packets.
    – S. M.
    Commented Feb 8, 2022 at 21:48

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.