cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2058
Views
0
Helpful
3
Replies

Subnetting confusion

Filip Knezevic
Level 1
Level 1

Hello, everybody. I'm a bit confused about subnetting. I learned to subnet following Todd Lammle's book, but now I'm reading Chris Bryant's Mastering Binary Math and Subnetting and it looks like he has a different approach to the number of subnets. From Lammle I learned that formula is like this: 2 on N is the number of subnets, and 2 on N - 2 is the number of valid hosts (we subtract 2 because of network and broadcast address). But Bryant is teaching us that we need to subtract 2 for number of subnets also.

Here is the example:

How many valid subnets are in 222.10.8.0/28? 

Following Todd Lammle's guide result should be 16 subnets (with 14 hosts each). But by Bryant's method result is 16 subnets -2, so it's 14 subnets, not 16. 

One more:

How many valid subnets are in 210.17.90.0/29? 

Following Todd Lammle's guide result should be 32 subnets (with 6 hosts each). But by Bryant's method result is 32 subnets -2, so it's 30 subnets, not 32.

Now I'm a little bit confused. If somebody can explain this, I'd be very thankful. 

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Filip,

In addition to Vasanth's response, the practice of subtracting 2 from the number of available subnets comes from ages of classful addressing, routing and routing protocols.

Consider the classful network 192.168.1.0/24 split into four total subnets:

192.168.1.0/26
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26

In classful routing protocols, networks were advertised without their netmasks - the netmasks were guessed rather than advertised. Now, obviously, there is a problem: If the network 192.168.1.0 is advertised, which netmask should be used - the classful /24, or the /26 subnet? There was a risk of misunderstanding this address, and so it was decided to simply not use the entire first subnet (also called all-zero subnet).

Additionally, assume that a router receives a packet destined to 192.168.1.255, a broadcast address. Now, here's another uncertainty: Is this packet intended only for hosts in the last subnet 192.168.1.192/26, or is it meant for all hosts in the original 192.168.1.0/24 network, and thus in each one of its subnets? Again, this is unclear, and so it was decided that because of this, the last subnet will also be left unused (also called all-ones subnet).

That's why the number of usable subnets was originally decremented by two: The first and the last subnet were not used, to avoid possible confusion (address of the first subnet vs. address of the original network; broadcast address of the last subnet vs. broadcast address of the original network).

Nowadays, we don't care. We have moved away from classful addressing, routing and routing protocols. Our current routing protocols properly advertise netmasks along with networks so there's no risk of confusion, and remotely addressing a broadcast address of a distant network is considered a bad practice and is blocked by routers anyway.

Therefore, nowadays, we happily use all possible subnets of a given network. The 2^n - 2 formula for the number of available subnets is not valid anymore (in fact, it has not been valid for a number of years; classless routing came around 1993).

Best regards,
Peter

View solution in original post

3 Replies 3

vasanth77
Level 1
Level 1

IP subnet:222.10.8.0----default Mask:255.255.255.0
Given mask:255.255.255.240
Binary notation of given Mask:11111111.11111111.11111111.11110000


From LSB (right to left)Network bit starts at 5th position or 2^No of host bits (i.e.2^4) with that
you have to calculate host per network

2^4=16(Total host address)-2(Network & broadcast address)=14 ---->(Usable host per network)

222.10.8.0----->255.255.255.240

1.222.10.8.0-222.10.8.15(1 to 14 usable address,0-network ,15-broadcast)
2.222.10.8.16-222.10.8.31(Same like first subnet)
3.222.10.8.32-222.10.8.47


To calculate number of network for the given Network 222.10.8.0

It's a class C network ,with it's default mask of 255.255.255.0
Here the default mask ,we can able to have one subnet with 254 usable Host address(1-254)
But after subnetting the mask to 255.255.255.240 we gain more networks from the single subnet
To calculate that network we need to use this formula
2^borrowed host bits to Network bits from the default mask of that given address(222.10.8.0)

borrowed host bit for network is 4
2^4=16 Networks we can get

Finally
{[(16 networks) x 14(Usable Hosts address per network)]+(16x2(Network & broadcast address for every 16 network))}=256

256=(0,1,2,3.....255)
Please rate this answer if it is helpful

Peter Paluch
Cisco Employee
Cisco Employee

Filip,

In addition to Vasanth's response, the practice of subtracting 2 from the number of available subnets comes from ages of classful addressing, routing and routing protocols.

Consider the classful network 192.168.1.0/24 split into four total subnets:

192.168.1.0/26
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26

In classful routing protocols, networks were advertised without their netmasks - the netmasks were guessed rather than advertised. Now, obviously, there is a problem: If the network 192.168.1.0 is advertised, which netmask should be used - the classful /24, or the /26 subnet? There was a risk of misunderstanding this address, and so it was decided to simply not use the entire first subnet (also called all-zero subnet).

Additionally, assume that a router receives a packet destined to 192.168.1.255, a broadcast address. Now, here's another uncertainty: Is this packet intended only for hosts in the last subnet 192.168.1.192/26, or is it meant for all hosts in the original 192.168.1.0/24 network, and thus in each one of its subnets? Again, this is unclear, and so it was decided that because of this, the last subnet will also be left unused (also called all-ones subnet).

That's why the number of usable subnets was originally decremented by two: The first and the last subnet were not used, to avoid possible confusion (address of the first subnet vs. address of the original network; broadcast address of the last subnet vs. broadcast address of the original network).

Nowadays, we don't care. We have moved away from classful addressing, routing and routing protocols. Our current routing protocols properly advertise netmasks along with networks so there's no risk of confusion, and remotely addressing a broadcast address of a distant network is considered a bad practice and is blocked by routers anyway.

Therefore, nowadays, we happily use all possible subnets of a given network. The 2^n - 2 formula for the number of available subnets is not valid anymore (in fact, it has not been valid for a number of years; classless routing came around 1993).

Best regards,
Peter

Filip Knezevic
Level 1
Level 1

Thank you for clarification. Now the matter it's clear :). Strange Chris Bryant is teaching outdated  

information. I hope I shouldn't worry that -2 formula will show up on exam...

Review Cisco Networking products for a $25 gift card