Sub Netting
Sub Netting
• Class A networks
– First octet values range from 1 through 126.
– First octet starts with bit 0.
– Network mask is 8 bits, written /8 or 255.0.0.0.
1.0.0.0 through 126.0.0.0 are class A networks with 16777214 hosts each.
• Class B networks
– First octet values range from 128 through 191.
– First octet starts with binary pattern 10.
– Network mask is 16 bits, written /16 or 255.255.0.0.
128.0.0.0 through 191.255.0.0 are class B networks, with 65534 hosts each.
• Class C networks
– First octet values range from 192 through 223.
– First octet starts with binary pattern 110.
– Network mask is 24 bits, written /24 or 255.255.255.0.
192.0.0.0 through 223.255.255.0 are class C networks, with 254 hosts each.
1
The need to improve IP addressing efficiency
• As IP networking and internetworking progressed, it became very apparent
that class A and B networks were simply too large.
• 254 hosts on one network segment is manageable, but 65534 hosts or more
on a single network segment is difficult to manage.
– This would result in class A and B networks not being fully utilized,
meaning that not all the host addresses would get used.
– Or it would result in more hosts being put onto a single network segment
than could reasonably be managed.
• For these and other reasons, there was a need to improve the efficiency of
IP addressing. That is, to provide a way to limit the number of host
addresses per network segment to what is actually needed, regardless of the
network class.
• This need was met progressively through the conceptions of subnet masks,
variable-length subnet masks, and classless inter-domain routing.
Example 1
Let us say that you have a Class C network with the IP address 195.201.10.5. You have
created 2 subnets on this network. What is the host capacity of each subnet?
In order to calculate the host capacity you must first find out the subnet identifier.
(no of bits borrowed from the host)
Step 1: Find out the binary value of decimal 2 (given number of subnets)
2/2 = 1 0
Step 2: Count the number of bits in the result = 2 (your subnet identifer is 2 bits)
This means you need to borrow 2 bits from the host. For a class C network the
host carries 8 bits.
195.201.10. 5
Network Host
255.255.255.0
Step 3: 8 host bits minus 2 bits = 6 (you now have 6 host bits left.)
Step 4: 26-2 (64-2)
Answer is 62
2
Subnet mask would now change to
To calculate the no of subnets you would take the subnet identifier (which is 2 bits)
22-2 =2 (4-2)
10 0 0 0/19
11111111 11111111 111000000 00000000
Number of Subnets
Step:1 In order to increase the network bits from 8 to 19 we need to borrow 11 bits from
the the host.
The bits that are borrowed are referred to at the subnet identifier
Step: 2 211-2 = (2048-2) = 2048
Subnet Mask
From a Class A network determine the number of subnets you would need to support 900
hosts per subnet
3
3. A Class A address would normally have 8 bits for the network section so the
borrowed bits 22-8 =14
4. 214-2 = 16382
5. The host capacity would be 210=2 =1,022
From a Class B network of 190.201.0.0. how many subnets can you have if you have at
least 4000 host.
_________________________________________________________
4
Memorize this table of high-bit sums:
Suppose a company has a Class B IP address and you need to determine the number of
subnets required to support at least 2000 hosts per subnet.
5
Suppose you have a network with a class C address 200.89.62.0/24 and you want to
create a minimum of 6 subnets.
Notice that you are not given the number of hosts required.
1. The first thing you need to find out is the subnet identifier ( no of bits to borrow
from the host id.
2. The decimal value of 6 is 110 = 3 bits
3. So you need to borrow 3 bits from the host id section to add to the network id
4. The network prefix is now 200.89.62.0/27 because you borrowed 3 bits from the
host id 24+3
5. the subnet mask is no longer 255.255.255.0 because you changed the network id
structure
6. the mask is now 255.255.255.244 11100000 converted to decimal is 224
= 6 subnets
SUBNETS =
30 = 11110 = 5 BITS
32-5 = 27
27-24 =3
23-2
=6 SUBNETS
6
FIRST AND LAST SUBNET
To calculate the network address of the first subnet, begin by taking the decimal value of
the quad in the subnet mask that contains both subnet and host identifier bits and
subtracting it from 256. Using an example of a class C address with the subnet mask
255.255.255.224, the result of 256 minus 224 is 32. The network address of the first
subnet is therefore 192.168.42.32. To calculate the network addresses of the other
subnets, you repeatedly increment the result of your previous subtraction by itself. Fro
example, if the network address of the first subnet is 192.168.42.32, the addresses of the
remaining five subnets are as follows:
192.168.42.64
192.168.42.96
192.168.42.128
192.168.42.160
192.168.42.192
To calculate the IP address in each subnet, you repeatedly increment the host identifier by
one. The IP addresses in the first subnet are therefore 192.168.42.33 to 192.168.42.33 to
192.168.42.62. The 192.168.42.63 address is omitted because this address would have a
binary host identifier value of 11111, which is a broadcast address. The IP address
ranges for the subsequent subnets are as follows:
192.168.42.65 to 192.168.42.94
192.168.42.97 to 192.168.42.126
192.168.42.129 to 192.168.42.158
192.168.42.161 to 192.168.42.190
192.168.42.193 to 192.168.42.222
7
Practice: Subnetting IP Addresses
For each of the following IP address assignments, specify the number of bits in the subnet
identifier, the number of possible IP addresses in each subnet, the mask for the IP
addresses, and the IP address ranges for the first and last subnet.
10.0.0.0/19
1. Number of bits in subnet identifier:______________________
2. Number of subnets __________________
3. Number of possible IP addresses in each subnet______________
4. Subnet mask _______________
5. First subnet_______________
6.. Last subnet ______________
192.168.214.0/29
1. Number of bits in subnet identifier:______________________
2. Number of subnets __________________
3. Number of possible IP addresses in each subnet______________
4. Subnet mask _______________
5. First subnet_______________
6.. Last subnet ______________
172.28.0.0./20
1. Number of bits in subnet identifier:______________________
2. Number of subnets __________________
3. Number of possible IP addresses in each subnet______________
4. Subnet mask _______________
5. First subnet_______________
6.. Last subnet ______________