You are on page 1of 4

110

0.

192.

0.

11011111.11111111.11111111.11111111

0 223.255.255.255

11000000.00000000.00000000.00000000

0.

10111111.11111111.11111111.11111111

01111111.11111111.11111111.11111111

0 191.255.255.255

10000000.00000000.00000000.00000000

0.

128.

00000001.00000000.00000000.00000000

0.

127.

0.

01111111.11111111.11111111.11111110

1 127.255.255.254
01111111.00000000.00000000.00000001

Power of 2

Sum

Binary
Value

32

16

128 192 224 240 248 252 254 255


28 27 26 25 24 23 22 21

128 64

*Prefix Size refers to the leading bits of all addresses in the block.
#
Link-local addresses are self assigned when a DHCP address is unavailable.

LOOPBACK

10101001.11111110.11111110.11111111

1 169.254.254.255
10101001.11111110.00000000.00000001

0.

169.254.

0. 0 192.168.255.255
16 Bit 192.168.
11000000.10101000.00000000.00000000 11000000.10101000.11111111.11111111

C
LINK-LOCAL#

16. 0. 0 172. 31.255.255


12 Bit 172.
10101100.00010000.00000000.00000000 10111111.00011111.11111111.11111111

00001010.11111111.11111111.11111111

00001010.00000000.00000000.00000000

RESErved (AKA private/unroutable) Address Blocks


Prefix
CLASS
START IP
END IP
size*
10. 0. 0. 0 010.255.255.255
A
8 Bit

*Class ID refers to the leading bits of all addresses in the class.

10

CLASS

IP address classes
CLASS
START IP
END IP
ID*
1. 0. 0. 0 126.255.255.255
0

SUBNET MASKING

SUBNET MASK BITS


255.255.255.240
11111111.11111111.11111111.11110000
^
^
Network Bits
Host Bits

Network Bits (ones) are always next to each other,



starting at the left.
Host Bits (zeroes) are always next to each other,

starting at the right.
2# Network Bits - 2 = Number of Available Subnets
2# Host Bits - 2
= Number of Available Host Addresses
(Remember, first and last arent legal)

Increment (or Block Size)


There are several ways to find the increment:
= 256 - (rightmost octet more than 0)
= rightmost Network Bit (binary 1)
= 2Host Bits

SUBNET ID (or Subnet Number)


Youll be given an IP and asked to find what subnet
it is in. Youll need the increment or subnet mask.
Find what class the IP is:
(first octet is: A=1-126; B=128-191; C=192-223)

Then write the Subnet Mask over the IP Address


If the Subnet Mask is 255, copy the IP octet below

If the Subnet Mask is
0, copy the zero below
If not 255 or 0, divide Mask octet by Increment
Round down for your Subnet Number
Take Increment times Subnet Number and copy it for

your complete Subnet IP Address

Binary
Value
Sum
Power of 2

128 64

32

16

128 192 224 240 248 252 254 255


27 26 25 24 23 22 21 20

256-240=16

255.255.255.240
11111111.11111111.11111111.11110000
= 16
^
10000
Binary
Decimal

24=16=2x2x2x2

255.255.240. 0
177.168. 83.101
177.168.???. 0

83 / (256-240) 5.188

^ 3rd IP Octet

^ Increment (its 16)

Youre in Subnet 5
??? = 5(Subnet)x16(increment)=80
Subnet IP
177.168.80.0

Subnet Mask: 255.255.255.224


IP License: 198.203. 18. 0

SUBNET MASKING EXAMPLE

Subnet Mask = 255.255.255.224; 224 in Binary = 11100000


Interval or Block Size = 2H; Count the Zeros = 5; 25 = 32 ->
Increment = 32
N
3
Usable Subnets = 2 - 2; Count the Ones = 3; 2 = 8; 8 - 2 = 6 -> 6 Usable Subnets
Usable Hosts = Increment - 2; 32(Increment) - 2 = 30 ->
30 Usable Hosts Per Subnet
The First and Last Subnet, and the First and Last Host on each Subnet are not usable.

SN#

Subnet ID

First Host

Last Host

Broadcast Address

198.203. 18.

0 198.203. 18.

198.203. 18. 32 198.203. 18. 33 198.203. 18. 62 198.203. 18. 63

198.203. 18. 64 198.203. 18. 65 198.203. 18. 94 198.203. 18. 95

198.203. 18. 96 198.203. 18. 97 198.203. 18.126 198.203. 18.127

198.203. 18.128 198.203. 18.129 198.203. 18.158 198.203. 18.158

198.203. 18.160 198.203. 18.161 198.203. 18.190 198.203. 18.191

198.203. 18.192 198.203. 18.193 198.203. 18.222 198.203. 18.223

198.203. 18.224 198.203. 18.225 198.203. 18.254 198.203. 18.255

1 198.203. 18. 30 198.203. 18. 31

Subnet ID + 1 Next Subnet - 2 Next Subnet - 1

Subnet Mask: 255.255.255.224


IP License: 198.203. 18. 0

VLSM:Variable

Length Subnet Masking

Standard subnetting provides a relatively small number of subnetworks, all with the same number of hosts.
VLSM allows us to split up these subnets into smaller and smaller groups, to use the addresses efficiently.
Say we were asked to subnet the 192.168.1.0/24 CIDR block, and the following were the network sizes needed:
55, 2, 28, 2, 11, 2, 2. (Networks of 2 hosts are usually between routers.)
Now, if we used standard subnetting, we would have to use the 255.255.255.240 Subnet Mask to provide 14 subnets
(because 6 isnt enough) but there are only 14 available hosts in each subnet! What do we do?
Lets start by sorting the necessary subnet sizes from largest to smallest: 55, 28, 11, 2, 2, 2, 2
Now, figure out what Subnet Mask is needed to fit 55 hosts (Check on your binary reference for powers of 2):

2H - 2 = Number of Available Hosts; So we need 2H to be at least (55 + 2). The smallest power of 2 bigger
than 55 is 26 = 64. So that means we have 6 Host Bits (from 26). That means the last octet has six zeros.
11000000. Use your cheat sheet to find that means our overall subnet mask is 255.255.255.192.
Lets see whats happening in the diagram at the bottom:

We can take one of those two available subnets and give it to the office that needs 55 hosts.

Next, we need to fit 28. 25 = 32, that will fit. That makes our last octet 11100000 or 255.255.255.224.
That split our subnet into two equal subnets with 32 hosts available. Lets do it again.


We need a subnet to fit 11 hosts now. 24 = 16, that will fit. 11110000 is our new ending octet, or
255.255.255.240. That gives us two subnets with 16 hosts each. One goes to the office with 11 hosts, and
well split up the last one.
We need a Subnet Mask to support four groups of two hosts. So we split that last subnet twice instead of once.


23 = 8... 22 = 4. That means we use 11111100 as our last octet, or 255.255.255.252.
(Connections between two routers always use this subnet mask.)

1 2 3 4

Networks in Subnet Mask


255.255.255.192:
192.168.1.0 (SN ID)

Networks in Subnet Mask


255.255.255.224:
192.168.1.128 (fits 28 hosts)

Networks in Subnet Mask


255.255.255.240:
192.168.1.160 (fits 11 hosts)

Networks in Subnet Mask


255.255.255.252:
192.168.1.176 (fits 2 hosts)

192.168.1.64 (fits 55 hosts)

192.168.1.160

192.168.1.176

192.168.1.180 (fits 2 hosts)

192.168.1.128

192.168.1.184 (fits 2 hosts)

192.168.1.192 (BROADCAST)

192.168.1.188 (fits 2 hosts)

You might also like