use Decimal! Part 2

cursefarmNetworking and Communications

Oct 24, 2013 (3 years and 9 months ago)

123 views

1

Real Networkers don’t
use Decimal! Part 2

Planning Subnets

October 18, 2004

2

Steps to planning a subnet


Obtain starting block of addresses


Determine how many subnets and how many
hosts on each subnet you will need


Determine how many host bits to “borrow”


Create a subnet mask


Create a subnet table listing, for each subnet:


Subnet Address and Mask


Host Address Range


Broadcast address

3

Starting Block of addresses


Determined by a
network address

and a
mask


At first, every starting blocks will be a simple
Class A, B or C network.


Variable Length Subnetting allows a subnet
to be further subnetted

4

Determining # of Subnets &
Hosts


Some information will be provided


Assume if only one number is provided (e.g.
# of subnets), the goal is to maximize the
other (e.g. # of hosts)


In the real world be sure to discuss growth
plans with the client!

5

How many bits to borrow


Remember the formula’s!

# of Possible Subnets = 2
Number of subnet bits

# of Possible Hosts = 2
Number of host bits

# of Usable Hosts = (2
Number of host bits
)


2



Note: Networks running RIP protocol version 1 can’t use
the first (Subnet 0) and the last (all 1’s) subnet . Older
texts will show the formula

# of Usable Subnets = # of Possible Subnets
-

2


6

Number of host bits


The number of host bits will be determined by
your subnet mask.


It is a good idea to confirm that there will be
enough host bits to meet the specifications.

7

Class C Sample Problem


Subnet the 222.33.4.0 network to create at least 10
networks while maximizing the number of hosts.


Step 1. Determine # of bits to borrow


The formula 2
N

≥ 10


Look at your Powers of 2 table to find a value ≥ 10


You will need to borrow 4 bits.


8

Class C Problem Step 2


Step 2: Determine your mask.


Start with the Class C default mask:

11111111
.
11111111
.
11111111
.00000000


Change the 4 (
from previous step)

leftmost host bits
into subnet bits

11111111
.
11111111
.
11111111
.
1111
0000


Write the mask:

255.255.255.240 or /28

9

Class C Problem Step 3.


Identify your subnets


The formula determines that there are 16 possible subnets.

Subnet #

Bits

Subnet #

Bits

0

0000

8

1000

1

0001

9

1001

2

0010

10

1010

3

0011

11

1011

4

0100

12

1100

5

0101

13

1101

6

0110

14

1110

7

0111

15

1111

10

Class C Problem Binary
subnets


For example subnet 11 is


11011110 00100001 00000100

1011
0000

11011110 00100001
00000100

0000
0000

11011110 00100001
00000100

0000
0000

00000100

0001
0000

00000100

1001
0000

00000100

0010
0000

00000100

1010
0000

00000100

0011
0000

00000100

1011
0000

00000100

0100
0000

00000100

1100
0000

00000100

0101
0000

00000100

1101
0000

00000100

0110
0000

00000100

1110
0000

00000100

0111
0000

00000100

1111
0000

11

Class C Subnets

Dotted Decimal notation


Dotted Decimal notation ignores subnetting and
converts the 32 bit address into 8 bit chunks.


The 11
th

subnet:
11011110.00100001.00000100
.
1011
0000

becomes
222.33.4
.
176


What will be the 12
th

subnet in dotted decimal?

12

Class C Subnets

Dotted Decimal notation

#

Bits

Dotted

Decimal

#

Bits

Dotted

Decimal

0

11011110.00100001

00000100.
0000
0000

222.33.4
.0

8

11011110.00100001

00000100.
1000
0000

222.33.4
.128

1

.
0001
0000

222.33.4
.16

9

.
1001
0000

222.33.4
.144

2

.
0010
0000

222.33.4
.32

10

.
1010
0000

222.33.4
.160

3

.
0011
0000

222.33.4
.48

11

.
1011
0000

222.33.4
.176

4

.
0100
0000

222.33.4
.64

12

.
1100
0000

222.33.4
.192

5

.
0101
0000

222.33.4
.80

13

.
1101
0000

222.33.4
.208

6

.
0110
0000

222.33.4
.96

14

.
1110
0000

222.33.4
.224

7

.
0111
0000

222.33.4
.112

15

.
1111
0000

222.33.4
.240

13

Host addresses


Since number of possible host addresses depends
on the number of host bits, use the same formula
used to determine the number of subnets.

# of Host Addresses = 2
Number of host bits

4 host bits means 16 possible host addresses

14

Possible Hosts on Subnet 11

#

Bits

Dotted

Deceimal

#

Bits

Dotted

Deceimal

0

11011110.00100001

00000100.
1101
0000

222.33.4
.176

8

11011110.00100001

00000100.
1101
1000

222.33.4
.184

1

.
1101
0001

222.33.4
.177

9

.1101
1001

222.33.4
.185

2

.
1101
0010

222.33.4
.178

10

.1101
1010

222.33.4
.186

3

.
1101
0011

222.33.4
.179

11

.1101
1011

222.33.4
.187

4

.1101
0100

222.33.4
.180

12

.1101
1100

222.33.4
.188

5

.1101
0101

222.33.4
.181

13

.1101
1101

222.33.4
.189

6

.1101
0110

222.33.4
.182

14

.1101
1110

222.33.4
.190

7

.
1101
0111

222.33.4
.
183

15

.1101
1111

222.33.4
.191

Subnet and host bits are combined to create the dotted decimal

15

Special host addresses


A host address of all 0 bits is the network identifier
or
network address
.


11011110.00100001.00000100.
00000000

222.33.4.
0
/24


11011110.00100001.00000100.
1011
0000

222.33.4
.
176
/28



Subnet 11 from our sample


A host address of all 1 bits is the layer 3
broadcast
address

for that network.


11011110.00100001.00000100.
11111111

222.33.4.
255
/24


11011110.00100001.00000100.
1011
1111

222.33.4
.
191
/28




The broadcast address for subnet 11 from our sample


These two addresses can not be assigned to a host.


# of Usable Host Addresses


= (2
Number of host bits
)
-

2

16

Unusable Subnets


The all 0’s and all 1’s subnets should also not be
used when using
classful

(RIP version 1) routing.


The all 0’s subnet could be confused with the
original network.


11011110.00100001.00000100.
00000000

222.33.4.
0
/24


11011110.00100001.00000100.
0000
0000
222.33.4
.
0
/28


A broadcast to the all 1’s subnet could not be
distinguished from a broadcast to all hosts of the
original network


11011110.00100001.00000100.
11111111

222.33.4.
255
/24


11011110.00100001.00000100.
1111
1111
222.33.4
.
255
/28

Broadcast to subnet 15

17

Formulas

# of Possible Subnets


= 2
Number of subnet bits



# of Possible Hosts


= 2
Number of host bits

# of Usable Hosts


= (2
Number of host bits
)
-

2



# of Usable Subnets with RIP version 1


= (2
Number of subnet bits
)


2


18

Class B Sample Problem


Subnet the
172.
123
.
0.0

network to create at least 5
networks while maximizing the number of hosts.


Step 1. Determine # of bits to borrow


The formula 2
N

≥ 5


Look at the Powers of 2 table to find a value ≥ 5


You will need to borrow 3 bits.


19

Class B Problem Step 2


Step 2: Determine your mask.


Start with the Class B default mask:

11111111
.
11111111
.00000000.00000000


Change the 3 leftmost host bits (
from previous
step)

into subnet bits

11111111
.
11111111
.
111
00000.00000000


Write the mask:

255.255.
224
.0 or /19

20

Class B Problem Step 3.


Identify your subnets: The formula determines that
there are 8 possible Subnets.

#

Bits

Dotted

Decimal

#

Bits

Dotted

Decimal

0

10101100.01111011

000
00000
.
00000000

172.123
.0.
0

4

10101100.01111011

100
00000
.
00000000

172.123
.128.
0

1

001
00000
.
00000000

172.123
.32.
0

5

101
00000
.
00000000

172.123
.160.
0

2

010
00000
.
00000000

172.123
.64.
0

6

110
00000
.
00000000

172.123
.196.
0

3

011
00000
.
00000000

172.123
.96.
0

7

111
00000
.
00000000

172.123
.224.
0

Which subnets can not be used?

21

Host addresses

# of Host Addresses = 2
Number of host bits


11111111
.
11111111
.
111
00000.00000000


Number of host bits = 32


mask bits(19) = 13.


8192 Possible host addresses

The Powers of 2 table again!

22

Host Addresses


The 8,192 host addresses would range from

10101100 01111011
001
00000 00000000

10101100 01111011
001
00000 00000001

10101100 01111011
001
00000 00000010

to

10101100 01111011
001
00000 11111111

10101100 01111011
001
00001 00000000


10101100 01111011
001
00001 00000001


to

10101100 01111011
001
11111 11111110

10101100 01111011
001
11111 11111111



23

Host Addresses

Dotted Decimal


Using
Dotted Decimal

notation with Subnet 1, they
would range from

10101100.01111011.
001
00000.00000000

172.
123
.32
.0

10101100.01111011.
001
00000.00000001

172.
123
.32
.1

10101100.01111011.
001
00000.00000010

172.
123
.32
.2

to

10101100.01111011.
001
11111.11111110

172.
123
.63
.254

10101100.01111011.
001
11111
.11111111

172.
123
.
63
.255


Subnet and host bits are combined to create the dotted decimal

Network address

Broadcast address

24

Address Patterns


In this example each subnet address is 32 more
than the previous subnet address.


The host addresses on subnet 1 range from the
subnet address (
172.
123
.32
.0)

to one less than the
next network address (
172.123
.63.
255
).


The last subnet address is the same as the mask

#

Subnets

#

0

10101100.01111011

000
00000
.
00000000

172.123
.0.
0

4

10101100.01111011

100
00000
.
00000000

172.123
.128.
0

1

001
00000
.
00000000

172.123
.32.
0

5

101
00000
.
00000000

172.123
.160.
0

2

010
00000
.
00000000

172.123
.64.
0

6

110
00000
.
00000000

172.123
.192.
0

3

011
00000
.
00000000

172.123
.96.
0

7

111
00000
.
00000000

172.123
.224.
0

25

Subnet Table

#

Subnet

Mask

1
st

Host

Last Host

Broadcast

0

172.123
.0.
0

225.255.224.0

172.123
.0.
1

172.
123
.31
.254

172.
123
.31
.255

1

172.123
.32.
0

225.255.224.0

172.123
.32.
1

172.
123
.63
.254

172.
123
.63
.255

2

172.123
.64.
0

225.255.224.0

172.123
.64.
1

172.
123
.95
.254

172.
123
.95
.255

3

172.123
.96.
0

225.255.224.0

172.123
.96.
1

172.
123
.127
.254

172.
123
.127
.255

4

172.123
.128.
0

225.255.224.0

172.123
.128.
1

172.
123
.159
.254

172.
123
.159
.255

5

172.123
.160.
0

225.255.224.0

172.123
.160.
1

172.
123
.191
.254

172.
123
.191
.255

6

172.123
.192.
0

225.255.224.0

172.123
.192.
1

172.
123
.223
.254

172.
123
.223
.255

7

172.123
.224.
0

225.255.224.0

172.123
.224.
1

172.
123
.255
.254

172.
123
.255
.255

Shortcut! Notice that every item (except the mask) is 32 more than the previous
value in the octet containing both subnet and host bits. Only true for 3 bit subnets!

26

“Magic Number” shortcuts


The number
32

in the previous example is
sometimes called the “magic number.”


It is a result of using dotted decimal notation.


It only applies in the octet that contains both
subnet & host bits.


There are two ways to determine this number


It is the value of the right most network bit position


It also equals 256


subnet mask

27

Last Example! Class A


Subnet 121.0.0.0 /8 to create 1000 subnets.


Step 1. Determine # of bits to borrow


The formula 2
N

≥ 1000


Look at your Powers of 2 table to find a value ≥ 1000


You will need to borrow 10 bits.

28

Class A Problem Step 2


Step 2: Determine your mask.


Start with the Class A default mask:

11111111
.
00000000.00000000.00000000


Change the 10 leftmost host bits into subnet
bits

11111111
.
11111111.11
000000.0000000
0


Write the mask:

255.
255
.
192
.0 or /18

29

Determine Magic Number


Network: 121.0.0.0 Mask:255.
255
.
192
.0


Subnet 0:
01111001
.
00000000.00
000000.00000000


Subnet 1:
01111001
.
00000000.01
000000.00000000


Subnet 1:
121
.
0.
64
.0



or 256


192 =
64



Magic Number!

Only use in the octet with both subnet and host bits.

30

Subnet Table, first subnets

#

Subnet

Mask

1
st

Host

Last Host

Broadcast

0

121.
0
.0.
0

225.255.192.0

121.
0
.0.
1

121.
0
.63
.254

121.
0
.63
.255

1

121.
0
.64.
0

225.255.192.0

121.
0
.64.
1

121.
0
.127
.254

121.
0
.127
.255

2

121.
0
.128.
0

225.255.192.0

121.
0
.128.
1

121.
0
.191
.254

121.
0
.191
.255

3

121.
0
.192.
0

225.255.192.0

121.
0
.192.
1

121.
0
.255
.254

121.
0
.255
.255

4

121.
1
.0.
0

225.255.192.0

121.
1
.0.
1

121.
1
.63
.254

121.
1
.63
.255

5

121.
1
.64.
0

225.255.192.0

121.
1
.64.
1

121.
1
.127
.254

121.
1
.127
.255

6

121.
1
.128.
0

225.255.192.0

121.
1
.128.
1

121.
1
.191
.254

121.
1
.191
.255

7

121.
1
.192.
0

225.255.192.0

121.
1
.192.
1

121.
1
.255
.254

121.
1
.255
.255

8

121.
2
.0.
0

225.255.192.0

121.
2
.0.
1

121.
2
.63
.254

121.
2
.63
.255

+64

+64

31

Subnet Table, last subnets

#

Subnet

Mask

1
st

Host

Last Host

Broadcast

1017

121.
254
.0.
0

225.255.192.0

121.
254
.0.
1

121.
254
.63
.254

121.
254
.63
.255

1017

121.
254
.64.
0

225.255.192.0

121.
254
.64.
1

121.
254
.127
.254

121.
254
.127
.255

1018

121.
254
.128.
0

225.255.192.0

121.
254
.128.
1

121.
254
.191
.254

121.
254
.191
.255

1019

121.
254
.192.
0

225.255.192.0

121.
254
.192.
1

121.
254
.255
.254

121.
254
.255
.255

1020

121.
255
.0.
0

225.255.192.0

121.
255
.0.
1

121.
255
.63
.254

121.
255
.63
.255

1021

121.
255
.64.
0

225.255.192.0

121.
255
.64.
1

121.
255
.127
.254

121.
255
.127
.255

1022

121.
255
.128.
0

225.255.192.0

121.
255
.128.
1

121.
255
.191
.254

121.
255
.191
.255

1023

121.
255
.192.
0

225.255.192.0

121.
255
.192.
1

121.
255
.255
.254

121.
255
.255
.255

-

64

Last subnet has the same value in the mixed octet as does the mask

32

Subnetting across octet
boundaries


A closer look at the transition from subnet 3
to subnet 4


Subnet 3:
01111001
.
0000000
0.11
000000.00000000


Subnet 4:
01111001
.
0000000
1.00
000000.00000000


A closer look at the transition from subnet
1019 to subnet 1020


Subnet 1019:
01111001
.
1111111
0.11
000000.00000000


Subnet 1020:
01111001
.
1111111
1.00
000000.00000000


33

Summary


# of Possible Subnets = 2
Number of subnet bits


# of Possible Hosts = 2
Number of host bits


# of Usable Hosts = (2
Number of host bits
)


2


# of RIP v1 Usable Subnets = (2
Number of subnet bits
)


2


Magic Number


used in octet with both
subnet and host bits.


Right most subnet bit value


256


subnet mask


Last possible subnet = mask of mixed octet


34

HAPPY SUBNETTING!