cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5806
Views
13
Helpful
9
Replies

subnetting, usable IPs

pcexhaust
Level 1
Level 1

I am trying to figure out what the usable IP range is to a class B address (172.16.1.1) with a mask of 255.255.255.0 .

172.16.1.1 /24

2^8 -2 = 254 subnets

2^8 -2 = 254 hosts

So the non-usable networks are just 172.16.0.0 and 172.16.256.0 ?

What about 172.16.1.1 ... is this the first usable subnet and host?

Thank you

9 Replies 9

Josef Oduwo
Level 7
Level 7

So the non-usable networks are just 172.16.0.0 and 172.16.256.0 ?

No. They are 172.16.1.0 (the "first address", the subnet address) and 172.16.1.255 (the "last" address, the broadcast address).

What about 172.16.1.1 ... is this the first usable subnet and host?

Yes, 172.16.1.1 is the first usable host, there is only one subnet: the "whole of" 172.16.1.0/24.

For a shortcut, you can use Cisco's subnet calculator (http://www.cisco.com/cgi-bin/Support/IpSubnet/subnets.pl) or Solarwinds.net's free subnet calculator.

Unusable addresses are those that have all "zeros" (network addresses) or all "ones" (broadcast addresses). Remember you have a /24 (or 255.255.255.0) network so we "ignore" the first 24 bits and focus on the last 8 bits. If we look at the last set of bits in binary form it would be binary 00000000 = decimal 0 for the network address (172.16.1.0) and binary 11111111 = decimal 255 for the broadcast address (172.16.1.255).

This is strictly the case if you are studying for a CCNA exam. In experience though, the ip subnet-zero command allows us to use these addresses where they would be otherwise unusable, depending on what environment you are working in.

To further understand subnetting you can use this booklet from 3com: http://www.3com.com/other/pdfs/infra/corpinfo/en_US/501302.pdf.

Josef.

scottmac
Level 10
Level 10

That address, with that mask will yield one subnet of 254 hosts.

The 24 bit mask (255.255.255.0 or /24) indicates that the first whole three octets are masked to represent the "network" portion of the address. That leave 8 bits for the host portion.

If the mask was 255.255.0.0 (the natural Class B mask), then you could subnet it to 254 subnets of 254 hosts each (or any other combination that dividing 16 bits can provide).

BTW: the highest number you should see in a mask or address would be "255" which represents a single byte/octet where each bit is set to a "1"

There are 256 numbers - zero through two-fifty-five.

Two-fifty-six would be two hundred fifty seven numbers.

Good Luck

Scott

Thanks for both posts...

I understand that a 172.16.1.0 /24 address runs from 172.16.1.1-172.16.1.254 . Where .255 is broadcast.

But now I am slightly confused on this:

If I was to use 172.16.0.0 /24

Then the borrowed is:

8 bits for the host

8 bits for the network

So 254 hosts and 254 subnetworks?

I am reading this Todd Lammle book which basically says:

Subnetting class B addresses:

A 255.255.255.0 mask used with a Class B network address is not called a Class B subnet with Class C network mask. Its a class B subnet mask with 8 bits of subnetting.

Thanks

Subnetting is an important topic of networking and is often used to knock out people during technical interviews. You need to be able to work these out really quickly, especially for the CCNA exams.

Please read this booklet: http://www.3com.com/other/pdfs/infra/corpinfo/en_US/501302.pdf.

It has excellent explanations on these concepts.

Josef.

Uh, no.

If you assign a 24 bit mask, the 24 bits are being used to describe the "network" portion of the address (in your example, the "0").

A 24 bit mask on a (traditionally) Class B address is sixteen bits of "Network," eight bits of "subnetwork,) and eight bits of "host." This is the kind of distinction that will be requested on the exams.

A "Class B" address has a natural mask of 16 bits. Any bits that you borrow from the high-order host bits (the left side of the right two octets) become the "subnet bits."

A "Class B" address with a 24 bit mask is "A Class B address with a 24 bit mask" (not really appropriate to call it a "Class C mask" .... though that seems to be a fairly common terminology).

So, a Class B address (we're talking classful here) has a natural "/16" mask: 65K hosts. If you slide the mask eight bits into the host portion, then the entire 24 bits become "the network portion of the address" for the sake of routing (really 16 bits network, 8 bits subnet ... but the third octet becomes fixed at the assigned value).

The 172.16.0.0/24 subnet is completely different from the 172.16.1.0/24 network which is different than the 172.16.2.0/24 network ... and so on ... each has 254 usable host addresses (+ the all zeros - the "network address" and the all ones - broadcast address for a total of 256 addresses).

If you had a Class B address with a natural mask (/16 or, on the test, no mask specified ... assumed to be the natural mask), the the 172.16.1.0 and the 172.16.2.0 addresses represent valid host addresses on the same network ... since there is one non-zero bit in the host portion.

On the other side, a Class B address with a natural mask (/16) of 172.16.255.0 is also a valid host address on the 172.16.0.0/16 network (again, since the host portion of the address has some non-zero bits).

The above doesn't represent a necessarily SMART way of assigning addresses (it can confuse some folks), but it's valid.

In short, if you assign a /24, regardless of the address class, then the first three (left) octets are fixed at the assigned net/subnet address and you'd only have the eight host bits available for (further) subnetting.

Hope this helps ....

Scott

Hi,

Let us consider the address 192.168.10.1/26

Therefore,

total no. host bits: 6

total no. of hosts in a subnet: 2power6-2 = 62 hosts

total no. of subnet bits: 2

total no. subnets:2power2-2 = 2 subnets

the subnets will be

Network #1: 192.168.10.0

First Host: 192.168.10.1

Last Host: 192.168.10.62

Broadcast: 192.168.10.63

Network #2: 192.168.10.64

First Host: 192.168.10.65

Last Host: 192.168.10.126

Broadcast: 192.168.10.127

Network #3: 192.168.10.128

First Host: 192.168.10.129

Last Host: 192.168.10.190

Broadcast: 192.168.10.191

Network #4: 192.168.10.192

First Host: 192.168.10.193

Last Host: 192.168.10.254

Broadcase: 192.168.10.255

According to the formula to find the no. of subnets

2power(no. of subnet bits)-2 = 2power2-2 = 2 subnets.

But What we get here is 4 subnets. Do we have to ignore network #1 and network #2. If yes, will the ip address in that range cannot not be used.

Which is considered as the first subnet and the last subnet? Please explain.

Hope I have not confused anyone.

Thanks in advance.

Sriram K

Many of the traditional (classful) explanations of subnetting assume that you should exclude usage of the first (zero) subnet and of the last (broadcast) subnet. That perspective is probably still represented in many of the certification exams.

The more modern approach to subnetting (classless) does not exclude either of the subnets. So if you have a network mask where 2 bits have been borrowed from the host portion to allow for subnetting the 2 borrowed bits would give you 4 usable subnets.

Old versions of the IOS did exclude use of the subnet zero. But the behavior of IOS changed many releases ago and now use of subnet zero is permitted by default. And IOS has never excluded use of the broadcast subnet.

HTH

Rick

HTH

Rick

Hi,

Thanks for your reply. So, which should be considered as the first subnet, when the question is asked in the ccna exam.

192.168.10.0

or

192.168.10.64

according to the example given in my last post.

--

Sriram K

mrchongo
Level 1
Level 1

172.16.1.0/24 is a subnetted Class B, not a natural Class B. That would be 172.16.1.0/16. Your math is correct if all that your are referring to is the 172.16.1.x address set. 172.16.0.0 is irrelevant because it it outside the scope of your question; i.e. it would be a separate subnet. No such animal as 172.16.256.0 It's an invalid address.

First usable within the scope you established is 172.16.1.1

Review Cisco Networking for a $25 gift card