3

A teacher told us about VLSM and "nested subnetting":

  • you should NOT use all-1 / all-0 subnets
  • the same public network you got, can be split up in subnetworks of different size / having different subnet masks
  • you can nest subnets, so that the same IP actually belongs to 2 subnetworks: in the example below the range of B is from 193.174.26.161 to 190, but C is nested inside from 193.174.26.189 to 193.174.26.190; furthermore B & C are nested in A
  • the aim of this is to waste less IPs
  • it is not supported by routers, but theoretically it would work

The teacher gave us examples with requirements like these:

  • you got 193.174.26.0 /24 from your ISP
  • A: 140 hosts
  • B: 20 hosts
  • C: 2 hosts
  • given: C should be nested in B

--> using equally sized subnets without nesting will not work

The solution:

┌───────┬──────────────┬──────────┬──────┬──────────┬─────────┬─────────┐
│network│net address   │last octet│suffix│first host│last host│broadcast│
├───────┼──────────────┼──────────┼──────┼──────────┼─────────┼─────────┤
│A      │193.174.26.0  │0000 0000 │/24   │1         │254      │255      │
├───────┼──────────────┼──────────┼──────┼──────────┼─────────┼─────────┤
│B      │193.174.26.160│1010 0000 │/27   │161       │190      │191      │
├───────┼──────────────┼──────────┼──────┼──────────┼─────────┼─────────┤
│C      │193.174.26.188│1011 1100 │/30   │189       │190      │191      │
└───────┴──────────────┴──────────┴──────┴──────────┴─────────┴─────────┘

I had never head about it and could not find very much information, so I have some questions about it:

  1. I think C is an all-1-subnet, am I right?
  2. What happens if a router (e.g. the router connecting the local network to the internet) receives a packet with target = 193.174.26.255? How does it decide, whether to route it to all hosts (everyone between 193.174.26.1 and 193.174.26.254, no matter, whether it is in subnet B or C) or just to the hosts, that are directly in network 193.174.26.0 (the root of the nested networks)
  3. Who will receive packets addressed to 193.174.26.191? All hosts in B including C or only the hosts in C?
  4. In general, even if you do not use VLSM and nesting, but you ALLOW all-0 / all-1-networks: How do you distinguish between the network / broadcast address of the "super-network" and the sub-network? (following the linked article it should work meanwhile)
  5. Does anyone use this technique in real life?

Cisco article about all-1 and all-0 subnets http://www.cisco.com/c/en/us/support/docs/ip/dynamic-address-allocation-resolution/13711-40.html

5
  • I don't understand what you mean by 'nesting'. Each network needs separate non-overlapping addresses. You can however create a route in your network that covers the addresses of multiple networks (aggregation). But you cannot have two networks with hosts on them with overlapping address ranges. Dec 14, 2014 at 20:13
  • Also, read up on CIDR: en.wikipedia.org/wiki/Classless_Inter-Domain_Routing. That is what is being used for the last 20+ years. The all-0 and all-1 subnets have not been special for a long long time. It sounds like your teacher is stuck in a pre-historic networking style ;) Dec 14, 2014 at 20:15
  • @SanderSteffann Yes, I know CIDR. Nesting implicates overlapping addresses. He said, it is usually not used, but it would be possible. Dec 14, 2014 at 20:19
  • Your teacher, unfortunately has made an error. You can't "nest" subnets. In fact, many routers will not let you configure addresses this way -- they will give you an error.
    – Ron Trunk
    Dec 14, 2014 at 20:24
  • @Jutta He's wrong. If you have two physically different networks with overlapping addresses then you have networking problems as the devices on the larger network will (correctly) assume that those addresses are on their local network. The routing will route to the smaller network (more-specific) Dec 14, 2014 at 20:25

2 Answers 2

4

"Nesting" (overlapping networks) requires proxy-arp and therefore SHOULD be avoided at all costs. No enterprise router will allow such a broken configuration -- each interface/subnet must be completely independent, which means out in the real world, where real IP addresses are routed, this method of "conservation" cannot be used. (aka: nonsense) [*]

It SHOULD not be attempted by anyone not thoroughly versed in networking. (i.e. if you haven't been designing, setting up, and maintaining large, complex networks for a decade or more, you shouldn't even be talking about this type of damage.)

(Full disclosure)
I'm doing this exact thing in an OpenStack development environment right now. 192.168.xx.0/24 has a /29 behind one of the machines in the larger /24. That machine has to have a number of specific, non-default setting changed to pretend to be hosts within the /29 slice. (aka proxy-arp) Yes, I can add a route for the /29 on the router, but the machines in the /24 still won't be able to talk to the /29 because their larger netmask means they're link-local; I'd have to add that /29 route to all the machines in the /24 for them to work.

All-0 and All-1
Those concepts haven't had any tangible meaning in modern networking for decades. Nothing you're likely to run into on the internet makes any assumptions about network size -- everything is classless now. Yes, there used to be issues using an all-0 (or 1) subnet -- say 199.72.0.0/24 (the first subnet from 199.72.0.0/16) (true story) -- because some random system on the internet (AIX) applied class logic to the range. Nothing does that today. So, with 199.72.0.0/16, the address range is 0.0 to 255.255 -- with the those too addresses being the /16's network and broadcast addresses. Those are always the /16's network and broadcast, even if a /24 were nested with it somewhere.

The active netmask ALWAYS defines the network and broadcast. Yes, that means a nested construct has multiple broadcast addresses, but due to different netmasks, nodes within different zones (sub-network, parent-network, ...) listen to different addresses. At layer-2 (ethernet), all hosts in the same domain (eg. vlan) see the same broadcasts but the host will filter out, at layer-3, the "foreign" broadcasts, unless they're sent to the "all nodes" broadcast address of 255.255.255.255.

[*] ISPs wanting to conserve space like this do it via bridging, but that has it's own problems.
[*] I warned my idiot ("we know more than you") coworkers not to use 199.72.0.0/24, but they did it anyway -- putting the webdev desktops in 0.0/25. A day later came the "What. Did. I. Tell. You." after complaints from every single person about random places on the internet they simply couldn't get. That was in 1997.

0
6

Your teacher, unfortunately, has made an error. You can't "nest" or overlap subnets. In fact, many routers will not let you configure addresses this way -- they will give you an error because they don't know which interface to use for a given "nested" address.

All your questions are good ones -- they point out the problems with trying to overlap subnets and why that won't work.

I can say that the answer to 5 is No.

12
  • What is about that, it is working, is it not? tcpipguide.com/free/t_IPVariableLengthSubnetMaskingVLSM-3.htm Dec 14, 2014 at 20:36
  • What is about question 4 (usual subnetting), how are all-1 subnets handled? Dec 14, 2014 at 20:39
  • 1
    No, that post is not describing nesting, but rather how you can dive subnets into smaller subnets. For example, you can divide a /24 into two /25, or divide a /25 into two /26s. But you can't divide a /25 into a /26 and then also use the /25.
    – Ron Trunk
    Dec 14, 2014 at 20:40
  • For a given subnet, all 1s in the host address is a broadcast address for that subnet. You can't distinguish the two all ones address which is one reason why nesting doesn't work.
    – Ron Trunk
    Dec 14, 2014 at 20:43
  • However you even have the problem, if you do not nest, just usual subnetting: public network: 193.174.26.0 /24 from your ISP; 2 subnets /25, the 2nd's broadcast is the same like that of the public network; in the article linked above S6's broadcast is the same like that of its parent Dec 14, 2014 at 20:45

Your Answer

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

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