Ip – Subnet masks vs. IP address ranges

ipip addressipv4protocol-theorysubnet

Let's say I have a network with 17 devices.

The minimum mask I could use to accommodate these 17 devices is 255.255.255.224 (i.e. /27), which itself can contain 30 useful addresses (excluding the broadcast and network address).

That means if I have only 17 devices, 13 useful addresses are wasted.

My question is: why not just use IP address ranges?

Why do the number of addresses in a network need to be a power of two?

For example, why not just say: Network A: 192.168.1.1 - 192.168.1.17 (inclusive)?

What are the disadvantages of this, apart from having to store 8 octets (the start address and the end address) instead of 4 octets (the subnet mask)?

Best Answer

Your idea of start and end addresses will slow routing decisions down a lot, and a packet may traverse multiple routers to get to its destination; mask and compare for equality uses far fewer CPU cycles than compare for >= AND <=. More CPU cycles equals more time and more CPU load. Using a mask is fast and easy to do in either software or special hardware (ASIC). You have to remember that routers switch packets individually, and a router must make the determination which way to switch a packet for each and every packet which passes through it, and each router through which a packet travels will need to do the same thing.

How can route aggregation work with odd sized subnets? The number of Internet routes is already out of hand, and the ISPs won't advertise any IPv4 prefix longer than /24.

Your idea adds unacceptable overhead and delay to packet switching. You also need to think about so tightly restricting subnets that there is no room for growth. If you have assigned 192.168.1.1 to 192.168.1.17 for subnet 1, and each subsequent subnet is equally restrictive, what happens when a manager on subnet 1 wants to add a printer, scanner, new PC, etc. Suddenly, you need to move everyone to a new, larger subnet, and you have an unused subnet that may never have a good fit, thereby wasting those 17 addresses.

This idea doesn't really solve any problems since even doubling the number of available IPv4 addresses will not even come close to fixing the IPv4 address shortage, and it adds considerably to router overhead and real world implementation support.

Keep thinking about things, but realize that there are many, many extremely intelligent people who live, eat, breathe, and sleep this stuff, and have for many years, with no thought but how to make it work better. Everything about IP is under constant review and can be changed if a consensus decides it should be. The proof is the demise of IP classes in favor of CIDR and VLSM.

Related Topic