# Today we will discuss:

Networking and Communications

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

82 views

Today we will discuss:

Subnetting

This is probably the most important topic

for the exam. Try to memorize the tables

and numbers where indicated since they will

help immensely on the exam.

If a device wants to communicate using
TCP/IP, it needs an IP address.

Any device that can send and receive IP
packets is called an
IP host
.

IP addresses consist of a 32
-
bit number,
usually written in
dotted
-
decimal
notation
.

Each byte (8 bits) of the 32
-
is converted to its decimal equivalent
(hence, “decimal” of “dotted
-
decimal
notation”).

Each of the decimal numbers in an IP
octet
.

The term
octet
is just a vendor
-
neutral

term
byte
.

For example: 168.1.4.25

The first octet is 168.

The second octet is 1.

The third octet is 4.

The fourth octet is 25.

The RANGE of decimal numbers in each
octet is between 0 and 255, inclusive. (256
numbers total)

Other IP Terminology

Bit

a bit is one digit; either a 1 or a 0.

Byte

a byte is 8 bits.

also called the
network
number
, uniquely identifies each network. Every
machine on the same network shares that

also referred to as a
node

is assigned to and uniquely identifies
each machine on a network.

-

sent to all nodes on the network

Binary to Decimal

Conversion

Binary

The ability to convert from binary to
decimal and back again is very handy

The digits used are limited to either a 1
(one) or a 0 (zero).

Only convert up to 8 bits at a time (an
octet).

Binary (cont.)

The trick to binary is to learn the decimal
values of each bit for the first 8 bits.

Start from the left or right and add.

Just add the decimal values where there is
a 1 (one) present, and you will have the
decimal value of the octet.

The next slide shows the decimal value of
each bit value.

Binary to Decimal for 204

Binary = 1100 1100 Decimal = 204

128

64 32 16 8 4 2 1

1 1 0 0 1 1 0 0

-----------------------------------------------------------

128

+ 64 + 0 + 0 + 8 + 4 + 0 + 0

= 204

Memorize

Binary 1111 1111 = Decimal 255

Binary 0000 0000 = Decimal 0

Know the values 128
-
64
-
32
-
16
-
8
-
4
-
2
-
1.

The easiest way to remember it is to start
at 1 and multiply by 2.

1

* 2 =
2

* 2 =
4

* 2 =
8

* 2 =
16

* 2 =
32

*
2 =
64

* 2 =
128
.

Decimal to Binary

Convert 212 to binary.

Do the math.

Another Binary to Decimal
**
Memorization**

Chart

(see why this is important in a few slides)

Binary Value

Decimal Value

10000000

128

11000000

192

11100000

224

11110000

240

11111000

248

11111100

252

11111110

254

11111111

255

An IP address consists of 32 bits of
information.

The address is broken into four 8
-
bit
(1 byte) groups, converting each octet to
decimal values, and separating these
values by dots (dotted decimal notation).

Example: 172.16.30.56

Two other ways to represent dotted
-

decimal 172.16.30.56 are:

Binary

10101100.00010000.00011110.00111000

AC.10.1E.38

See end of presentation for hex conversion notes
and chart.

The Classes of Networks

8 bits

8 bits

8 bits

8 bits

Class A

Network

Host

Host

Host

Class B

Network

Network

Host

Host

Class C

Network

Network

Network

Host

Class D

Multicast

--

Not

On

Test

Class E

Research

--

Not

On

Test

Classes of Networks

All addresses in the same class A, B, or C
network have the same numeric value
NETWORK
rest of the address is called the
HOST

When written down, network numbers
have all decimal 0s in the host part of the
number.

Classes of Networks (cont.)

Network number example:

Class A:
byte
. 0. 0. 0

Class B:
byte. byte
. 0. 0

Class C:
byte. byte. byte
. 0

However, network numbers are not
cannot be assigned to an interface as an

List of All Possible Valid Network
Numbers (memorize)

Class A

Class B

Class C

First Octet Range

1 to 127*

128 to 191

192 to 223

Valid Network
Numbers

1.0.0.0
--
126.0.0.0

128.1.0.0

191.254.0.0

192.0.1.0

223.255.254.0

Number of
Networks

2
7

-

2

2
14

-

2

2
21

-

2

Number of
Hosts

2
24

-

2

2
16

-

2

2
8

-

2

Details of Classes A, B, & C

Before starting to design subnets, you should know what
it is that you've been given. Here are three ways of
finding out what class your allocation is in. Use
whichever you find easiest.

Class A

0xxx
binary, or
1 to 126

decimal. (127 is loopback)

Class B

10xx
binary, or
128 to
191

decimal.

Class C

110x
binary, or
192 to
223

decimal.

If the first bit is 0 it is a Class A address

If the first two bits are 10 it is a Class B address

If the first three bits are 110 it is a Class C address

Network 127.0.0.1

Means “network
network segment”

Reserved for
loopback tests. Allows
local node to send a
test packet to itself
without generating
network traffic.

These addresses can be used on a private
network, but are not routable on the Internet.

Translation (NAT) to access the Internet via a

Class A

10.0.0.0 thru 10.255.255.255

Class B

172.16.0.0 thru 172.31.255.255

Class C

192.168.0.0 thru 192.168.255.255

SUBNETTING

.

Memorize Powers of 2

2
1

= 2

2
2

= 4

2
3

= 8

2
4

= 16

2
5

= 32

2
6

= 64

2
7

= 128

2
8

= 256

A subnet mask is a 32
-
bit binary number
usually written in dotted
-
decimal format.

The 1s in the subnet mask represent the
network (or subnet) part of the IP address.

The 0s represent the host part.

Example:

Binary:
11111111.11111111.11111100.00000000

Dotted
-
decimal: 255.255.252.0 (same number)

Slash notation (/) at the end of an IP
address means how many bits are turned
on (1s).

Ex: 192.168.10.32 /28

Where /28 is subnet mask 255.255.255.240

Not all networks need subnets, meaning they

Class

Format

A

Network.Node.Node.Node

255.0.0.0

B

Network.Network.Node.Node

255.255.0.0

C

Network.Network.Network.Node

255.255.255.0

calculating:

1)
How many subnets does the chosen

2)
How many valid hosts per subnet are
available?

3)
What are the valid subnets?

4)
subnet?

5)
What are the valid hosts in each subnet?

Easier than it looks:

1)
How many subnets?

2
x

2 = number of subnets.

x is the number of masked bits, or the 1s.
For example, in 11000000, the number
of ones gives us
2
2

2

subnets. In this
example, there are 2 subnets.

Easy (cont.)

2) How many hosts per subnet?

2
y

2 = number of hosts per subnet.

y is the number of unmasked bits, or the
0s. For example, in 11000000, the number
of zeros gives us
2
6

2

hosts. In this
example, there are 62 hosts per subnet.

Easy

3) What are the valid subnets?

256

subnet mask = block size, or base
number. For example, for subnet mask
255.255.192.0, 256

192 = 64. 64 is the
first subnet. The next subnet would be
the base number plus itself, or 64 + 64 =
128, (the second subnet). You keep
adding the base number to itself until
you reach the value of the subnet mask,
which is not a valid subnet because all
subnet bits would be turned on (1s).

Easy

subnet?

turned on, which is the number immediately
preceding the next subnet (example in a
minute).

5) What are the valid hosts?

Valid hosts are the numbers between the
subnets, minus the network (subnet)

Calculating: Class C, Example 1

1) How many subnets? Since 192 is 2 bits
2
2

2 = 2

2) How many hosts per subnet? We have 6
host bits off (11000000), so the equation
would be
2
6

2 = 62

hosts.

Example 1 (cont.)

3) What are the valid subnets?

256
-
192 = 64, which is the first subnet and
also the block size. Keep adding the block
size to itself until you reach the subnet
mask. 64 + 64 = 128. 128 + 64 = 192,
which is invalid because it is the subnet
mask (all subnet bits turned on). Our two
valid subnets are, then, 64 and 128.

Example 1 (cont.)

subnet?

The number right before the value of the
next subnet is all host bits turned on and

5) What are the valid hosts?

These are the numbers between the

Example 1 Final Result

Network = 192.168.10.0

First
subnet

Last
subnet

Subnets (do first)

64

128

Hosts (do last)

65
-

126

129
-

190

second)

127

191

Class C Example 2

First

Next

Next

Next

Next

Last

Subnets

32

64

96

128

160

192

Hosts

33
--
62

65
--

94

97
--

126

129
--

158

161
--

190

193
--

222

63

95

127

159

191

223

First, answer question 3 of the big 5:

3) What are the valid subnets?

256

240 = 16. 16 + 16 = 32. 32 + 16 = 48. The
host address is between the 32 and 48 subnets.
The subnet is 192.168.10.32, the broadcast
address is 192.168.10.47, and the valid host
range is 192.168.10.33

192.168.10.46

1)
Subnets?
2
2

2 = 2. (192 =
11
000000)

2)
Hosts?
2
14

2 = 16,382.

(6 bits in the third
octet, and 8 in the fourth.)

3)
Valid subnets? 256

192 = 64.

64 + 64 = 128. (these are the 2 subnets as
stated in question 1.)

Class B Example (cont.)

See table.

5) Valid hosts? See table.

First

Next

(Last)

Subnets

172.16.
64.0

172.16.
128.0

Hosts

172.16.64.1

172.16.127.254

172.16.128.1

172.16.191.254

172.16.127.255

172.16.191.255

Class B, Example 2

1111
0000)

The table shows first three subnets, valid hosts, and

First

Next

Next

Etc

Subnets

16.0

32.0

48.0

Hosts

16.1

31.254

32.1

47.254

48.1

63.254

31.255

47.255

63.255

member of?

A: 256

224 = 32. 32 + 32 = 64.

33 is between 32 and 64. However,
remember that in Class B addresses the third
octet is considered part of the subnet, so the
answer would be the 10.32 subnet.

The broadcast is 10.63, since 10.64 is the
next subnet.

255.255.255.192 a member of?

A: 256

192 = 64. 64 + 64 = 128. The
must be 172.16.90.127, since 90.128 is
the next subnet.

Same procedure as with Class B and
Class C only you must take into account
the 8 additional bits from the second octet.

Class A Example

Network 10.0.0.0

Subnet mask 255.255.0.0 ( /16 = 16 bits on)

1)
Subnets?
2
8

-
2 = 254
.

2)
Hosts?
2
16

2 = 65,534
.

3)
Valid subnets? 256

255 = 1, 2, 3, etc.
(all in the second octet). The subnets
would be 10.0.0.0, 10.2.0.0, 10.3.0.0,
etc., up to 10.254.0.0.

Class A Example (cont.)

10.1.255.255, 10.2.255.255, etc., up to
10.254.255.255.

5) Valid hosts? See table.

First

Next

Last

Subnet

10.1.0.0

10.2.0.0

10.254.0.0

Hosts

10.1.0.1

10.1.255.254

10.2.0.1

10.2.255.254

10.254.0.1
--
10.254.255.254

-
cast

10.1.255.255

10.2.255.255

10.254.255.255

Appendix