You are on page 1of 28

Subnetting Basics

Michael D. Mann

© Copyright 2009 by : Michael D. Mann


1
Subnetting Basics
Prerequisite Knowledge

Class 1st Octet Valid Network Total Number of


Range Numbers Networks hosts per
for this network
class

A 1 -126 1.0.0.0 to 126 224 – 2


126.0.0.0 16,777,214
N.H.H.H

B 128 – 191 128.0.0.0 to 16,384 216 – 2


191.255.0.0 65,534
N.N.H.H

C 192 – 223 192.0.0.0 - 2,097,152 28 – 2


223.255.255.0 254
N.N.N.H

N = network octet H = host octet 2


Subnetting Basics
Prerequisite Knowledge
Definitions
Network ID : all host bits are set to 0
192.168.32.0000 0000
Ex : 192.168.32.0 /24

Broadcast ID : all host bits are set to 1


192.168.32.1111 1111
Ex : 192.168.32.255 /24
IP Address : any value in between
192.168.32.0000 0001 – 1111 1110
Ex : 192.168.32.1 - .254 /24
3
Subnetting Basics
Prerequisite Knowledge
Binary Number System

1 BYTE = 8 BITS : 1010 0001


Each bit position has an associated PLACE VALUE as indicated :
27 26 25 24 23 22 21 20
1 0 1 0 0 0 0 1

Add up the 2place


7
+ values
25 +wherever you have
20 a =“1”161
bit 10

1100 00102 = 194


? 10

This is how you convert from binary to decimal 4


Subnetting Basics
Prerequisite Knowledge

A subnet mask gives meaning to a network address space

Class A default subnet mask : 255.0.0.0 ( /8 )

Class B default subnet mask : 255.255.0.0 ( /16 )

Class C default subnet mask : 255.255.255.0 ( /24 )

5
Subnetting Basics
A subnet mask is logically ANDed with a network address space
in order to return the network and subnetwork space
The logical AND Truth Table

AND 1 0

1 1 0

0 0 0
Click once to see the result of 1 AND 1 6
Subnetting Basics

A subnet mask is logically ANDed with a network address space


in order to return the network and subnetwork space

Ex1 : 192.168.32.145 /24 (no subnetting)


1100 0000. 1010 1000. 0010 0000. 1001 0001
Default mask :
255.255.255.0 1111 1111. 1111 1111. 1111 1111. 0000 0000
AND Result : 1100 0000. 1010 1000. 0010 0000. 0000 0000
192. 168. 32. 0
Notice how only the network address is returned (192.168.32.0)
7
Subnetting Basics
Example
Class C 192.168.32.0 /24 :
subnet the address space to create 4 subnets.
Concept :
Find out how many bits to borrow from the host octet to create
the number of subnets you need.
Math :
Let x represent the number of bits required.
Let y represent the number of subnets required.
Equations : 2x >= y and 2x < y * 2, substitute 4 for y :
Equations : 2x >= 4 and 2x < 8
Notes :
The value for y is usually given in the problem.
Find a value for x that satisfies BOTH equations. 8
Subnetting Basics
Example
Class C 192.168.32.0 /24 :
subnet the address space to create 4 subnets.
Powers of base 2 :
27 = 128 26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1

Math :
Let x represent the number of bits required for 4 subnets.
Let y represent the number of subnets required.
Equations : 2x >= y and 2x < y * 2, substitute 4 for y :
Equations : 2x >= 4 and 2x < 8 Note : x = log y / log 2
Solution :
The value of x that satisfies BOTH equations = ? 2
9
Subnetting Basics
Example
Class C 192.168.32.145 /24 :
subnet the address space to create 4 subnets.

Ex : 192.168.32.145 /26 (subnetted)


1100 0000. 1010 1000. 0010 0000. 1001 0001
Custom mask :
255.255.255.192 1111 1111. 1111 1111. 1111 1111. 1100 0000
AND Result : 1100 0000. 1010 1000. 0010 0000. 1000 0000
192. 168. 32. 128
Notice the network and subnet address is returned (192.168.32.128)

What is the host ID ? 10 010001 (17) 10


Subnetting Basics
Equations

To find the number of subnets use : 2x = number of subnets


Where x = number of bits required

To find the number of hosts use : 2x – 2 = number of hosts


Where x = number of bits required

You must subtract 2 to account for the 2 IPS that cannot


be used for hosts : host bits = all 0s and host bits = all 1s

(See slide 3)
11
Subnetting Basics

Subnetting is the process of sub-dividing a network

Network Space : 192.168.32.0 /24

192.168.32.0 /24
This blue box represents the whole network space

28 - 2 = 254 total hosts

12
Subnetting Basics
Subnetting is the process of sub-dividing a network

Network Space : 192.168.32.00 000000 /26

Class C default mask /24 = 255.255.255.0000 0000


Custom created mask /26 = 255.255.255.11 000000

First Subnet = 00 000000 Second Subnet = 01 000000

Third Subnet = 10 000000 Fourth Subnet = 11 000000

Subnet Bits and Host Bits


13
Subnetting Basics
Subnetting is the process of sub-dividing a network

Network Space : 192.168.32.00 000000 /26

.0 .64 .128 .192


00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

This blue box represents the sub-divided network space


14
Subnetting Basics
The new sub-divided network :
.0 .64 .128 .192
00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

Subnet 1 : 192.168.32.0 /26


Subnet 2 : 192.168.32.64 /26
Subnet 3 : 192.168.32.128 /26
Subnet 4 : 192.168.32.192 /26

Notice how the subnet addresses are multiples of 64

15
Subnetting Basics
The MULTIPLIER :
Subnet 1 : 192.168.32.0 /26 Subnet 2 : 192.168.32.64 /26
Subnet 3 : 192.168.32.128 /26 Subnet 4 : 192.168.32.192 /26
Notice how the subnet addresses are multiples of 64
The number 64 is called the Multiplier.

Custom created subnet mask : 255.255.255.192


Shortcut to find the Multiplier : 256 – 192 = 64
Concept :192 in Binary = 11 000000 ( /26 )
Find the Least Significant Subnet Bit : 11 000000
Take it’s Place Value : 26 = 64
16
Subnetting Basics
The new sub-divided network :

.0 .64 .128 .192


00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

Subnet 1 Subnet Address : 192.168.32.0 /26 > 00 000000


Subnet 1 Minimum Host : 192.168.32.1 /26 > 00 000001

Subnet 1 Maximum Host : 192.168.32.62 /26 > 00 111110


Subnet 1 Broadcast : 192.168.32.63 /26 > 00 111111

17
Subnetting Basics
The new sub-divided network :

.0 .64 .128 .192


00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

Subnet 2 Subnet Address : 192.168.32.64 /26 > 01 000000


Subnet 2 Minimum Host : 192.168.32.65 /26 > 01 000001

Subnet 2 Maximum Host :192.168.32.126 /26 > 01 111110


Subnet 2 Broadcast : 192.168.32.127 /26 > 01 111111

18
Subnetting Basics
The new sub-divided network :

.0 .64 .128 .192


00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

Subnet 3 Subnet Address : 192.168.32.128 /26 > 10 000000


Subnet 3 Minimum Host :192.168.32.129 /26 > 10 000001

Subnet 3 Maximum Host :192.168.32.190 /26 > 10 111110


Subnet 3 Broadcast : 192.168.32.191 /26 > 10 111111

19
Subnetting Basics
The new sub-divided network :

.0 .64 .128 .192


00 01 10 11
26 – 2 = 26 – 2 = 26 – 2 = 26 – 2 =
62 hosts 62 hosts 62 hosts 62 hosts

Subnet 4 Subnet Address : 192.168.32.192 /26 > 11 000000


Subnet 4 Minimum Host :192.168.32.193 /26 > 11 000001

Subnet 4 Maximum Host :192.168.32.254 /26 > 11 111110


Subnet 4 Broadcast : 192.168.32.255 /26 > 11 111111

20
Three Types of
Subnetting Questions
Those that deal with …

The number of HOSTS

The number of SUBNETS

The MULTIPLIER

21
The Number of HOSTS
Given (Class C) : 192.168.32.66 /27
How many HOSTS can be supported per subnet?

/27 = 000 00000


Subnet bits Host bits
25 – 2 = 30

You must subtract 2 because of the 32 possible combinations,


the following combinations are not useable for host IDs :
all host bits = 0, this is a network and/or subnetwork ID
all host bits = 1, this is a broadcast ID.
This leaves 30 out of the 32 combinations for host IDs
22
The Number of Subnets
Given (Class C) : 192.168.32.66 /27
How many Subnets can be supported?

/27 = 000 00000


Subnet bits Host bits
23 = 8
You can support up to 8 subnets with 3 subnet bits

23
The MULTIPLIER
Given : 192.168.32.66 /27

What subnet contains this IP address ?


Step 1 : Find the multiplier : M = 32 (see slide 15)
Step 2 : Divide the subnetted octet by M and drop the fractional portion
of the answer :
66 / 32 = 2.0625
Step 3 : Multiply M by the integer result from Step 2 :
32 * 2 = 64
The subnet that contains this IP address is Subnet 64
24
Class B Network Example
172.16.0.0/16

10101100.00010000.00000000.00000000

Required : 45 subnets each having at least 500 hosts


How many bits are required to represent 45 subnets ?
6 bits are required : 26 = 64

10101100.00010000.00000000.00000000
Network bits Subnet bits Host bits
Are 10 host bits enough to represent 500 hosts Yes
?
Why ? 210 – 2 = 1022 - more than enough for 500 hosts! 25
Class B Network Example
172.16.0.0/22

10101100.00010000.00000000.00000000

Minimum host with subnet ID 4


10101100.00010000.00000100.00000001
172.16.4.1 /22

Maximum host with subnet ID 4


10101100.00010000.00000111.11111110
172.16.7.254 /22

26
Class B Network Example
172.16.0.0/22
10101100.00010000.00000000.00000000
Minimum host with subnet ID 4
10101100.00010000.00000100.00000001
172.16.4.1 /22

Maximum host with subnet ID 4


10101100.00010000.00000111.11111110
172.16.7.254 /22
Notice the change in the 3rd octet even though we are still in
the same subnet 27
Internet Resources

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800a67f5.shtml

www.semsim.com/ccna/tutorial/subnetting/subnetting.html

www.learntosubnet.com

28

You might also like