You are on page 1of 58

# 12/09/2011

## Gentle Introduction to Binary

Numbers

12/09/2011

Agenda
Decimal numbers
Binary numbers
Counting in Binary

System

Decimal

Base-10

12/09/2011

System

Binary

Base-2

COMPUTERS

12/09/2011

1,000 = 103

100 = 102

10 = 101

1 = 100
0
1
2
3
4
5
6
7
8

Now
What?

## We set the 1s (units) column to 0 and

add 1 to the 10s column
1,000 = 103

100 = 102

10 = 101

1 = 100
0
1
2
3
4
5
6
7
8
9

12/09/2011

## We continue counting up, adding one

to the 10s when we reach 9 the units
1,000 = 103

100 = 102

10 = 101

1 = 100
0
:
:

## When we reach 99 We set the 1s and

10s columns to 0 and add 1 to the
100s
column
1,000 = 10
100 = 10
10 = 10
1 = 10
3

:
:
1

0
:
:

12/09/2011

How do I
Count in
Binary?

8 = 23

4 = 22

2 = 21

1 = 20
0

What Now!
I have no
more digits!

12/09/2011

## We set the 1s (units) column to 0 and

add 1 to the 2s (21) column
Decimal

8 = 23

4 = 22

2 = 21

1 = 20
0

(1 x 2) + (0 x 1) = 2

Decimal

8 = 23

4 = 22

2 = 21

1 = 20
0

## Add 1 more we get:

(2 x 1) + (1 x 1) = 3

12/09/2011

## Set the 20 and 21 column to 0 and add

1 to the 4s (22) column
8 = 23

Decimal

4 = 22

2 = 21

1 = 20

2
3
4

## Add 1 more again we get:

(4 x 1) + (2 x 0) + (1 x 0) = 4

in Decimal
Decimal

8 = 23

4 = 22

2 = 21

1 = 20

7
8

See the
pattern
Now?

12/09/2011

## Counting from 0 to 15 in Binary

D

8 = 23 4 = 22 2 = 21 1 = 20

8 = 23 4 = 22 2 = 21 1 = 20

10

2
3

11

12

13

14

15

Practice
Using the template at
the side, count up to
the first 16 binary
number. I have even
given you a start

8 = 23

4 = 22

2 = 21

1 = 20

12/09/2011

Practice
Using the
template at the
side, count up to
the first 32
binary numbers.

16 = 24

8 = 23

4 = 22

2 = 21

1 = 20

## Converting between numbering

systems

10

12/09/2011

Objective
At the end of this lesson you will be able to
covert between binary, decimal, and

## Review Number Systems

Decimal Number System 10 Symbols:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary Number System 2 Symbols:
0, 1
Octal Number System 8 Symbols:
0, 1, 2, 3, 4, 5, 6, 7
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
22

11

12/09/2011

## Exponent is the number of time the

number will be multiplied by itself
20 = 1
21 =

Exponent

22 = 2 x 2 = 4

## Notice how the

result keeps
doubling

23 = 2 x 2 x 2 = 8

24 = 2 x 2 x 2 x 2 = 16
25 = 2 x 2 x 2 x 2 x 2 =32

Decimal Value

Decimal Value

20

28

256

21

29

512

22

210

1,024

23

211

2,048

24

16

212

4,096

25

32

213

8,192

26

64

214

16,384

27

128

215

32,768

12

12/09/2011

Decimal
128
1
1
0
0

64
1
0
0
1

32
0
1
0
1

16
0
0
1
1

8
0
1
0
1

4
0
0
1
1

2
0
0
0
1

1
0
0
0
1

1
0
0

0
0
0

1
0
0

0
1
1

1
0
1

1
0
1

0
0
1

0
0
1

Decimal Value

128
1
1
0
0

64
1
0
0
1

32
0
1
0
1

16
0
0
1
1

8
0
1
0
1

4
0
0
1
1

2
0
0
0
1

1
0
0
0
1

Decimal Value

1
0
0

0
0
0

1
0
0

0
1
1

1
0
1

1
0
1

0
0
1

0
0
1

172
16
31

192
168
20
127

13

12/09/2011

## DECIMAL TO BINARY CONVERSION

Decimal-to-Binary Conversion
By successive division by 2 ( R is the remainder )

178
89
44
22
11
5
2
1

/
/
/
/
/
/
/
/

2
2
2
2
2
2
2
2

=
=
=
=
=
=
=
=

89
44
22
11
5
2
1
0

R
R
R
R
R
R
R
R

10110010

0
1
0
0
1
1
0
1

Right

Left

## Write the binary

number in the
order last bit
first:

30

14

12/09/2011

CONVERSION

Used?
Configuration Register

15

12/09/2011

## Binary and Hexadecimal Number Systems

Hexadecimal is perfect for matching 4 bits.
4 bits can be represented by 1 Hex value
8 bits can be represented by 2 Hex values, etc.
Dec.
0
1
2
3
4
5
6
7

Hex.
0
1
2
3
4
5
6
7

Binary
0000
0001
0010
0011
0100
0101
0110
0111

Dec.
8
9
10
11
12
13
14
15

Hex.
8
9
A
B
C
D
E
F

Binary
1000
1001
1010
1011
1100
1101
1110
1111

33

Dec. Hex. Binary
Dec.
Hex.
Binary
0
0
0000
8
8
1000
1
1
0001
8
9
1001
2
2
0010
10
A
1010
3
3
0011
11
B
1011
4
4
0100
12
C
1100
5
5
0101
13
D
1101
6
6
0110
14
E
1110
7
7
0111
15
F
1111
----------------------------------------------------Here are 48 bits e.g. a MAC Address:
000000000010000011100000011010110001011101100010
Break them up into 4 bit chunks:
0000 0000 0010 0000 1110 0000 0110 1011 0001 0111 0110 0010
Convert each 4 bits to Hexadecimal:
0
0
2
0
E
0
6

16

12/09/2011

CONVERSION

Binary
4

Dec.

Hex

10

11

12

13

14

15

digit
Convert into 4 binary
digits
0xa7e3 or a7e316
A 7
e 3
1010 0111 1110 0011
1010011111100011

17

12/09/2011

learned
1.
2.
3.
4.

## Convert 184 to Binary

Convert 10110110 to Decimal

Five Minutes

Question 1
Convert 184 to Binary
184 /2 = 92 R 0
92 / 2 = 46 R 0
46 / 2 = 23 R 0
23 / 2 = 11 R 1
11 / 2 = 5 R 1
5 /2 = 2 R1
2 /2 = 1 R0

18

12/09/2011

Question 2
Convert 10110110 to Decimal
128

64

32

16

128

32

16

Question 3
1. 1011 0110 1111 0011
2. 11 6
15 3
3. b
6
f
3

19

12/09/2011

Question 4
Convert 0x6b1e to Binary
Convert each Hexadecimal digit to its binary
equivalent (4 bits)
0110 1011 0001 1110

20

12/09/2011

## At the end of this lesson we will be able to

1.3 Identify the following address formats

IPv4
MAC

IPv6
Formats

21

12/09/2011

Physical

Hardware

## MAC Addresses identify the Network

Interfaces
48 Bits

00000000-00011111-00101001-00000011-01000011-11101110
00-1F-29-03-43-EE
12 Hex
Digits

22

12/09/2011

## View MAC Address with ipconfig

/all

32 Bits
Written as four groups of decimal digits, separated by .
(dots)
Assigned to Hosts

23

12/09/2011

An IP address is a 32-bit binary number:
10101100000100001000000000010001
The 32-bit binary number is divided into four octets:
10101100 00010000 10000000 00010001
Each octet (or byte) can be represented in decimal:
172 16 128 17
Imaginary dot is placed between decimals and called
dotted-decimal notation:
172.16.128.17

128 Bits
Eight groups of four hexadecimal digits
Each group is separated by a colon (:)
Assigned to Hosts

24

12/09/2011

2001:0db8:0000:0000:0000:0000:1428:57ab

## Rules for abbreviating the IPv6 address

A group with all zero may be replace by a
single zero
Any number of consecutive groups of 0s may
be replaced with two colons (::), but only once

25

12/09/2011

## To shorten writing the address

2001:0db8:0000:0000:0000:0000:1428:57ab
2001:0db8:0000:0000:0000::1428:57ab
2001:0db8:0:0:0:0:1428:57ab
2001:0db8:0:0::1428:57ab
2001:0db8::1428:57ab
2001:db8::1428:57ab

26

12/09/2011

Objectives
Given a scenario, evaluate the proper use of

Subnetting

27

12/09/2011

## WHAT ARE THE TYPES OF

Unicast
Multicast

28

12/09/2011

Are Assigned to a Single Interface

## Used to Direct Traffic to a Single Device

NEVER Assigned to an Interface
Used to send Traffic to ALL Devices
All Ones:
11111111.1111111.11111111.11111111

29

12/09/2011

NEVER Assigned to an Interface
Used to send Traffic to SOME Devices
Special Multicast Range:
224.0.0.0 239.255.255.255

30

12/09/2011

## IP Addresses are divided into five

Classes
First Octet Binary

Classes

Start

End

Start

End

Class A

00000001

01111110

126

Class B

10000000

10111111

128

191

Class C

11000000

11011111

192

223

Class D

11100000

11101111

224

239

Class E

11110000

11111111

240

255

## *127 (011111111) is a Class A address reserved for loopback testing and

cannot be assigned to a network.
63

## First few bits of IP Address determines

the Class
First Octet Binary

Classes

Start

End

Start

End

Class A

00000001

01111110

126

Class B

10000000

10111111

128

191

Class C

11000000

11011111

192

223

Class D

11100000

11101111

224

239

Class E

11110000

11111111

240

255

## *127 (011111111) is a Class A address reserved for loopback testing and

cannot be assigned to a network.
64

31

12/09/2011

## IP Addresses have two parts

First Part identifies the Network the Host
belongs
Second Part identifies the Host in that
Network
Which bits identifies the Network
Which bits identifies the Host portion

Host components
1 Byte
8 Bits

1 Byte
8 Bits

1 Byte
8 Bits

1 Byte
8 Bits

Class A

Class B

Class C

## N = Network number assigned by ARIN

H = Host number assigned by administrator

32

12/09/2011

## The parts of the IP address are

identified by the bits of the subnet
1 Octet

2 Octet

3 Octet

4 Octet

Class A

10

16

200

10

255

Class B

165

28

12

16

255

255

Class C

196

212

16

200

255

255

255

Prefix
/8

/16

/24

an organization
Class

10.0.0.0

to

10.255.255.255

172.16.0.0

to

172.31.255.255

192.168.0.0

to

192.168.255.255

33

12/09/2011

Function

## Means all networks.

Network 127.0.0.1

## Means network address or any

host on specified network.

network

## Used to designate the default route.

Also mean any network.

## Broadcast to all nodes on this

network; also called an all 1s
69

## HOW THE SUBNET MASK IDENTIFIES

THE NETWORK PART OF THE IP

34

12/09/2011

## What does the Subnet Mask do?

Pattern of 1s and 0s
Maps Network and Host parts of the IPv4 Address
1s indicate the Network part
0s indicate the Host part
1s start from left and continues unbroken, until the
host part starts
NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
11111111.11111111.11111111.00000000
255
.
255 .
255 .
0

Octet (Byte)

Classes

First
Octet

Class A

1 126

255

255

255

255

255

255

Class B

128 191

Class C

192 223

35

12/09/2011

## Logical AND Output will be true

(one) only when ALL inputs are true
(one)
A

0
0
1
1

0
1
0
1

OUTPUT
A AND B
0
0
0
1

172

38

74

.10

10101100.00100110.01001010.00001010

11111111.11111111.00000000.00000000

ANDED:

10101100.00100110.00000000.00000000

Try ANDing IP
yourself

172

38

A AND B

. 0

36

12/09/2011

Statically
Manual
Configuration

Dynamically
Automatic
DHCP
APIPA

37

12/09/2011

(APIPA)

Use range:

169.254.0.0
to
169.254.255.255

Used for
DHCP-less
Automatic
Assignment

38

12/09/2011

click Properties

39

12/09/2011

window

40

12/09/2011

## Select option Use the following IP

41

12/09/2011

Default Gateway, and DNS server

## To view TCP/IP setting enter

ipconfig /all in command prompt

42

12/09/2011

APIPA

43

12/09/2011

## No DHCP Server APIPA configuration

WHAT IS SUBNETTING?

44

12/09/2011

## Subnetting is the process of

Taking one larger
network
and

## Breaking it into a number

of smaller networks

Cake or Pie

45

12/09/2011

## Increasing subnet-mask by 2 bits gives

four sub-networks
192.168.40.192/26
( 192 255 )

192.168.40.0/26
( 0 63 )

192.168.40.128/26
( 128 191 )

192.168.40.64/26
( 64 127

192.168.40.0/24

( 0 255 )

0 63
64 127
128 191
192 255

from a network
192.168.40.0/24
192.168.40.0/26

## 192.168.40.64/26 192.168.40.128/26 192.168.40.192/26

46

12/09/2011

Why do we Subnet?
Improve Security
Organize Network by:
Department

Location

Applications
used

Job Function

## There are two types of Subnetting

Classful
Original
IP
Classes

All equal
sized
subnets

Classless
No IP
Classes

Subnets
can be of
different
sizes

47

12/09/2011

Summary
Unicast
Multicast

Assigning IP Addresses DHCP, static, APIPA
Subnetting

IP version 6 (IPv6)

48

12/09/2011

We will cover:

Why go to IPv6
IPv6 features

49

12/09/2011

## Why do we need Internet Protocol

Version 6 (IPV6)?

## IPv6 was developed because we are

running out of available IPv4 addresses
100%
% IPv4

90%
80%
70%
60%

February 3, 2011
Available Pool of Unallocated IPv4 Internet
ICANN News Release

50%
40%
30%
20%
10%
0%
1980

1985

1990

1995

2000

2005

2010

50

12/09/2011

IP v4 = 32 Bits

## IPv6 = 128 bits

IPv4 => 32 bits or 4 bytes long
IPv6 => 128 bits or 16 bytes: four times the bits of IPv4
= 2128

How big is that number?

there?

## 3.4 * 1038 possible addressable nodes

340,282,366,920,938,463,374,607,432,768,2
11,456

340 UNDECILLION

## Or 5 * 1028 addresses per person

51

12/09/2011

IPv6 Features

Multicast
Mandatory network layer security
Mobility
Options Extensibility
Jumbograms

48 Bits

16 Bits

64 Bits

## Host part (Interface ID) of the address is usually

derived from the interface MAC address
Default prefix is /64

52

12/09/2011

2001:0db8:3c4d:12:0000:00000:1234:56ab
Can drop leading zeros in any block, so above becomes:

2001:db8:3c4d:12:0:0:1234:56ab
Can replace blocks of zeros with double colons (::),

## but, only once per address

2001:db8:0000:0000:ac23:0000:0000:56ab
So, the above becomes:

2001:db8::ac23:0:0:56ab

2001:0db8:0000:0000:0000:0000:1428:57ab
2001:0db8:0000:0000:0000::1428:57ab

2001:0db8::0000:0000:0000:1428:57ab
2001:0db8:0:0:0:0:1428:57ab
2001:0db8:0:0::1428:57ab
2001:0db8::0:1428:57ab
2001:0db8::1428:57ab
2001:db8::1428:57ab

53

12/09/2011

Multicast
Anycast

Unicast
IPv6
Types

54

12/09/2011

2000::/3

Global Unicast

[RFC4291]

FC00::/7

## Unique Local Unicast

[RFC4193]

FE80::/10

[RFC4291]

FF00::/8

Multicast

[RFC4291]

::1/128

::/128

Unicast
Assigned to a single interface
There are several IPv6 Unicast address types
Global
Unique Local

55

12/09/2011

Global

Global Scope

Unique Local

Routable only
within a site

Only valid on a

## A single interface may have several

Local
Global
Unicast

Unique
Local

Interface

Global
Anycast

56

12/09/2011

Multicast
One-to-many
Enables more efficient
use of the network
IPv6 uses a larger

Anycast
One-to-nearest
Multiple devices share the same
Routers decide on closest device.

## Suitable for load balancing and

content delivery services.

57

12/09/2011

Review

Features of IPv6