Subnetting |
![]() Printable version of this page |
For a given number of binary bits there will be a given number of combinations that can be achieved, note however that all 0s or all 1's are not allowed.
The first octet is used for the network with the first bit set to 0. Therefore these networks have:
Class A addresses are assigned to networks with a very large number of hosts. Class A networks use a default subnet mask of 255.0.0.0 and have 1-126 as their first octet. (The 127 Network is reserved for loopback)
The first and second octets are used for the network with the first 2 bits set to 10. Therefore these networks have:
Class B addresses are assigned to medium-sized to large-sized networks. Class
B networks use a default subnet mask of 255.255.0.0 and have 128-191 as their
first octet.
The first 3 octets are used for the network with the first 3 bits set to 110. Therefore these networks have:
Class C addresses are used for small LANs. Class C networks use a default subnet
mask of 255.255.255.0 and have 192-223 as their first octet.
Sometimes a network will need to be subdivided into smaller segments, this is known as subnetting and is accomplished by adjusting the subnet mask from the default. There are various methods of calculating the number of networks and hosts you can get from a given network by subnetting it. Obviously the easiest ways involve using one of the subnet calculators that are available for download. It can be handy though to be able to quickly work this out simply by using a pen and paper. This may seem a little complicated at first, but just follow the instructions using a pen and paper, do it a couple of times and it becomes second nature.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
192 |
224 | 240 | 248 | 252 | Subnet mask |
||
| 62 | 30 | 14 | 6 | 2 | Hosts | ||
| 2 | 6 | 14 | 30 | 62 | Subnets | ||
Example:
You have a class C network with the Network ID 203.12.16.0, you need 6 networks.
Look up the Subnets row on the table and you can see that for 6 Subnets, you will get up to 30 hosts per subnet by using a subnet mask of 255.255.255.224 (11111111 . 11111111 . 11111111 . 11100000). It can be seen that the 3 high-order bits on the final octet of the subnet mask give the 6 networks (see top of page for explanation of 3 bits giving 6 possible valid addresses).
To calculate the Network IDs and Host ID ranges
Address ranges are
| Subnet | Network ID | Broadcast | Host ID Range |
|---|---|---|---|
|
INVALID
|
0 (000-00000)
|
Network ID all bits set to 0
|
|
|
1
|
32 (001-00000)
|
63 (001-111111)
|
203.12.16.33 - 203.12.16.62
|
|
2
|
64 (010-00000)
|
95 (010-111111)
|
203.12.16.65 - 203.12.16.94
|
|
3
|
96 (011-00000)
|
127 (011-111111)
|
203.12.16.97 - 203.12.16.126
|
|
4
|
128 (100-00000)
|
159 (100-11111)
|
203.12.16.129 - 203.12.16.158
|
|
5
|
160 (101-00000)
|
191 (101-11111)
|
203.12.16.161 - 203.12.16.190
|
|
6
|
192 (110-00000)
|
223 (110-11111)
|
203.12.16.191 - 203.12.16.222
|
|
INVALID
|
224 (111-00000)
|
Network ID all bits set to 1
|
|
That was simple right? So now you will see that using the same principles, you can just as easily subnet a Class B network.
3rd OCTET |
4th OCTET |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example:
You have a full class B network with the Network ID 142.211.0.0, you need it split into a minimum 120 networks.
Look up the Subnets row on the table and you can see that for 126 Subnets, you will get up to 510 hosts per subnet by using a subnet mask of 255.255.254.0 (11111111 . 11111111 . 11111110 . 00000000). The 7 high-order bits of the 3rd Octet of the subnet mask give the 126 networks [(27) - 2 = 126 possible networks]. The 9 remaining (zero) bits give us the 510 Hosts per network [(29) - 2 = 510 possible hosts].
To calculate the Network IDs and Host ID ranges
Address ranges are
| Subnet | Network ID | Broadcast | Host ID Range |
|---|---|---|---|
|
INVALID
|
0.0
(0000000-0 . 00000000) |
Network ID all bits set to 0
|
|
|
1
|
2.0
(0000001-0 . 00000000) |
3.255
(0000001-1 . 11111111) |
142.211.2.1 - 142.211.3.254
|
|
2
|
4.0
(0000010-0 . 00000000) |
5.255
(0000010-1 . 11111111) |
142.211.4.1 - 142.211.5.254
|
|
3
|
6.0
(0000011-0 . 00000000) |
7.255
(0000011-1 . 11111111) |
142.211.6.1 - 142.211.7.254
|
|
4
|
8.0
(0000100-0 . 00000000) |
9.255
(0000100-1 . 11111111) |
142.211.8.1 - 142.211.9.254
|
|
5
|
10.0
(0000101-0 . 00000000) |
11.255
(0000101-1 . 11111111) |
142.211.10.1 - 142.211.11.254
|
|
6
|
12.0
(0000110-0 . 00000000) |
13.255
(0000110-1 . 11111111) |
142.211.12.1 - 142.211.13.254
|
|
7
|
14.0
(0000111-0 . 00000000) |
15.255
(0000111-1 . 11111111) |
142.211.14.1 - 142.211.15.254
|
|
And so on until
|
|||
|
126
|
252.0
(1111110-0 . 00000000) |
253.255
(1111110-1 . 11111111) |
142.211.252.1 - 142.211.253.254
|
|
INVALID
|
254.0
(1111111-0 . 00000000) |
Network ID all bits set to 1
|
|
Look at the binary number for the Network part of the addresses on the above example, disregard all but the 7 high order bits. The address range starts at 0000001 and ends at 1111110 and it can be seen that the number is actually increasing by one with each network. So there is a contiguous range of 126 network numbers.
If you follow that logic and then take the 9 low order bits of the host portion of the address. The address range starts at 000000001 and ends at 111111110 for each network, so likewise there is a contiguous range on each network of 510 host numbers.
The same applies in the Class C network example above.
Using the Class B tables as a guide, a set of tables for subnetting a Class
A network can be constructed. However, if you are lucky enough to be in the
position of subnetting a Class A network, why are you reading this page?
| ©2000 - 2010 ez-pc.org. All rights reserved Visitor Number 4126640 |
ez-pc Forum | Site Map | Subnetting was last reviewed May 18, 2002 |