# Ch 10 Subnetting - Chabot College

Networking and Communications

Oct 24, 2013 (4 years and 10 months ago)

189 views

Chabot College

ELEC 99.05

Though the exact length and format of a
depending on the protocol, all logical

NETWORK
NUMBER

HOST NUMBER

the subnet field, that is used to identify
smaller networks within a larger network.

NETWORK
NUMBER

SUBNET
NUMBER

HOST
NUMBER

Class A (0
-

127)

Class B (128
-
191)

Class C (192
-
223)

Network

Host

Host

Host

Network

Network

Host

Host

Network

Network

Network

Host

1st octet

2nd octet

3rd octet

4th octet

Class A

Class B

Class C

85

45

31

158

168

65

114

201

210

144

235

56

Network

Host

The solution to the IP address shortage
was thought to be the subnet mask.

Formalized in
1985
breaks a single class A, B or C network
in to smaller pieces.

Subnetting

What’s happened to the host fields?

Network

Network

Subnet

Host

8 bits

8 bits

8 bits are now used to represent subnets. Only 8 bits
remain for possible hosts.

Subnetting

What’s happened to the host fields?

Network

Network

Subnet

Host

8 bits

8 bits

8
-
bit subnet field = 2
8

subnets =
256 subnets
.

8
-
bit host field = 2
8

hosts =
256 hosts
.

Remember, we started with 65,536 hosts!

The Subnet Mask is a 32
-
bit number.

Its job is to tell routers (and humans)
which bits are network number and
which bits are used to represent hosts.

The Subnet Mask corresponds to the IP

A “1” bit in the subnet mask means that
the corresponding bit in the IP address
should be read as a network number

A “0” bit in the subnet mask means that
the corresponding bit in the IP address
should be read as a host bit.

11111111

11111111

00000000

00000000

10101001

11000111

01000101

10001001

Here, the first 16 bits of the mask are set to “1.”
Thus, the first 16 bits (2 octets) of the IP

11111111

11111111

00000000

00000000

10101001

11000111

01000101

10001001

Network

Network

Host

Host

The mask shows that the first two octets refer
to the network number.

11111111

11111111

00000000

00000000

10101001

11000111

01000101

10001001

Network

Network

Host

Host

The mask shows that the first two octets refer
to the network number.

255

255

0

0

11111111

11111111

11111111

00000000

10101001

11000111

01000101

10001001

Network

Network

Network

Host

Here, the first 24 bits are set to “1” in the
subnet mask. Thus, the first 24 bits (3 octets)
of the IP address are network number.

11111111

11111111

11111111

00000000

10101001

11000111

01000101

10001001

Network

Network

Network

Host

Here, the first 24 bits are set to “1” in the
subnet mask. Thus, the first 24 bits (3 octets)
of the IP address are network number.

255

255

255

0

11111111

11111111

11111111

11100000

10101001

11000111

01000101

10001001

Network

Network

Network

Host

Here, the first 27 bits of the subnet mask are
set to “1.” Thus, the first 27 bits of the IP

11111111

11111111

11111111

11100000

10101001

11000111

01000101

10001001

Network

Network

Network

Host

Here, the first 27 bits of the subnet mask are
set to “1.” Thus, the first 27 bits of the IP

255

255

255

224

Class A or /8

Class B or /16

Class C or /24

255

0

0

0

255

255

0

0

255

255

255

0

to “1,” then subnets have been created.

255

255

255

0

207

21

54

0

Network

Network

Network

Host

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

00000000

255

255

255

0

Class C : 1
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

10000000

255

255

255

128

Masks can be written different ways. When the
phrase “1
-
bit” mask is used, that means 1 more bit
than the default. This example can also be called a
25
-
bit mask, or /25 (there are 25 network bits).

Class C: 2
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11000000

255

255

255

192

Class C: 3
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11100000

255

255

255

224

Class C: 4
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11110000

255

255

255

240

Class C: 5
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11111000

255

255

255

248

Class C: 6
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11111100

255

255

255

252

Class C: 7
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11111110

255

255

255

254

Class C: 8
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

11111111

11111111

11111111

11111111

255

255

255

255

Class C : 1
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

10000000

255

255

255

128

Because this is a class C, all nodes on this
network will share the first three octets. Those
numbers are not an issue.

Last Octet 1
-

00000000

0

Host

10000000

128

How many subnet possibilities with 1 bit?

2
1

= 2 different possibilities

Last Octet 1
-

00000000

0 =

128 =

255 =

The last octet can be any value from 0
-

255.

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

Last Octet 1
-

00000000

0 =

128 =

255 =

How many hosts can be on each subnet?

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

2
7

= 128 different possibilities MINUS TWO.

7 bits

Why “Minus Two”?

Two special host addresses are “reserved”:

the address of the subnet itself

(all zeros)

(all ones)

00000000

0 =

128 =

255 =

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

00000000

0 =

All zeros in the HOST portion of the address is
reserved for network (or subnet) number.

All ones is reserved for the network (or subnet)

00000001

1 =

Decimal

Binary

00100100

36 =

01111111

127 =

10000000

128 =

11111111

255 =

Last Octet

00000000

0 =

128 =

255 =

So, which subnet is this host on?

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

207.21.54.35

255.255.255.128

Subnet #0

Last Octet

00000000

0 =

128 =

255 =

Are these two hosts on the same subnet?

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

207.21.54.115

255.255.255.128

No.

207.21.54.129

255.255.255.128

Last Octet

00000000

0 =

128 =

255 =

Unfortunately, older TCP/IP software cannot
handle subnets with
all zeros

in the subnet
field.

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

Last Octet

00000000

0 =

128 =

255 =

More bad news, older TCP/IP software cannot
handle subnets with
all ones

in the subnet
field.

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

Last Octet

00000000

0 =

128 =

255 =

For now, using subnets that have all zeros or
all ones in the subnet field should be
considered illegal. (It’s not really, but….)

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

Last Octet

00000000

0 =

128 =

255 =

Bottom line, a 1
-
bit mask results in no usable

01111111

127 =

10000000

11111111

Subnet #0

Subnet #1

Decimal

Binary

Class C : 2
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11000000

255

255

255

192

Because this is a class C, all nodes on this
network will share the first three octets. Those
numbers are not an issue.

Class C : 2
-

00000000

0

Host

11000000

192

How many subnet possibilities with 2 bits?

2
2

= 4 different possibilities:

00 01 10 11

Last Octet

00000000

0 =

64 =

127 =

00111111

63 =

01000000

01111111

Subnet #0

Subnet #1

Decimal

Binary

128 =

191 =

10000000

10111111

192 =

255 =

11000000

11111111

Subnet #2

Subnet #3

Last Octet

00000000

0 =

64 =

128 =

How many hosts can be on each subnet?

00111111

63 =

01000000

01111111

Subnet #0

Subnet #1

Decimal

Binary

2
6

= 64 different possibilities MINUS TWO.

6 bits

Which subnets can be used?

00000000

0 =

64 =

127 =

00111111

63 =

01000000

01111111

Subnet #0

Subnet #1

Decimal

Binary

128 =

191 =

10000000

10111111

192 =

255 =

11000000

11111111

Subnet #2

Subnet #3

Putting it together

legal for hosts?

1) 207.21.54.35

2) 207.21.54.63

3) 207.21.54.65

4) 207.21.54.190

5) 207.21.54.195

Class C : 3
-

11001111

00010101

00110110

00000000

207

21

54

0

Network

Network

Network

Host

11111111

11111111

11111111

11100000

255

255

255

224

Because this is a class C, all nodes on this
network will share the first three octets. Those
numbers are not an issue.

Class C : 3
-

00000000

0

Host

11100000

224

How many subnet possibilities with 3 bits?

2
3

= 8 different possibilities:

000 001 010 011 100 101 110 111

Last Octet

00000000

0 =

32 =

63 =

00011111

31 =

00100000

00111111

Decimal

Binary

64 =

95 =

01000000

01011111

96 =

127 =

01100000

01111111

10000000

128 =

160 =

191 =

10011111

159 =

10100000

10111111

Decimal

Binary

192 =

223 =

11000000

11011111

224 =

255 =

11100000

11111111

Last Octet

00000000

0 =

32 =

64 =

How many hosts can be on each subnet?

00011111

31 =

00100000

00111111

Subnet #0

Subnet #1

Decimal

Binary

2
5

= 32 different possibilities MINUS TWO.

5 bits

Which subnets can be used?

00000000

0 =

32 =

63 =

00011111

31 =

00100000

00111111

Decimal

Binary

64 =

95 =

01000000

01011111

96 =

127 =

01100000

01111111

10000000

128 =

160 =

191 =

10011111

159 =

10100000

10111111

Decimal

Binary

192 =

223 =

11000000

11011111

224 =

255 =

11100000

11111111