Number of subnets for specific mask

2

Question source

Problem: Your company has been assigned the following IP address: 192.112.136.0 /27
Your group has been assigned the fourth subnet.

Question 5: How many useable subnets are available for assignment?

Why the answer is 6? I would shoot it's 8 , because 255/32 = 8.
More generally - what is an correct algorithm to compute the number of available subnetworks for the same mask?

0x6B6F77616C74

Posted 2012-07-08T14:57:41.457

Reputation: 293

http://en.wikipedia.org/wiki/Subnetting#Subnet_and_host_counts – Der Hochstapler – 2012-07-08T15:39:06.213

1

another useful reference... CIDR calculator

– JoshP – 2012-07-08T15:40:24.293

Answers

6

First of all 192.112.136.0 /27 is not an IP adress. It is an IP and netmask.

Writing Your company has been assigned the following IP address: 192.112.136.0 /27 seems careless. Definitively not what you would expect from exercises or textbooks.

Back in the dawn of time IP networks had 32 bits to identify themselves. Part of those 32 bits where used to identify the network. Part of them to identify the host on the network. Networks in that time mostly used 8, 16 or 24 bits for the network and where called resp. class A, class B or class C networks. Technically no netmask was needed since you could calculate what is should be from the IP address.

That was the past. In the last decade we moved to a more flexible approach called Classless InterDomain Routing.

Your 192.112.136.0 /27 is a CIDR notation. The /27 indicates which part of the address is the network. In other words, the /27 defines which part of the address is used to indicate the network, and which part of for the host 27 bits are most easily read as:

---8--- ---8---- ---8--- --3-5---
Network Network  Network net host

with the first 27 (8+8+8+3) as the network identification, and 5 bits remaining as numbers for the NICs.

Translated that is a network mask of FF FF FF E0 (255.255.255.224). It allows you to use that as a single network with up to 30 network interfaces. (2^5 -2)

Question 5: How many useable subnets are available for assignment?

CHANGED: This is where I went wrong before.

I am assuming they mean how many more subnets you can create with the remaining 5 bits. .

As Oliver pointed out, that was not the intended question. The intended question was “We have a network of unknown size and split it into several networks. If you guess we had an old fashioned /24 (which is most common), then how many subnetworks did we create?”.

Given information:

  • your have a /27, aka your network mask is 11111111.11111111.11111111.11100000
  • Your given IP begins with 192.

Not given, but probably assumed:

  • Old fashioned Classful networks where used before we divided our net into subnets.
  • An IP address beginning with 192 (192.something.something.something) starts with binary 1 1 0.
    A networks starting with this used to indicate class C networks.

To solve the actual question you have two parts:

  1. We had /24. We give you /27. How many bits did we used to make subnets.
  2. How many subnets can you make with those bits?

27-24=3 bits used. 2^3 is 8 possible combinations for nets. Two unused as explained in the post made by other people. 8-2=6.

Hennes

Posted 2012-07-08T14:57:41.457

Reputation: 60 739

The question isn't about further division of the network. The question is into how many segments did you divide your network by using that netmask. And the answer of 6 is, to my understanding, correct. The amount of upvotes on this deeply confuses me. – Der Hochstapler – 2012-07-08T16:09:14.477

1Ah. Suddenly the question makes sense. Thank you @Oliver Salzburg. I was quite puzzled by it, but I tried to give a nice clear elaborate answer. I guess the upvotes are for trying to explain it (even though I explained the wrong answer). – Hennes – 2012-07-08T16:31:54.213

1@Hennes, you can edit your answer. – Synetech – 2012-07-08T17:56:28.430

@Synetech: Done. – Hennes – 2012-07-08T19:50:13.313

4

Before you can determine the number of valid subnets with a given network number and subnet mask, you must know the network masks for Class A, B, and C networks. And the first key to answering this type of question is to remember that the number of network bits never changes. Subnetting always borrows bits from the host bits – always.

192.112.136.0 is a CLASS C

EDIT: 11111111.11111111.11111111.11100000

/27 = 24+3 bits- which leaves 5 bits for subnet

The number of valid subnets = (2 raised to the power of the number of subnet bits) – 2

answer = (2 raised to the power of the number of 5) - 2

You must subtract those two subnets at the end. Why are the two subnets are being subtracted? The “all-zeroes” subnet and the “all-ones” subnet are considered unusable, and therefore are not considered valid.

Logman

Posted 2012-07-08T14:57:41.457

Reputation: 3 452

1The "classless" nature of the x.x.x.x/x CIDR representation actually alters the straight class C mask. /27, as Hennes describes, means 255.255.255.224, not 255.255.255.0 -- meaning there are only 5 bits to work with after the network definition. – JoshP – 2012-07-08T15:34:46.190

you are right, I did it wrong. I will edit the answer above. – Logman – 2012-07-08T15:41:49.987

3

The number of networks is equal to 2 to the power of the number of extra bits taken for subnetting minus 2.

In your case, it's a class C network. Which means the first 24 bits are taken to address the network, the last 8 are taken to address the host.

Your example uses 3 further bits for subnetting.

23-2 = 6

It's also well explained on the Wikipedia article about IP Subnetting.

What are these networks?

First Network

Network:   192.112.136.0/27      11000000.01110000.10001000.000 00000 (Class C)
Broadcast: 192.112.136.31        11000000.01110000.10001000.000 11111
HostMin:   192.112.136.1         11000000.01110000.10001000.000 00001
HostMax:   192.112.136.30        11000000.01110000.10001000.000 11110

Second Network

Network:   192.112.136.32/27     11000000.01110000.10001000.001 00000 (Class C)
Broadcast: 192.112.136.63        11000000.01110000.10001000.001 11111
HostMin:   192.112.136.33        11000000.01110000.10001000.001 00001
HostMax:   192.112.136.62        11000000.01110000.10001000.001 11110

Third Network

Network:   192.112.136.64/27     11000000.01110000.10001000.010 00000 (Class C)
Broadcast: 192.112.136.95        11000000.01110000.10001000.010 11111
HostMin:   192.112.136.65        11000000.01110000.10001000.010 00001
HostMax:   192.112.136.94        11000000.01110000.10001000.010 11110

Fourth Network

Network:   192.112.136.96/27     11000000.01110000.10001000.011 00000 (Class C)
Broadcast: 192.112.136.127       11000000.01110000.10001000.011 11111
HostMin:   192.112.136.97        11000000.01110000.10001000.011 00001
HostMax:   192.112.136.126       11000000.01110000.10001000.011 11110

Fifth Network

Network:   192.112.136.128/27    11000000.01110000.10001000.100 00000 (Class C)
Broadcast: 192.112.136.159       11000000.01110000.10001000.100 11111
HostMin:   192.112.136.129       11000000.01110000.10001000.100 00001
HostMax:   192.112.136.158       11000000.01110000.10001000.100 11110

Sixth Network

Network:   192.112.136.160/27    11000000.01110000.10001000.101 00000 (Class C)
Broadcast: 192.112.136.191       11000000.01110000.10001000.101 11111
HostMin:   192.112.136.161       11000000.01110000.10001000.101 00001
HostMax:   192.112.136.190       11000000.01110000.10001000.101 11110

Seventh Network

Network:   192.112.136.192/27    11000000.01110000.10001000.110 00000 (Class C)
Broadcast: 192.112.136.223       11000000.01110000.10001000.110 11111
HostMin:   192.112.136.193       11000000.01110000.10001000.110 00001
HostMax:   192.112.136.222       11000000.01110000.10001000.110 11110

Eight Network

Network:   192.112.136.224/27    11000000.01110000.10001000.111 00000 (Class C)
Broadcast: 192.112.136.255       11000000.01110000.10001000.111 11111
HostMin:   192.112.136.225       11000000.01110000.10001000.111 00001
HostMax:   192.112.136.254       11000000.01110000.10001000.111 11110

Dude, I can count. Those are 8!

Correct. According to Wikipedia:

The RFC 950 specification reserves the subnet values consisting of all zeros (see above) and all ones (broadcast), reducing the number of available subnets by two. However, due to the inefficiencies introduced by this convention it was abandoned for use on the public Internet, and is only relevant when dealing with legacy equipment that does not implement CIDR.

Der Hochstapler

Posted 2012-07-08T14:57:41.457

Reputation: 77 228

HostMin is the same as broadcast in the eight network. – 0x6B6F77616C74 – 2012-07-08T15:54:44.720

@kutacz: No, it isn't – Der Hochstapler – 2012-07-08T15:55:42.543

@Synetech: Yeah, I think I'm aware of it. Why? Any mistakes? – Der Hochstapler – 2012-07-08T15:56:14.460

@Oliver Salzburg: My oversight. – 0x6B6F77616C74 – 2012-07-08T15:57:55.890

Finally : number of subnetworks = 2 ^ (extra bits taken for subnetting) ? – 0x6B6F77616C74 – 2012-07-08T16:03:00.863

@kutacz: Is that a question or a suggestion for an improvement to the answer? – Der Hochstapler – 2012-07-08T16:06:40.750

1I've asked about universal algorithm. – 0x6B6F77616C74 – 2012-07-08T17:07:23.607