1

This is probably a un-realistic question, but a question nonetheless, that has been bugging me since quite a while now. Consider the below network diagram, where R1 is a part of a 10.0.0.0/8 network (subnets are indicated by ovals), and it further splits the network into several /16 networks, one of which is 10.1.0.0/16. Now the interfaces for the routers (denoted by the green links) have the addresses 10.1.0.1 for R1 (the first IP in the subnet) and 10.1.0.2 for R2. Further, R2 splits the /16 network assigned to it into two /24 networks. The logic is similar. enter image description here

Coming to the question, if we look at the link between R1 and R2, of the available 2^16 host addresses available in that subnet (due to /16 mask), only two are used for the router interfaces. What would happen to the rest addresses in that subnet? Since R2 would have to use up some bits more than than the 16 available ones in its subnet, to create further subnets, will the subnet between the R1 and R2 go into a black hole and never be used again?


Edit: Updating the diagram after discussion in the comments. I am now removing the extraneous part from the problem and only keeping the relevant network that I am having my question about.

Basically subnet/CIDR literature online tells me that you can further divide the assigned network range into smaller by borrowing the network bits from the assigned mask. That is what R1 and R2 are doing, as seen in the diagram. I am really confused as to whether this is an overlap and if so, how to avoid it, also, what should R1 and R2 advertise.

Any help in clearing this concept will be greatly appreciated.

Update #2: This article EXACTLY demonstrates what I am trying to achieve -- https://cse.buffalo.edu/~hungngo/classes/2010/589/reading-materials/IP-addressing2.pdf though, it mentions VLSM which I reckon is similar to CIDR, but for classful networks.

enter image description here


Update: (Final solution)

After discussion with all the esteemed members, it seems that, the only problem with the initial diagram was the wasted address space. Also, there are some CIDR-specific precautions to be taken while assigning addresses to hosts, to avoid routing problems. Keeping all this in mind, I have made a final diagram that uses link subnets of /30 and advertisements accordingly.

enter image description here

Elaborating the diagram even more to add some hierarchy:

enter image description here

7
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Ron Maupin
    Oct 13 at 17:04
  • 2
    Your last edit substantially changes the situation: before it looked (to me) like you advertised 10.0.0.0/8 to your other routers. With the bottom diagram, you're advertising 10.0.0.0/8 to the outside world.
    – Zac67
    Oct 13 at 18:22
  • Yes, that is indeed the case. I simplified the diagram to show what I mean. Apologies for confusion Oct 13 at 18:27
  • I have now added a modified diagram incorporating your suggestions regarding link subnets and CIDR precautions. Please, let me know if my understanding is now correct. Oct 14 at 12:55
  • @aditya_medhe You should write your own answer using your updated diagram. That way, others can benefit from your knowledge.
    – Ron Trunk
    Oct 14 at 13:01
5

Yes this is wasteful. The remaining IP addresses are lost.

This is why we usually configure a /31 on such link.

(Well actually if this /16 subnet is not announced to the other routers, technically it could be used somewhere else, but this would be a very dirty configuration).

11
  • Thank you for your answer. One follow-up question: by "usually configure a /31 on such a link", won't we create extremely small subnets which we would not be able to further divide? Am I missing something here? FYI I learnt subnetting recently, so there might be gaps in my understanding Oct 11 at 8:09
  • On a link between two routers (what we call a point-to-point link) there cannot be anything else. So we don't need to subnet it so we use a /31.
    – JFL
    Oct 11 at 8:11
  • Let's say we configure 10.1.1.0/31 instead of 10.1.0.0/16, how would the traffic destined for the IP 10.1.0.100 for example, reach? As I understand the IP addresses are hierarchical so if we flatten the hierarchy by assigning a /31 address, how can we un-flatten it again? Could you point me to a source where I can find more about it please? Oct 11 at 8:21
  • first: IP addresses should be hierarchical, it is not a must. Every routing protocol can work with non-hierarchical addresses. It will result in huge tables, and possibly extra resources for routing protocol, but it is in theory possible. second: every link should have a different subnet. otherwise if you have overlapping addresses on two links, how would routers know where to send packets to these addresses. in your figure your routers would not know whether to send traffic 10.1/16 to orange red or green, or worse, they will think differently. A hierarchy allows to aggregate addresses if
    – Effie
    Oct 11 at 9:47
  • several addresses are routed over the same interface. for example, R1 can aggregate all addresses advertized by all your subnets, and send only one to the outgoing interface (away from r2/r3). R2 could announce only one address to R1 which covers both R3 and R4. I however think you have to specially configure your system to do this. A single link, between R1 and R2 cannot be aggregated on either R1 or R2 anyways. So, if you want to use hierarchy, you have to select appropriate network address for this /31, so that the address can be aggreagated.
    – Effie
    Oct 11 at 9:56
2

The consensus after discussing with the esteemed forum members is that the link subnets (subnets between two routers) are wasteful: since there are only two devices on the interface, there is no need to have a /16 or /24 subnet.

A key concept I was missing was: to denote hierarchy and break the network down into smaller divisions progressively, it is not needed that the subnets are contiguous and attached to each other. The subnets that are to contain hosts and (have progressively smaller masks like /16, /24, /26 and so on) can be in a hierarchy, but the links connecting the routers can be a part of a smaller /30 or /31 subnet.

The hierarchy and the routing can be configured by using the appropriate advertisements and route tables.

For using the subnets in the links between two routers, a subnet can be reserved especially for this purpose. In our example below, the company reserves a /24 subnet especially for carving out /30 subnets as needed for the links.

enter image description here

Appreciate the help and patience of the forum members @Zac67, @RonTrunk, @JFL, and @Effie

0
1

They are "currently unused". On a link where there will never be many nodes, one would never use a /16. Even a /24 would be wasting >90% of the space. It's common practice to use /30 (or /31 if the hardware supports it) for point-to-point links. (Personally, I've used /28 and /29 internally for "device" networks, but your needs may vary.)

1
  • Thank you, can you show me an example of hierarchical subnetting with /31 links in between? I'm facing a tough time picturing it Oct 12 at 1:49
1

This is not a direct answer to the question, but judging from the comments, I think there is a confusion between address aggregation and address assignment.

update: i think you can think of this in terms of disjoint sets and set unions. Each subnet is a set of IP addresses. All subnets must be disjoint, that is each subnet is unique. Hierarchy works on unions, not individual sets. That is, when a union of sets can be aggregated by a single address, summarization is possible. So, R1 can summarize a union of orange, green, and red (and whatever is behind R3 and R4). R2 could summarize a union of green and red.

update2: Can you draw your picture with orange spanning the whole network, red spanning link between R2 and R3 and whatever is behind R3, and identical for green. Each layer 2 segment within the network has to have a unique address/mask. But your addresses are summarizable on circle boundaries.

(1) Route summarization works only in one direction. R1 can summarize routes if all routes to addresses 10.1.*.* This means that routers outside of your picture will learn only one address to 10.1../16 via R1. In contrast, without summarization, they could learn routes to 10.1.100., 10.1.200. separatelly. Route summarization does not affect what happens inside, and what happens inside does not have direct effect on route summarizaiton.

Further, R1's ability to do this does not require anything within your network to be actually hierarchical. It only requires all addresses to match 10.1.*.* (and no other parts of network to have addresses that match). No matter how you assign your addresses within your network, this will not change.

Having a link between R1 and R2 have /30 or /31 address does not prevent R1 from summarization.

(2) IP interconnects layer 2 segments. Thus IP differentiates between systems, reachable directly using layer 2 and systems, not reachable, where the address has to be actually forwarded (here routed would mean ~ the same). If an interface has an address 10.1.0.1 and mask 255.255.0.0, IP can assume that all addresses that match 10.1.*.* are local, and not forwarded. This means, that 10.1.*.* should be delivered using layer 2 of the corresponding interface (for IP -> do ARP, get mac address, and send packet to the mac address)

In this sence, a configuration where 10.1.*.* are local, but 10.1.100.* has to be forwarded, although could make sence from longest prefix match point of view, is actually incorrect. I can't find any specification which says what exactly will happen. I think it is safe to say, that it is unclear whether this will work or not.

So, you can have a routing table: 10.1.100.* -> interface 3 via R_X (forwarded), and 10.1.*.* -> interface 2 via R_Y (again forwarded) (this will be resolved using longest prefix match), but you cannot have a situation 10.1.100.* -> interface 2 via R_Y (forwarded), 10.1.*.* -> interface 2, local.

(3) also IP does not know that the link between R1 and R2 is a cable. If the cable is ethernet, there is also no guarantee that it remains this way. You could replace it with a switch, and plug 2 routers and N hosts to the switch. If you do this, and these N hosts are in network 10.1.*.* they can in theory have any IP within this network, including 10.1.100.1. If this happens your overlapping subnets will cause problems.

Thus it is recommended to use /30 or 31/ addresses, because they only allow 2 systems in the subnet, and if you try to get a third one in, it won't work.

(4) As an example, let's consider a situation where you want to have route summarization on R2 as well. R1 is already summarizing routes.

  • note, that R1 and R2 cannot summarize the link between each other. they have to learn about this link. Let's assign 10.1.0.0/31 to the link (so that 10.1.0.0000 000* (last one binary) are assigned to this link.

R2 has two networks, green and red, and it wants to summarize addresses. To do so, these networks have to have addresses that have a common prefix, and this prefix should not overlap with the link above. Since you have all 10.1.*.* to choose from, let's assign them addresses that match arbitrary 10.1.1*** ****. **** **** (which is 10.1.128.0/17). Then red one can get 10.1.10 ** ****.* and green one gets 10.1.11 ** ****.**** ****, or 10.1.128.0/18 and 10.1.192.0/18 Then R2 can announce a single address 10.1.128.0/17 to R1. R2 cannot announce it to anyone else, because it has to be able to route between green and red. [please verify my binary to decimal convertion!]

Now, in red zone there is a link between R2 and R3. We can assign it a /31 address that matches 10.1.128.0/18, or 10.1.10** ****.**** ****. Let's use all zeroes and have 10.1.1000 0000.0000 000* or 10.1.128.0/31. All other addresses can be assigned to whatever is behind R3.

So, this is what you do when you assign subnets. Each subnet has a unique address. However all subnets who are summarized, can be covered by a unique address with a shorter prefix.

Which brings me to final notes

(5). When route summarization can be performed actually depends on your protocol. Distance-vector protocols can do it everywhere, link state routing can not. Link state routing protocols have to know the topology, thus route summariation cannot be performed. OSPF divides its domain into separate areas, where each area does link-state routing separatelly, but inter-area communication is not done based on link-state approach. OSPF can only do summarization on area boundary. There are more complicated cases with external routes and route re-distribution, but they follow the same pattern. There are "border" routers, which can get routes from outside of the area and inject them in the area. Route summarization can only be done by such a router.

(6) route summarization is not the same as keeping small tables. Route summarization affects information exchanged by a routing protocol itself. Even if your routers use OSPF and cannot actually summarize anything, they would (i think) still be able to have fewer entries in routing tables.

P.S. I use the notation .0100 0000. as a binary representation of the octet in IP address. And * in address to represent, that a bit can have arbitrary value, i.e., it is not covered by prefix length. 10.1.10** . **** is an ip address where first 8 bits are decimal 10, second 8 bits are decimal 1, and the rest 2 octets are in binary notation, where the third octed must start with 10 and have all other bits arbitrary or irrelevant.

17
  • markdown has replaced some of my *, i hope i found all places, but something can still make no sense.
    – Effie
    Oct 13 at 14:12
  • 1
    The router "above" R1 can have a summary route 10.0.0.0/8 pointing to R1. with static routes, there is no "advertising."
    – Ron Trunk
    Oct 13 at 14:39
  • 1
    This should go in your answer
    – Ron Trunk
    Oct 14 at 14:37
  • 1
    from my point it makes perfect sense. to be safe let's wait for more experienced folks to review :) I hopy you now understand the difference between your original post and final update.
    – Effie
    Oct 14 at 14:39
  • 1
    The way to do this is to write your answer, and let people comment/correct it. that way everyone can see the process.
    – Ron Trunk
    Oct 14 at 14:47
1

I think you might be confusing route aggregation and actual subnet usage.

where R1 is a part of a 10.0.0.0/8 network (subnets are indicated by ovals), and it further splits the network into several /16 networks,

This will not work (without fine tuning). When 10.0.0.0/8 is used on one interface, that includes all of the subnets as well.

(from comment) The 10.0.0.0/8 is not a router interface for R1, rather, it advertises the aggregated route. The 10.0.0.0/8 has been assigned to the R1 to split up further.

Of course, you could have a general (aggregated) "10.0.0.0/8" gateway/route from the perspectives of R2/R3/R4, where all its possible subnets of 10.0.0.0/8 are behind (north of) R1, but do not use that subnet itself on any of the R1's interfaces. That logic would also prevent any addresses from 10.0.0.0/8 to be used anywhere else unless you use metric tuning to make that work - perhaps not such a good idea.

Using an aggregated 10.0.0.0/8 route for the subnets north of R1 is possible, but to avoid routing ambiguity you need to make sure that the visible 10.1.x.0 subnets always get a better (lower) cost/metric than the 10.0.0.0/8 route. A better choice would be only 10.0.0.0/16 north of R1.

The R1-R2 subnet 10.1.0.0/16 and the lower subnets 10.1.100.0/24 and 10.1.200.0/24 have the same problem. Likely, R2 will not allow you to bind these addresses/subnets in that way since they overlap. You should always make sure that none of your subnets overlap, regardless of where they are attached. If there's routing ambiguity if will land on your feet sooner or later.

What would happen to the rest addresses in that subnet?

Nothing. You cannot use them elsewhere without causing routing problems.

Using full /24 or even larger subnets for a pure link segment is extremely wasteful. When you're sure that no other devices need to attach to that segment you should only use a /31 subnet. For simplicity, you could use those /31 subnets that you split off from a single /24 subnet you've reserved for that purpose.

Looking at your diagram, you should consider location-specific supernets behind each gateway for better structure (10.1.0.0/16 behind R1, 10.3.0.0/16 behind R3, 10.4.0.0/16 behind R4) and use point-to-point subnets between them (10.255.0.0/31, 10.255.0.2/31, 10.255.0.4/31).

''Behind each gateway'' refers to the scope attached to a router that is not visible to other routers. Of course, you don't use a /16 in whole but create subnets from it. In any case, that way you can use a simple, aggregate /16 route from the other routers/locations.

11
  • All the route summarization/aggregation articles (for example this one) start with a large /8 subnet, and it is made more and more specific (/16, /24, etc) as we go down the hierarchy. So, 10.0.0.0/8 includes addresses from 10.0.0.0 - 10.255.255.255, whereas, 10.1.0.0/16 would include addresses from 10.1.0.0 - 10.1.255.255. I do not understand what I am missing :( Oct 11 at 15:36
  • Normally, you don't start out with a subnet that you already have in active use but with a range that has been assigned to you or that you have reserved in the past. From that you split off what you currently need and save the rest for later. Downsizing a subnet in use requires renumbering the hosts in that subnet and that's nothing you take lightly.
    – Zac67
    Oct 11 at 15:52
  • I provided an example for hierarchical addressing in your other question, where I start out from the "global scope" that I don't directly use anywhere but that represents the address range I'll work with for many years to come - and I'd want to make the best of it.
    – Zac67
    Oct 11 at 15:57
  • 1
    @aditya_medhe Yes, you need to advertise 10.0.0.0/8. That is why the addresses you have chosen are so problematic -- they don't allow efficient summarization.
    – Ron Trunk
    Oct 13 at 14:42
  • 1
    Looks much better, especially with a better understanding of your intentions on my side. ;-)
    – Zac67
    Oct 14 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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