You are on page 1of 14

Subnet for Novice

# of
Network
1st Octet
MSD
# of Host Assignable Assignable Broadcast
Network bit
Class
bit
IP ranges
IP ranges
Address
A
0 - 127
0
8
24
N.H.H.H
1 - 126
127
B
128 - 191
10
16
16
N.N.H.H
129 - 190
191
C
192 - 223
110
24
8
N.N.N.H
193 - 222
223
D
224 239
Reserved for IP Multicasting
225 - 238
238
E
240 254
Reserved for R & D
241 - 253
254
N = network address bits; H = host/node address bits (s+h, where s= # of subnet bits and h= # of host bits)

CIDR
/32
/31
/30
/29
/28
/27
/26
/25
/24
/23
/22
/21
/20
/19
/18
/17
/16
/15
/14
/13
/12
/11
/10
/9
/8

CIDR
/30
/29
/28

Subnet Mask
255.255.255.255
255.255.255.254
255.255.255.252
255.255.255.248
255.255.255.240
255.255.255.224
255.255.255.192
255.255.255.128
255.255.255.0
255.255.254.0
255.255.252.0
255.255.248.0
255.255.240.0
255.255.224.0
255.255.192.0
255.255.128.0
255.255.0.0
255.254.0.0
255.252.0.0
255.248.0.0
255.240.0.0
255.224.0.0
255.192.0.0
255.128.0.0
255.0.0.0

Subnet Mask
255.255.255.252
255.255.255.248
255.255.255.240

Class A Addressing Guide


# of bits
Total # of Subnets
Total # of Hosts
Borrowed
This is a single host route
2
22
4,194,304
4
21
2,097,152
8
20
1,048,576
16
19
524,288
32
18
262,144
64
17
131,072
128
16
65,536
256
15
32,768
512
14
16,384
1024
13
8192
2048
12
4096
4096
11
2048
8192
10
1024
16,384
9
512
32,768
8
256
65,536
7
128
131,072
6
64
262,144
5
32
524,288
4
16
1,048,576
3
8
2,097,152
2
4
4,194,304
1
2
8,388,608
0
1
16,777,216

Class B Addressing Guide


# of bits
Total # of Subnets
Borrowed
14
16,384
13
8192
12
4096

Total # of Hosts
4
8
16

Subnet Mask
255.0.0.0
255.255.0.0
255.255.255.0
N/A
N/A

Total Assignable
Hosts
0
2
6
14
30
62
126
254
510
1022
2046
4094
8190
16,382
32,766
65,534
131,070
262,142
524,286
1,048,574
2,097,150
4,194,302
8,388,606
16,777,214

Total Assignable
Hosts
2
6
14

/27
/26
/25
/24
/23
/22
/21
/20
/19
/18
/17
/16

CIDR
/30
/29
/28
/27
/26
/25
/24

255.255.255.224
255.255.255.192
255.255.255.128
255.255.255.0
255.255.254.0
255.255.252.0
255.255.248.0
255.255.240.0
255.255.224.0
255.255.192.0
255.255.128.0
255.255.0.0

Subnet Mask
255.255.255.252
255.255.255.248
255.255.255.240
255.255.255.224
255.255.255.192
255.255.255.128
255.255.255.0

11
10
9
8
7
6
5
4
3
2
1
0

2048
1024
512
256
128
64
32
16
8
4
2
1

Class C Addressing Guide


# of bits
Total # of Subnets
Borrowed
6
64
5
32
4
16
3
8
2
4
1
2
0
1

32
64
128
256
512
1024
2048
4096
8192
16,384
32,768
65,536

30
62
126
254
510
1022
2046
4094
8190
16,382
32,766
65,534

Total # of Hosts

Total Assignable
Hosts
2
6
14
30
62
126
254

4
8
16
32
64
128
256

CIDR

Subnet Mask

/32
/31
/30
/29
/28
/27
/26
/25
/24
/23
/22
/21
/20
/19
/18
/17
/16
/15
/14
/13
/12
/11
/10
/9
/8

255.255.255.255
255.255.255.254
255.255.255.252
255.255.255.248
255.255.255.240
255.255.255.224
255.255.255.192
255.255.255.128
255.255.255.0
255.255.254.0
255.255.252.0
255.255.248.0
255.255.240.0
255.255.224.0
255.255.192.0
255.255.128.0
255.255.0.0
255.254.0.0
255.252.0.0
255.248.0.0
255.240.0.0
255.224.0.0
255.192.0.0
255.128.0.0
255.0.0.0

IP Addressing Guide Class A, Class B, Class C


# of bit borrowed
Total Subnets = 2**S
Total Hosts
S = CIDR - N
or 2**(24-H/16-H/8-H)
A
B
C
A
B
C
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0

14
13
12
11
10
9
8
7
6
5
4
3
2
1
0

6
5
4
3
2
1
0

240
176
112
48
224
96
192
128
0

236
172
108
44
216
88
176
96

232
168
104
40
208
80
160
64

Mask

Subnet Boundary

/30

252
188
124
60
248
120
240
224
192
128

/29
/28
/27
/26
/25

248
184
120
56
240
112
224
192
128
0

244
180
116
52
232
104
208
160
64

4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2

228
164
100
36
200
72
144
32

224
160
96
32
192
64
128
0

16384

8192
4096
2048
1024
510
256
128
64
32
16
8
4
2

220
156
92
28
184
56
112

216
152
88
24
176
48
96

64
32
16
8
4
2

212
148
84
20
168
40
80

Total Hosts
Assignable

4
8
16
32
64
128
256
512
1024
2048
4096
8192
16,384
32,768
65,536
131,072
262,144
524,288
1,048,576
2,097,152
4,194,304
8,388,608
16,777,216

208
144
80
16
160
32
64

204
140
76
12
152
24
48

200
136
72
8
144
16
32

2
6
14
30
62
126
254
510
1022
2046
4094
8190
16,382
32,766
65,534
131,070
262,142
524,286
1,048,574
2,097,150
4,194,302
8,388,606
16,777,214

196
132
68
4
136
8
16

192
128
64
0
128
0
0

Note: A subnet address of a network always starts at boundary. A subnet address cannot starts in between two
boundaries.
Network Addresses are always EVEN

Broadcast addresses are always ODD

First usable addresses are always ODD

Last usable addresses are always EVEN

No host/node address can have (octets 2,3,4 or octets 3,4 or octet 4 containing) all 0s or all 1s
Octets containing all 0s are called Gateway address

Octets containing all 1s are called Broadcast address


Host/node address cannot be represented by octets containing all 0s or all 1s
Subnet X = Not necessarily 1 network rather consists of a range/group of networks with sequential IP address
Number of bits (N) for subnet X = 2 ** N < = X or Strip of all leading zeros and count # of remaining digits of X binary
CIDR = Mask Bits = # of leading 1s in 32 bits subnet mask
Total Number of Hosts = 2 ** (32 CIDR #) (including network and broadcast IP address)
Total number of assignable hosts = 2 ** (32 CIDR #) - 2
Number of Subnet = Class A: 2**(24 h) or 2**s || Class B: 2**(16 h) or 2**s || Class C: 2**(8 h) or 2**s

Calculating Subnets and its IP ranges in a Class A Network


Example 1
Given network IP address (25.0.0.0), get 14 subnets and its IP address ranges.
Network IP address (25.0.0.0) represents a class A network because 1st octet (e.g. 25) is within 0 127.
For class A network, 1st octet (e.g. 25) represents network address and octets 2, 3, 4 (e.g. 0.0.0) represent host/node address.
For subnetting a class A network address 25.0.0.0, we need to consider the 1st host/node octet (2nd octet of the network
address) and find out # of lower bits required to represent 14 (required # of subnet).
The binary representation of the 1st host/node octet or the 2nd octet of the network IP address (e.g. 0) is
0

0 0 0 0 0

128 64 32 16 8 4 2 1
Therefore, lower order 4 bits (8+4+2+1=15) are required to get 14 subnets.
To get the corresponding subnet mask, add 4 higher order bits (128+64+32+16) = 240
Therefore, the subnet mask of network address 25.0.0.0 for having 14 subnets is 25.240.0.0.
Please note that, in general, the subnet mask for the class A network is 255.0.0.0. But since the network IP address 25.0.0.0
has been subneted to 14 subnets the corresponding subnet mask is 25.240.0.0. The subnet mask 25.240.0.0 indicates that
the class A network IP address 25.0.0.0 contains max of 2**4 2 = 14 subnets.
The added high order bits used in determining the subnet mask are 128, 64, 32, 16. The lowest of the high order bits is used
in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the
2nd octet of the given network address, that is 25.16.0.0. The subsequent subnet address will be determined just by adding
16 to the 2nd octet of the previous subnet address. Therefore, the 14 subnet addresses are:
25.16.0.0

25.32.0.0

25.48.0.0

25.64.0.0

25.80.0.0

25.96.0.0

25.112.0.0

25.128.0.0

25.144.0.0

25.160.0.0

25.176.0.0

25.192.0.0

25.208.0.0

25.224.0.0

The number of host/node IP addresses in each subnet = 2**(24 4) 2 = 1048576 2 = 1048574


The IP ranges of individual subnet are as follows.

Subnet #

Subnet Addr

Start Addr

End Addr

Broadcast Addr

25.16.0.0

25.16.0.1

25.31.255.254

25.31.255.255

25.32.0.0

25.32.0.1

25.47.255.254

25.47.255.255

25.48.0.0

25.48.0.1

25.63.255.254

25.63.255.255

25.64.0.0

25.64.0.1

25.79.255.254

25.79.255.255

25.80.0.0

25.80.0.1

25.95.255.254

25.95.255.255

25.96.0.0

25.96.0.1

25.111.255.254

25.111.255.255

25.112.0.0

25.112.0.1

25.127.255.254

25.127.255.255

25.128.0.0

25.128.0.1

25.143.255.254

25.143.255.255

25.144.0.0

25.144.0.1

25.159.255.254

25.159.255.255

10

25.160.0.0

25.160.0.1

25.175.255.254

25.175.255.255

11

25.176.0.0

25.176.0.1

25.191.255.254

25.191.255.255

12

25.192.0.0

25.192.0.1

25.207.255.254

25.207.255.255

13

25.208.0.0

25.208.0.1

25.223.255.254

25.223.255.255

14

25.224.0.0

25.224.0.1

25.239.255.254

25.239.255.255

Example 2
Given network IP address (100.24.0.0), get 25 subnets and its IP address ranges.
For class A network, one octet (1st octet) (e.g. 100) represents the network address
For class A network, 3 octets (octets 2, 3, 4) (e.g. 20.0.0) represent host/node address.
For subnetting class A network of address 100.20.0.0, we need to consider the 1st host/node octet (2nd octet of the network
address) and find out # of lower bits are required for 25 (required # of subnet).
The binary representation of the 1st host/node octet or the 2nd octet of the network IP address (that is 20) is
0

1 0 1 0 0

128 64 32 16 8 4 2 1
Therefore, lower order 5 bits (16+8+4+2+1=31) are required to get 25 subnets.
To get the corresponding subnet mask, add 5 higher order bits (128+64+32+16+8) = 248
Therefore, the subnet mask of 100.24.0.0 for having 25 subnets is 100.248.0.0.
Please note that, in general, the subnet mask for the class A network is 255.0.0.0. But since the network IP address
100.20.0.0 has been subneted to 25 subnets the corresponding subnet mask is 100.248.0.0.. The subnet mask 100.248.0.0
indicates that the class A network IP address 100.24.0.0 contains max of 2**5 2 = 30 subnets.
The added high order bits used in determining the subnet mask are 128, 64, 32, 16, 8. The lowest of the high order bits is
used in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to
the 2nd octet of the given network address, that is 100.20.0.0. The subsequent subnet address will be determined just by
adding 8 to the 2nd octet of the previous subnet address. Therefore, the 25 subnet addresses are

100.32.0.0

100.40.0.0

100.48.0.0

100.56.0.0

100.64.0.0

100.72.0.0

100.80.0.0

100.88.0.0

100.96.0.0

100.104.0.0

100.112.0.0

100.120.0.0

100.128.0.0

100.136.0.0

100.144.0.0

100.152.0.0

100.160.0.0

100.168.0.0

100.176.0.0

100.184.0.0

100.192.0.0

100.200.0.0

100.208.0.0

100.216.0.0

100.224.0.0

The number of host/node IP addresses in each subnet = 2**(24 5) 2 = 131072 2 = 131070


The IP ranges of individual subnet are as follows.
Subnet #

Subnet Addr

Start Addr

End Addr

Broadcast Addr

100.32.0.0

100.32.0.1

100.35.255.254

100.35.255.255

100.40.0.0

100.40.0.1

100.43.255.254

100.43.255.255

100.48.0.0

100.48.0.1

100.44.255.254

100.51.255.255

100.56.0.0

100.56.0.1

100.59.255.254

100.59.255.255

100.64.0.0

100.64.0.1

100.75.255.254

100.75.255.255

..

..

..

..

..

..

24

100.216.0.0

100.216.0.1

100.229.255.254

100.229.255.255

25

100.224.0.0

100.224.0.1

100.237.255.254

100.237.255.255

Calculating Subnets and its IP ranges in a Class B Network


Example 3
Given network IP address (131.100.0.0), get 13 subnets and its IP address ranges.
For class B network, octet 1st, 2nd (e.g. 131.100) represent the network address.
For class C network, octet 3rd, 4th (e.g. 0.0) represents host/node address.
For subnetting class B network of address 131.100.0.0 we need to consider the 1st host/node octet (3rd octet of the network
address) and find out # of lower bits are required for 13 (required # of subnet).
The binary representation of the 1st host/node octet or the 4th octet of the network IP address (that is 15) is
0

0 1 1 1 1

128 64 32 16 8 4 2 1
Therefore, lower order 4 bits (8+4+2+1=15) are required to get 13 subnets.
To get the corresponding subnet mask, add 4 higher order bits (128+64+32+16) = 240
Therefore, the subnet mask of network address 131.100.0.0 for having 13 subnets is 255.255.240.0.

Please note that, in general, the subnet mask for the class B network is 255.255.0.0. But since the network IP address
131.100.0.0 has been subneted to 13 subnets the corresponding subnet mask is 255.255.240.0. The subnet mask
255.255.240.0 indicates that the class C network IP address 131.100.0.0 contains max of 2**4 2 = 14 subnets.
The added high order bits used in determining the subnet mask are 128, 64, 32, 16. The lowest of the high order bits is used
in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the
3rd octet of the given network address (131.100.0.0). The subsequent subnet address will be determined just by adding 16 to
the 3rd octet of the previous subnet address. Therefore, the 13 subnet addresses are:
131.100.16.0

131.100.32.0

131.100.48.0

131.100.64.0

131.100.80.0

131.100.96.0

131.100.112.0

131.100.128.0

131.100.144.0

131.100.160.0

131.100.176.0

131.100.192.0

131.100.208.0

The number of host/node IP addresses in each subnet = 2**(16 4) 2 = 4096 - 2 = 4094


The IP ranges of individual subnet are as follows.
Subnet #

Subnet Addr

Start Addr

End Addr

Broadcast Addr

131.100.16.0

131.100.16.1

131.100.31.254

131.100.31.255

131.100.32.0

131.100.32.1

131.100.47.254

131.100.47.255

131.100.48.0

131.100.48.1

131.100.63.254

131.100.63.255

-----

----

----

----

-----

----

----

----

12

131.100.192.0

131.100.192.1

131.100.207.254

131.100.207.255

13

131.100.208.0

131.100.208.1

131.100.223.254

131.100.223.255

131.100.224.0

131.100.224.1

131.100.239.254

131.100.239.255

The last subnet is


14

Calculating Subnets and its IP ranges in a Class C Network


Example 5
Given network IP address (195.20.45.15), get 5 subnets and its IP address ranges.
For class C network, octet 1st, 2nd, 3rd (e.g. 195.20.45) represent the network address.
For class C network, octet 4th (e.g. 15) represents host/node address.
For subnetting class C network of address 195.20.45.15 we need to consider the 1st host/node octet (4th octet of the network
address) and find out # of lower bits are required for 5 (required # of subnet).
The binary representation of the 1st host/node octet or the 4th octet of the network IP address (that is 15) is
0

0 1 1 1 1

128 64 32 16 8 4 2 1
Therefore, lower order 3 bits (4+2+1=7) are required to get 5 subnets..
To get the corresponding subnet mask, add 3 higher order bits (128+64+32) = 224

Therefore, the subnet mask of network address 195.20.45.15 for having 5 subnets is 195.20.45.239.
Please note that, in general, the subnet mask for the class C network is 255.255.255.0. But since the network IP address
195.20.45.15 has been subneted to 5 subnets the corresponding subnet mask is 195.20.45.239. The subnet mask
195.20.45.239 indicates that the class C network IP address 195.20.45.15 contains max of 2**3 2 = 6 subnets.
The added high order bits used in determining the subnet mask are 128, 64, 32. The lowest of the high order bits is used in
determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the 4 th
octet of the given network address (195.20.45.15). The subsequent subnet address will be determined just by adding 32 to
the 4th octet of the previous subnet address. Therefore, the 5 subnet addresses are:
195.20.45.47

195.20.45.79

195.20.45.111

195.20.45.143

195.20.45.175

The number of host/node IP addresses in each subnet = 2**(8 3) 2 = 32 2 = 30


The IP ranges of individual subnet are as follows.
Subnet #

Subnet Addr

Start Addr

End Addr

Broadcast Addr

195.20.45.47

195.20.45.48

195.20.45.77

195.20.45.78

195.20.45.79

195.20.45.80

195.20.45.109

195.20.45.110

195.20.45.111

195.20.45.112

195.20.45.141

195.20.45.142

195.20.45.143

195.20.45.144

195.20.45.173

195.20.45.174

195.20.45.175

195.20.45.176

195.20.45.208

195.20.45.209

195.20.45.210

195.20.45.211

195.20.45.240

195.20.45.241

The last subnet is


6

Loss of Usable IP address


The loss of usable IP address in the class C network due to subneting is a lot. That loss depends on # of subnets are created.
The smaller number subnet creation means more loss of usable IP address and the bigger number subnet creation means
less loss of usable IP address.
For this particular example, you lost two usable IP address in each subnet (subnet address, broadcast address) plus all
address in between 195.20.45.15 and 195.20.45.47.
Example 6
Given network IP address (220.10.55.0), get 2 subnets and its IP address ranges.
For class C network, octet 1st, 2nd, 3rd (e.g. 220.10.55) represent the network address.
For class C network, octet 4th (e.g. 0) represents host/node address.
For subnetting class C network of address 220.10.55.0, we need to consider the higher order host/node octet (here is 4 th
octet of the network address) and find out # of lower bits required for 2 (required # of subnet).
The binary representation of the 1st host/node octet or the 4th octet of the network IP address (that is 0) is
0

0 0 0 0 0

128 64 32 16 8 4 2 1
Therefore, lower order 2 bits (2+1=3) are required to get 2 subnets..
To get the corresponding subnet mask, add 2 higher order bits (128+64) = 192

Therefore, the subnet mask of network address 220.10.55.0 for having 2 subnets is 220.10.55.192.
Please note that, in general, the subnet mask for the class C network is 255.255.255.0. But since the network IP address
220.10.55.0 has been subneted to 2 subnets the corresponding subnet mask is 220.10.55.192. The subnet mask
220.10.55.192 indicates that the class C network IP address 220.10.55.0 contains max of 2**2 2 = 2 subnets.
The added high order bits used in determining the subnet mask are 128, 64. The lowest of the high order bits is used in
determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the 4 th
octet of the given network address (220.10.55.0). The subsequent subnet address will be determined just by adding 64 to
the 4th octet of the previous subnet address. Therefore, the 2 subnet addresses are:
220.10.55.64

195.20.45.128

The number of host/node IP addresses in each subnet = 2**(8 2) 2 = 64 2 = 62


The IP ranges of individual subnet are as follows.
Subnet #

Subnet Addr

Start Addr

End Addr

Broadcast Addr

220.10.55.64

220.10.55.65

220.10.55.126

220.10.55.127

220.10.55.128

220.10.55.129

220.10.55.190

220.10.55.191

Loss of Usable IP address


The loss of usable IP address in the class C network due to subneting is a lot. That loss depends on # of subnets are created.
The smaller number subnet creation means more loss of usable IP address and the bigger number subnet creation means
less loss of usable IP address.
For this particular example, you lost two usable IP address in each subnet (subnet address, broadcast address) plus all
address in between 220.10.55.0 and 220.10.55.64.

Mask to CIDR Conversion


Problem 1: Find CIDR when Subnet Mask is 255.255.248.0
The binary representation of subnet mask 255.255.248.0 is
11111111

# of leading 1s

11111111

11111000

00000000

Total # of leading 1s = 8 + 8 + 5 = 21
Therefore, CIDR = /21
Problem 2: Find CIDR when Subnet Mask is 255.255.255.192
The binary representation of subnet mask 255.255.255.192 is
11111111

# of leading 1s

11111111

11111111

11000000

Total # of leading 1s = 8 + 8 + 8 + 2 = 26

Therefore, CIDR = /26


CIDR to Mask Conversion
Problem 3: Find subnet mask when CIDR is /23
23/8 = 2 with remainder 7
Mask = 8 leading 1 in 1st octet, 8 leading 1 in 2nd octet, 7 leading 1 in 3rd octet, 0 leading 1 in 4th octet
The binary representation of Mask is 11111111

11111111

11111110

00000000

The decimal representation of Mask is 255.255.254.0


Problem 4: Find subnet mask when CIDR is /29
29/8 = 3 with remainder 5
Mask = 8 leading 1 in 1st octet, 8 leading 1 in 2nd octet, 8 leading 1 in 3rd octet, 5 leading 1 in 4th octet
The binary representation of Mask is 11111111

11111111

11111111

11111000

The decimal representation of Mask is 255.255.255.248


Problem 5: Given a network address and subnet mask Find # of subnets and # of hosts per subnet.
Given the address - 172.16.0.0 /22
First we list the binary representation of network IP address and then the subnet mask.
Network IP address

10101100 00010000 00000000 00000000

Class B

|--------network--------| |-----------host----------|
Subnet mask = /22 (8+8+6+0)

11111111 11111111 11111100 00000000


|--------|-----------------|
p=6

q=10

Number of subnets:
For class B network, 1st host octet or 3rd network IP address octet is used for subnet calculation. We look for # of high
order non zero in sequence bits in the 3rd octet of the mask or # of high order non zero in sequence bits in the host.
That is 6 ( /22 = 8 + 8 + 6).
Formula: = 2**p 2, where p = 6 is # of high order non zero in sequence bits in the 3rd octet in the mask
Therefore, the # of subnets = 2**6 2 = 64-2 = 62.
Number of hosts per subnet:
Formula: 2**q 2, where q is # of bits available for hosts = 10 (/22: 32 - 22 = 10)
or # of low order zero in sequence bits in the mask = 10
Therefore, # of hosts per subnet = 2**10 - 2 = 1024 - 2 = 1022
Problem 6: Given a network address (172.16.0.0 ), # of subnets, and hosts per subnet, Find the customers subnets.
(Requirements: need 6 departments with 2000 hosts per department)
First we list the network address and then the mask in binary:

10

Network address

10101100 00010000 00000000 00000000

172.16.0.0 Class B

Network mask

11111111 11111111 00000000 00000000

255.255.0.0 Default class B net mask

For class B network, octet 1st, 2nd (e.g. 172.16) represent the network address.
For class B network, octet 3rd, 4th (e.g. 0.0) represents host/node address.
For subnetting class B network of address 172.16.0.0, we need to consider the higher order host/node octet (here is 3rd octet
of the network address) and find out # of lower bits required for 6 (required # of department which is same as subnet).
The binary representation of the 1st host/node octet or the 3rd octet of the network IP address (that is 0) is
0

0 0 0 0 0

128 64 32 16 8 4 2 1
Therefore, lower order 3 bits (4+2+1=7) are required to get 6 subnets.
To get the corresponding subnet mask, take 3 higher order non-zero in-sequence bits and add them (128+64+32) = 224
Therefore, the subnet mask of network address 172.16.0.0 is 172.16.224.0 that can be represented by 172.16.0.0/19
The # of host per subnet = 2**(total host bits in class B - # of higher bits used for subnet) - 2
= 2**(16 3) 2 = 8192 2 = 8190 ------- enough host per subnet as requirement.

Problem 7: Given a network address (172.16.0.0) and subnet mask (255.255.224.0), list the valid subnets
First we list the mask then the address in binary:
First we list the network address and then the mask in binary:
Network address

10101100 00010000 00000000 00000000

172.16.0.0 Class B

Network mask

11111111 11111111 11100000 00000000

255.255.224.0

|---|-------|
3

As we know, for class B network the corresponding to the 1 st host octet or corresponding to the 3rd network octet of the
mask play an important role for calculating subnet ranges (# of subnets). Here, mask used 3 extra bits (3 non-zero
high order in-sequence bits) and 5 zero in-sequence bits. This 5 non-zero in-sequence bits signifies the subnet
ranges. Therefore, 2**5 = 32 is the range of subnet address or the subnet address interval. Therefore, we need to add
32 to the 1st host octet in order to subnet ranges. Therefore, the valid subnets are:
172.16.32.0

172.16.64.0

172.16.96.0

172.16.128.0

172.16.160.0

172.16.192.0

172.16.224.0

An even simpler way to do this is list the mask, say 255.255.255.224


As the fourth octet has been manipulated we subtract 224 from 256 = 32 so our networks will increment in 32's, 32,
64, 96 etc
Problem 8: Given a network address (192.168.1.44 ) and subnet mask (255.255.255.192) identify which subnet the
address belongs to (here address means 192.168.1.44).
First we covert the network address and then the subnet mask to binary

11

Network addr

11000000 10101000 00000001 00101100

192.168.1.44 class C network

Network mask

11111111 11111111 11111111 11000000

255.255.255.292

Next we do a logical AND, where we compare the subnet mask to the address and where there is a 1 and a 1 we list
1, where there is a 1 and a 0 we list as 0, and where is a 0 and a 0 we list 0
So adding our two values we get:
11000000 10101000 00000001 00000000
Converting our address back to binary we get: 192.168.1.0 - which is the subnet our address belongs to

Class C Subnet at a Glance


Example: /25 Network
Network/Subnet mask = /25; Total Subnet = 2; IP Addr per subnet = 128; Hosts per subnet = 126
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.126

195.20.45.127

195.20.45.128

195.20.45.129

195.20.45.130

195.20.45.254

195.20.45.255

Example: /26 Network

Network/Subnet mask = /26; Total Subnet = 4; IP Addr per subnet = 64; Hosts per subnet = 62
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.62

195.20.45.63

195.20.45.64

195.20.45.65

195.20.45.66

195.20.45.126

195.20.45.127

195.20.45.128

195.20.45.129

195.20.45.130

195.20.45.190

195.20.45.191

195.20.45.192

195.20.45.193

195.20.45.194

195.20.45.254

195.20.45.255

Example: /27 Network


Network/Subnet mask = /27; Total Subnet = 8; IP Addr per subnet = 32; Hosts per subnet = 30
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.30

195.20.45.31

195.20.45.32

195.20.45.33

195.20.45.34

195.20.45.62

195.20.45.63

195.20.45.64

195.20.45.65

195.20.45.66

195.20.45.94

195.20.45.95

195.20.45.96

195.20.45.96

195.20.45.98

195.20.45.126

195.20.45.127

195.20.45.128

195.20.45.129

195.20.45.130

195.20.45.158

195.20.45.159

195.20.45.160

195.20.45.161

195.20.45.162

195.20.45.190

195.20.45.191

195.20.45.192

195.20.45.193

195.20.45.194

195.20.45.222

195.20.45.223

12

195.20.45.224

195.20.45.225

195.20.45.226

195.20.45.254

195.20.45.255

Example: /28 Network


Network/Subnet mask = /28; Total Subnet = 16; IP Addr per subnet = 16; Hosts per subnet = 14
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.14

195.20.45.15

195.20.45.16

195.20.45.17

195.20.45.18

195.20.45.30

195.20.45.31

195.20.45.32

195.20.45.33

195.20.45.34

195.20.45.46

195.20.45.47

195.20.45.48

195.20.45.49

195.20.45.50

195.20.45.62

195.20.45.63

195.20.45.64

195.20.45.65

195.20.45.66

195.20.45.78

195.20.45.79

195.20.45.80

195.20.45.81

195.20.45.82

195.20.45.94

195.20.45.95

195.20.45.96

195.20.45.97

195.20.45.98

195.20.45.110

195.20.45.111

195.20.45.112

195.20.45.113

195.20.45.114

195.20.45.126

195.20.45.127

195.20.45.128

195.20.45.129

195.20.45.130

195.20.45.142

195.20.45.143

10

195.20.45.144

195.20.45.145

195.20.45.146

195.20.45.158

195.20.45.159

11

195.20.45.160

195.20.45.161

195.20.45.162

195.20.45.174

195.20.45.175

12

195.20.45.176

195.20.45.177

195.20.45.178

195.20.45.190

195.20.45.191

13

195.20.45.192

195.20.45.193

195.20.45.194

195.20.45.206

195.20.45.207

14

195.20.45.208

195.20.45.209

195.20.45.210

195.20.45.222

195.20.45.223

15

195.20.45.224

195.20.45.225

195.20.45.226

195.20.45.238

195.20.45.239

16

195.20.45.240

195.20.45.241

195.20.45.242

195.20.45.254

195.20.45.255

Example: /29 Network


Network/Subnet mask = /29; Total Subnet = 32; IP Addr per subnet = 8; Hosts per subnet = 6
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.6

195.20.45.7

195.20.45.8

195.20.45.9

195.20.45.10

195.20.45.14

195.20.45.15

195.20.45.16

195.20.45.17

195.20.45.18

195.20.45.22

195.20.45.23

195.20.45.24

195.20.45.25

195.20.45.26

195.20.45.30

195.20.45.31

..

..

..

..

..

..

30

195.20.45.232

195.20.45.233

195.20.45.234

195.20.45.238

195.20.45.239

31

195.20.45.240

195.20.45.241

195.20.45.242

195.20.45.246

195.20.45.247

32

195.20.45.248

195.20.45.249

195.20.45.250

195.20.45.254

195.20.45.255

13

Example: /30 Network


Network/Subnet mask = /30; Total Subnet = 64; IP Addr per subnet = 4; Hosts per subnet = 2
Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved
Subnet #

Subnet Network Addr

Subnet GW Addr

Subnet Start Addr

Subnet End Addr

Broadcast Addr

195.20.45.0

195.20.45.1

195.20.45.2

195.20.45.2

195.20.45.3

195.20.45.4

195.20.45.5

195.20.45.6

195.20.45.6

195.20.45.7

195.20.45.8

195.20.45.9

195.20.45.10

195.20.45.10

195.20.45.11

195.20.45.12

195.20.45.13

195.20.45.14

195.20.45.14

195.20.45.15

..

..

..

..

..

..

62

195.20.45.244

195.20.45.245

195.20.45.246

195.20.45.246

195.20.45.247

63

195.20.45.248

195.20.45.249

195.20.45.250

195.20.45.250

195.20.45.251

64

195.20.45.252

195.20.45.253

195.20.45.254

195.20.45.254

195.20.45.255

14

You might also like