• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Trying to get my head around subnet masks for 70-642

Atreus21

Lifer
I already have the Network+, and this is still stumping me.

I understand what they're for. All the ones in the binary mask are bits attributed to network IDs, and all the 0s are for host IDs.

What I'm having trouble figuring out is how the subnet mask determines the number of network IDs available. I know how it determines the number of hosts available (2^(number of zeroes in mask)-2). But this formula doesn't appear to apply to network ids.

If you have the a /15 (IPv4) mask, which in binary is:

11111111111111100000000000000000

...then you have 15 bits allocated to the network ID, and 17 to host IDs. Using the formula above, that allocates 2^(17)-2 host addresses, which is 131072.

Why do quantity of network IDs not follow the same formula? A subnet calculator says that this subnet mask, with 15 bits allocated to the network ID, would yield a total of 128 network IDs, whereas if we applied the previous formula to is, there would be 32766 of them.

I don't understand.
 
It is a relic of the CIDR system and a bit of logic. Example:

10.0.0.0/15
Networks: 128
Hosts/nw: 131070

The original class a is 10.0.0.0/8 so the actual subnet bits are 15-8=7 and 2^7 or 128. This is why you need to know the segment to start because:

192.0.0.0/25 could be:
Networks: 2 (ie subnetted 192.0.0.0/24) or
Networks: 512 (ie subnetted 192.0.0.0/16) or
Networks: 131072 (is subnetted 192.0.0.0/8)
Hosts is always 126 in this case.

In a classful networks: 2 is assumed since 192.0.0.0 -> 223.225.255.255 is the class C range. In classless you have to have the original segment size.

edit:

before anyone else lays in to me about this explanation... lots of the cisco subnetting is theory, not practice. In reality most times "192.x" will be assumed to be class C "like" in the real world. However it is good to be aware that someone could have decided to do something not like this. You can see this in the "Class E" range a lot because some not quite that bright network guy decided to use 250.0.0.0/8 as the inside range because they are "reserved for experimentation." Granted most find out quickly that class E breaks more stuff than it helps but still. Realize that people do stupid things and the /25 -> 2 networks:126 hosts (in the class C ranges) is pretty safe but have it in the back of your head that someone could have defined 192.168.0.0/16 as the corp network etc.
 
Last edited:
500px-Subnetting_operation.svg.png


The # of bits to use in the 2^x network formula are the Subnet Number
(in red - the bits you borrowed from the Host Number to create more networks)

not the total # of bits in the Network Prefix + Subnet Number (blue + red)
 
Last edited:
Back
Top