Sub Netting
Sub Netting
Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
ROUTER
192.168.239.254
ROUTER
192.168.240.254
Network192.168.239.0
Network192.168.240.0
SWITCH
SWITCH
HOST
192.168.239.1
HOST
192.168.239.2
HOST
192.168.239.253
HOST
192.168.240.1
HOST
192.168.240.2
HOST
192.168.240.253
Network: 192.168.239.0
Subnet Mask: 255.255.255.0
HOSTS: .1 TO .253
Router Interface (Gateway): .254
Broadcast 192.168.239.255
Network 192.168.240.0
Subnet Mask 255.255.255.0
HOSTS .1 TO .254
Broadcast 192.168.240.255
The above notation will be used in the remaining pages to save on space.
Notice how the interfaces to the router have been assigned an IP address from the corresponding networks.
The router interface addresses are known as the gateway addresses. Each PC has to be configured so it has
a unique IP address, a subnet mask and the address of the gateway, i.e. the router interface it has to access
to send data out of the network the PC is in.
ROUTER
(A speciailised computer used to connect networks and control the traffic flow
between them)
Network 192.168.239.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.239.255
Network 192.168.240.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.240.255
Network 192.168.241.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.241.255
Network 192.168.242.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.242.255
Network 192.168.243.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.243.255
Network 192.168.244.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.244.255
Network 192.168.245.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.245.255
Network 192.168.246.0
Mask 255.255.255.0
PCs .1 TO .253
Router Interface .254
Broadcast 192.168.246.255
Scenario 2
Subnetting is all about preserving IP addresses. In this scenario we still have 8 separately managed networks but they are all created from one class C network address.
By changing the class C default subnet mask from 255.255.255.0 to 255.255.255.224 we can create 8 individual networks, albeit smaller ones referred to as 'subnetworks'.
ROUTER
Network 192.168.239.0
Mask 255.255.255.224
PCs
.1 to .29
Router Interface .30
Broadcast 192.168.239.31
Network 192.168.239.32
Mask
255.255.255.224
PCs
.33 to .61
Router Interface .62
Broadcast 192.168.239.63
Network 192.168.239.64
Mask
255.255.255.224
PCs
.65 to .93
Router Interface .94
Broadcast 192.168.239.95
The next page details how the above numbers have been determined.
Network 192.168.239.96
Mask
255.255.255.224
PCs
. 97 to .125
Router Interface .126
Broadcast 192.168.239.127
Network 192.168.239.128
Mask
255.255.255.224
PCs
.129 TO .157
Router Interface .158
BCAST: 192.168.239.159
Network 192.168.239.160
Mask
255.255.255.224
PCs
.161 to .189
Router Interface .190
Broadcast 192.168.239.191
Network 192.168.239.192
Mask
255.255.255.224
PCs
.193 TO .221
Router Interface .222
Broadcast 192.168.239.223
Network 192.168.239.224
Mask
255.255.255.224
PCs
.225 TO .253
Router Interface .254
Broadcast 192.168.239.255
Fig. 3 - Class C IP address format and the default class C subnet mask of 255.255.255.0
IP format
SNM
hhhhhhhh
00000000
E.g
192
192
192
0
97
255
168
168
168
239
239
239
An example of a network address (note all the host bits are zero)
An example of a host address
The network broadcast address (note all the host bits are ones)
Number of hosts on a class C network = 2 8 = 256 (although 2 have special meanings leaving 254 for assigning to hosts)
Class C IP address format and the subnet mask of 255.255.255.224
IP format
SNM
ssshhhhh
11100000
Key:
n = network id bit
h = host id bit
s = subnet id bit
Take note of the following:
3 bits are used to identify the subnets therefore the number of subnets = 2 3 = 8
5 bits are used to identify a host, therefore the number of hosts per subnet = 2 5 = 32 , but 2 have
special meanings leaving 30 for assigning to hosts.
There are 27 1s in the subnet mask
Example of subnet address ranges
Net address
192.168.239.0
Subnet mask
255.255.255.224
Alternative subnet notation: 192.168.239.0/27
Subnet
0
Detail
000 00000 Subnet address
000 00001 1st host on subnet
IP address
192.168.239.0
192.168.239.1
192
192
192
192
168
168
168
168
239
239
239
239
000 11110
000 11111
001 00000
001 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.30
192.168.239.31
192.168.239.32
192.168.239.33
192
192
192
192
168
168
168
168
239
239
239
239
001 11110
001 11111
010 00000
010 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.62
192.168.239.63
192.168.239.64
192.168.239.65
192
192
192
192
168
168
168
168
239
239
239
239
010 11110
010 11111
011 00000
011 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.94
192.168.239.95
192.168.239.96
192.168.239.97
192
192
192
192
168
168
168
168
239
239
239
239
011 11110
011 11111
100 00000
100 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.126
192.168.239.127
192.168.239.128
192.168.239.129
192
192
192
192
168
168
168
168
239
239
239
239
100 11110
100 11111
101 00000
101 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.158
192.168.239.159
192.168.239.160
192.168.239.161
192
192
192
192
168
168
168
168
239
239
239
239
101 11110
101 11111
110 00000
110 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.190
192.168.239.191
192.168.239.192
192.168.239.193
192
192
192
192
168
168
168
168
239
239
239
239
110 11110
110 11111
111 00000
111 00001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.222
192.168.239.223
192.168.239.224
192.168.239.225
192
192
168
168
239
239
192.168.239.254
192.168.239.255
Fig. 4 - Class C IP address format and the default class C subnet mask of 255.255.255.0
IP format 110nnnnn
SNM
11111111
nnnnnnnn
11111111
nnnnnnnn
11111111
hhhhhhhh
00000000
E.g
168
168
168
239
239
239
0
97
255
192
192
192
An example of a network address (note all the host bits are zero)
An example of a host address
The network broadcast address (note all the host bits are ones)
Number of hosts on a class C network = 2 8 = 256 (although 2 have special meanings leaving 254 for assigning to hosts)
Class C IP address format and the subnet mask of 255.255.255.192
IP format 110nnnnn
SNM
11111111
nnnnnnnn
11111111
nnnnnnnn
11111111
sshhhhhh
11000000
Key:
n = network id bit
h = host id bit
s = subnet id bit
Take note of the following:
2 bits are used to identify the subnets therefore the number of subnets = 2 2 = 4
6 bits are used to identify a host, therefore the number of hosts per subnet = 2 6 = 64 , but 2 have
special meanings leaving 62 for assigning to hosts.
There are 26 1s in the subnet mask
Example of subnet address ranges
Net address
192.168.239.0
Subnet mask
255.255.255.192
Alternative subnet notation: 192.168.239.0/26
Subnet
0
192
192
IP address
192.168.239.0
192.168.239.1
192
192
192
192
168
168
168
168
239
239
239
239
00 111110
00 111111
01 000000
01 000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.62
192.168.239.63
192.168.239.64
192.168.239.65
192
192
192
192
168
168
168
168
239
239
239
239
01 111110
01 111111
10 000000
10 000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.126
192.168.239.127
192.168.239.128
192.168.239.129
192
192
192
192
168
168
168
168
239
239
239
239
10 111110
10 111111
11 000000
11 000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.190
192.168.239.191
192.168.239.192
192.168.239.193
192
192
168
168
239
239
192.168.239.254
192.168.239.255
Fig. 5 - Class C IP address format and the default class C subnet mask of 255.255.255.0
IP format 110nnnnn
SNM
11111111
E.g
168
168
168
192
192
192
239
239
239
0
97
255
An example of a network address (note all the host bits are zero)
An example of a host address (host ID = 97)
The network broadcast address (note all the host bits are ones)
Number of hosts on a class C network = 2 8 = 256 (although 2 have special meanings leaving 254 for assigning to hosts)
Class C IP address format and the subnet mask of 255.255.255.240
IP format 110nnnnn
SNM
11111111
Key:
n = network id bit
h = host id bit
s = subnet id bit
Take note of the following:
4 bits are used to identify the subnets therefore the number of subnets = 2 4 = 16
4 bits are used to identify a host, therefore the number of hosts per subnet = 2 4 = 16 , but 2 have
special meanings leaving 14 for assigning to hosts.
There are 28 1s in the subnet mask
Example of subnet address ranges
Net address
192.168.239.0
Subnet mask
255.255.255.240
Alternative subnet notation: 192.168.239.0/28
Subnet
0
Detail
0000 0000 Subnet address
0000 0001 1st host on subnet
IP address
192.168.239.0
192.168.239.1
192
192
192
192
168
168
168
168
239
239
239
239
0000 1110
0000 1111
0001 0000
0001 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.14
192.168.239.15
192.168.239.16
192.168.239.17
192
192
192
192
168
168
168
168
239
239
239
239
0001 1110
0001 1111
0010 0000
0010 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.32
192.168.239.
192
192
192
192
168
168
168
168
239
239
239
239
0010 1110
0010 1111
0011 0000
0011 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.48
192.168.239.
192
192
192
192
168
168
168
168
239
239
239
239
0011 1110
0011 1111
0100 0000
0100 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.64
192.168.239.
192
192
192
192
168
168
168
168
239
239
239
239
0100 1110
0100 1111
0101 0000
0101 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.
192.168.239.
192
192
192
192
168
168
168
168
239
239
239
239
0101 1110
0101 1111
0110 0000
0110 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.
192.168.239.
192
192
192
192
168
168
168
168
239
239
239
239
0110 1110
0110 1111
0111 0000
0111 0001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
192.168.239.
192.168.239.
192.168.239.
192.168.239.
192
192
192
168
168
168
239
239
239
192.168.239.
192.168.239.
192.168.239.128
Fig. 6 - Class B IP address format and the default class B subnet mask of 255.255.0.0
IP format 10nnnnnn nnnnnnnn hhhhhhhh
SNM
11111111 11111111 00000000
hhhhhhhh
00000000
E.g
0
1
255
172
172
172
16
16
16
0
64
255
16
An example of a network address (note all the host bits are zero)
An example of a host address (host ID = 64.1)
The network broadcast address (note all the host bits are ones)
= 65536 (although 2 have special meanings leaving 65534 for assigning to hosts)
hhhhhhhh
00000000 (note how 18 bits are in the 1 state)
Key:
n = network id bit
h = host id bit
s = subnet id bit
Take note of the following:
2 bits are used to identify the subnets therefore the number of subnets = 2 2 = 4
14 bits are used to identify a host, therefore the number of hosts per subnet = 2 14 = 16384 , but 2 have
special meanings leaving 16382 for assigning to hosts.
There are 18 1s in the subnet mask
Example of subnet address ranges
Net address
172.16.0.0
Subnet mask
255.255.192.0
Alternative subnet notation: 172.16.0.0/18
Subnet
0
IP address
172.16.0.0
172.16.0.1
172
172
172
172
16
16
16
16
00 111111
00 111111
01 000000
01 000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.63.254
172.16.63.255
172.16.64.0
172.16.64.1
172
172
172
172
16
16
16
16
01 111111
01 111111
10 000000
10 000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.127.254
172.16.127.255
172.16.128.0
172.16.128.1
172
172
172
172
16
16
16
16
10 111111
10 111111
11 000000
11 000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.191.254
172.16.191.255
172.16.192.0
172.16.192.1
172
172
16
16
172.16.255.254
172.16.255.255
Fig. 7 - Class B IP address format and the default class B subnet mask of 255.255.0.0
IP format
SNM
10nnnnnn nnnnnnnn
11111111 11111111
hhhhhhhh
00000000
hhhhhhhh
00000000
E.g
172
172
172
0
64
255
0
1
255
16
16
16
16
An example of a network address (note all the host bits are zero)
An example of a host address
The network broadcast address (note all the host bits are ones)
= 65536 (although 2 have special meanings leaving 65534 for assigning to hosts)
10nnnnnn nnnnnnnn
11111111 11111111
ssshhhhh
11100000
hhhhhhhh
00000000
172
172
IP address
172.16.0.0
172.16.0.1
172
172
172
172
16
16
16
16
00011111
00011111
00100000
00100000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.31.254
172.16.31.255
172.16.32.0
172.16.32.1
172
172
172
172
16
16
16
16
00111111
00111111
01000000
01000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.63.254
172.16.63.255
172.16.64.0
172.16.64.1
172
172
172
172
16
16
16
16
01011111
01011111
01100000
01100000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.95.254
172.16.95.255
172.16.96.0
172.16.96.1
172
172
172
172
16
16
16
16
01111111
01111111
10000000
10000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.127.254
172.16.127.255
172.16.128.0
172.16.128.1
172
172
172
172
16
16
16
16
10011111
10011111
10100000
10100000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.159.254
172.16.159.255
172.16.160.0
172.16.160.1
172
172
172
172
16
16
16
16
10111111
10111111
11000000
11000000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.191.254
172.16.191.255
172.16.192.0
172.16.192.1
172
172
172
172
16
16
16
16
11011111
11011111
11100000
11100000
11111110
11111111
00000000
00000001
Router interface
Subnet broadcast address
Subnet address
1st host on subnet
172.16.223.254
172.16.223.255
172.16.224.0
172.16.224.1
172
172
16
16
11111111
11111111
172.16.255.254
172.16.255.255