| Author |
Subnetting a class B
|
|
| Boulware5 2004-06-24, 1:45 am |
| I'm reading the Sybex book on subnetting a class B. Either I'm missing something, I'm misreading it, or there is an error - but let's take this as an example as to what I'm talking about :
For a network address of 172.16.0.0 and a subnet of 255.255.255.224...
There are:
2046 Subnets
30 Hosts
Valid subnets are 32, 64,96,128,160,192. Now here is what I'm not getting. It says both the 0 and 224 subnets can be used as long as the third octet does not show a value of 0 or 255. It then goes ahead and uses the 0 and 224 subnets. But the third octect here does show a value of 0 or 255 (it is 255). So why is the book using the 0 and 224 subnets? | |
| darthfeces 2004-06-24, 2:37 am |
| http://www.telusplanet.net/public/sparkman/netcalc.htm
this might help
use the explain
Subnet Calculator Explanation Networking
home / guestbook / credits / email
--------------------------------------------------------------------------------
This calculator will calculate the subnet mask to use, given a TCP/IP network address and the number of subnets or nodes per subnet required.
To create the subnet mask, first remember that the purpose of the subnet mask is to separate the (32 bit) ip address into the network prefix and the host number. If a bit in the subnet mask is 1, the corresponding bit in the IP address is part of the network address; if the bit in the subnet mask is 0, the corresponding bit in the IP address is part of the host address.
First depict the ip address in binary. Take 172.16.0.0 and convert to binary:
ip address: 10101100.00010000.00000000.00000000
First we determine what class of address it is:
If the first bit is 0 it is a Class A address If the first two bits are 10 it is a Class B address If the first three bits are 110 it is a Class C address If the first four bits are 1110 it is a Class D multicast address If the first four bits are 1111 it is a Class E experimental address
Your example is a Class B address. The default subnet mask for a Class B address is:
subnet mask: 11111111.11111111.00000000.00000000
The formula for figuring out the number of 'host' bits in a subnet mask is
2^n=(number of nodes ) (2^n means '2' to the power of 'n')
Since you know the number of nodes, you need to find 'n'.
Because you want 32 node(s), you want to leave 5 - '0' bits in the subnet mask since 32 = 2 ^ 5.
This will give you the following subnet mask:
subnet mask: 11111111.11111111.11111111.11100000
Which is referred to as /27 or in dotted decimal notation as 255.255.255.224
Subnet Calculator Explanation Networking
home / guestbook / credits / email
--------------------------------------------------------------------------------
This calculator will calculate the network address, the host address and the broadcast address for a given TCP/IP address and subnet mask.
These are actually fairly straightforward calculations. The easiest way to do it is to depict both the ip address and the subnet mask in binary. Take 172.16.0.0 with subnet mask 255.255.255.224 listed in binary:
ip address: 10101100.00010000.00000000.00000000 subnet mask: 11111111.11111111.11111111.11100000
If you do a binary AND between these two numbers, you get the network address:
ip address: 10101100.00010000.00000000.00000000 subnet mask: 11111111.11111111.11111111.11100000 -----------------------------------AND network address: 10101100.00010000.00000000.00000000
which translated back to dotted decimal notation is 172.16.0.0
To get the host portion, invert the subnet mask and again perform a binary AND with the ip address:
ip address: 10101100.00010000.00000000.00000000inverted subnet mask: 00000000.00000000.00000000.00011111 -----------------------------------AND host portion: 00000000.00000000.00000000.00000000
which translated back to dotted decimal notation is 0.0.0.0
To obtain the broadcast address, again it is simplest to look at it in binary. Take the inverted subnet mask and perform a binary XOR with the network address:
network address: 10101100.00010000.00000000.00000000inverted subnet mask: 00000000.00000000.00000000.00011111 -----------------------------------XOR broadcast address: 10101100.00010000.00000000.00011111 | |
| Boulware5 2004-06-24, 2:45 am |
| But why would the book say "both the 0 and 224 subnets can be used as long as the third octet does not show a value of 0 or 255." Is that true? Then why is the third octet 255 (255.255.255.254) and it shows the use of the 0 and 224 subnets? | |
| darthfeces 2004-06-24, 11:28 am |
| generally in networking the all zero and all ones subnets are unusable.
but enable ip subnet-zero and you can use it.
it seems the book does a poor job explaining. | |
| ZacDogg 2004-06-24, 11:28 am |
| Becuase it is explained very badly. I'll try to explain briefly. For 172.16.0.0 255.255.255.224 your subnets are:
172.16.0.0-31
172.16.0.32-63
172.16.0.64-95.
.
.
through
.
.
172.16.255.160-191
172.16.255.192-223
172.16.255.224-255
As you know, in CCNA material you are taught that the first and last subnet can't be used. So 172.16.0.0-31 is the first subnet and 172.16.255.224-255 is the last subnet.
For example 172.16.1.0-31 is valid because it isn't the first or last subnet, it is the 9th actually. 172.16.1.224-255 is valid for the same reason, it is the 16th.
I hope that made sense and I didn't add more confusion.
Zac | |
| Tophat 2004-06-24, 11:33 am |
| I believe what the book is refering to is the fact that you should not use the 172.16.0.0/27 and the 172.16.255.224/27 networks. These networks can only be used if you use the ip subnet-zero command and since this is a cisco propriatarty command some other vendors may not be able to use those networks. | |
| Boulware5 2004-06-24, 12:21 pm |
| On the test is the all zeros and all ones subnets valid? The ip subnet-zero command is enabled by default on all ISO's from 12.x on, so maybe cisco assumes it's valid? | |
|
|
|
|
|
|
|
|
| ZacDogg 2004-06-24, 12:37 pm |
| For the CCNA though...subnet-zero and the broadcast subnet are not valid. Just stick to the -2 rule for now.
Zac | |
| Boulware5 2004-06-24, 12:39 pm |
| Still doesn't answer if the test thinks the all 1's and all 0's subnet is legal. I assume it is after reading it since those two subnets are "generally accepted today." | |
| Boulware5 2004-06-24, 12:41 pm |
| quote: Originally posted by ZacDogg
For the CCNA though...subnet-zero and the broadcast subnet are not valid. Just stick to the -2 rule for now.
Zac
Ah ok you just answered my above post. Thanks. | |
| Boulware5 2004-06-24, 12:43 pm |
| The sybex book is great but it is a shame it tries to confuse you with that. | |
| darthfeces 2004-06-24, 12:43 pm |
| you can ignore it for ccna prep
but, note this last paragraph
Using Subnet Zero and the All-Ones Subnet
It should be noted that even though it was discouraged, the entire address space including subnet zero and the all-ones subnet have always been usable. The use of the all-ones subnet was explicitly allowed and the use of subnet zero is explicitly allowed since Cisco IOS Software Release 12.0. Even prior to Cisco IOS Software Release 12.0, subnet zero could be used by entering the ip subnet-zero global configuration command.
On the issue of using subnet zero and the all-ones subnet, rfc 1878 states, "This practice (of excluding all-zeros and all-ones subnets) is obsolete. Modern software will be able to utilize all definable networks." Today, the use of subnet zero and the all-ones subnet is generally accepted and most vendors support their use. However, on certain networks, particularly the ones using legacy software, the use of subnet zero and the all-ones subnet can lead to problems. | |
| USHazard 2004-06-24, 1:37 pm |
| I think that on later IOS releases, ip subnet-zero is enabled by default. | |
| Boulware5 2004-06-24, 1:38 pm |
| quote: Originally posted by USHazard
I think that on later IOS releases, ip subnet-zero is enabled by default.
Yeah on 12.x and later. I already said that in this thread.  | |
| USHazard 2004-06-24, 1:39 pm |
| oops Teach me not to skim. | |
|
| quote: Originally posted by ZacDogg
For the CCNA though...subnet-zero and the broadcast subnet are not valid. Just stick to the -2 rule for now.
Zac
that's right. It is not valid for the MCSE either, for that matter. However, my understanding is that come the CCNP, it is now fair game as a topic. Go figure! | |
| Sexy Lexy 2004-07-04, 5:50 am |
| I remember reading in either the Sybex or Cisco press book regarding subnet zero.
It states that for CCNA purposes you should consider subnet zero illegal but the CCNP will use subnet zero as being valid.
Strange.
 | |
|
| quote: Originally posted by Sexy Lexy
I remember reading in either the Sybex or Cisco press book regarding subnet zero.
It states that for CCNA purposes you should consider subnet zero illegal but the CCNP will use subnet zero as being valid.
Strange.
Yup, that's correct... not that it makes any sense  |
|
|
|