Sei sulla pagina 1di 58

12/09/2011

IP Addressing

Gentle Introduction to Binary


Numbers

12/09/2011

Agenda
Decimal numbers
Binary numbers
Counting in Binary

Humans like to use the Decimal


System

Decimal

Base-10

12/09/2011

Computers like to use the Binary


System

Binary

Base-2

NUMBERING SYSTEMS USED IN


COMPUTERS

12/09/2011

First lets look at how we humans count


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?

Counting in Binary (Base-2)


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

Continue Counting in Binary


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

Counting in Binary is just like counting


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
hexadecimal numbering systems

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
Hexadecimal Number System 16 Symbols:
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 values of Powers of Two


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

Convert these Binary numbers to


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

Answers
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

BINARY TO HEXADECIMAL
CONVERSION

Where are Hexadecimal Numbers


Used?
MAC Address
IPv6 Address
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

Binary-to-Hexadecimal Conversion
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

HEXADECIMAL TO BINARY
CONVERSION

Converting Hexadecimal numbers to


Binary
4

Dec.

Hex

10

11

12

13

14

15

Take every hexadecimal


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

17

12/09/2011

Let us Practice some of what we have


learned
1.
2.
3.
4.

Convert 184 to Binary


Convert 10110110 to Decimal
Convert 1011011011110011 to Hexadecimal
Convert Hexadecimal 6b1e to Binary

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
Answer = 10111000

18

12/09/2011

Question 2
Convert 10110110 to Decimal
128

64

32

16

128

32

16

Answer = 182

Question 3
Convert 1011011011110011 to Hexadecimal
1. 1011 0110 1111 0011
2. 11 6
15 3
3. b
6
f
3
Answer = 0xb6f3

19

12/09/2011

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

Address Formats

20

12/09/2011

At the end of this lesson we will be able to


1.3 Identify the following address formats

Network+2009 Objective 1.3

What we will cover


IPv4
Addresses
MAC
Addresses

IPv6
Addresses
Address
Formats

21

12/09/2011

Media Access Control Address

Physical
Address

Burnt-InAddress

Hardware
Address

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

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

23

12/09/2011

IPv4 Address Format


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

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

24

12/09/2011

IPv6 Address Format


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

Rules for abbreviating the IPv6 address


Leading zeros may be omitted
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
per address

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

Understanding IPv4 Addressing

26

12/09/2011

Objectives
Given a scenario, evaluate the proper use of
the following addressing technologies and
addressing schemes

Network+ 2009 1.4

What we will cover

Addressing schemes
Private IP Addresses
Assigning IP Addresses
Subnetting
Classful and Classless Addressing

27

12/09/2011

WHAT ARE THE TYPES OF


ADDRESSING SCHEMES?

The Addressing Schemes are:

Unicast
Broadcast
Multicast

28

12/09/2011

Unicast Addresses
Are Assigned to a Single Interface

Used to Direct Traffic to a Single Device

Broadcast Addresses
NEVER Assigned to an Interface
ALWAYS Destination Address
Used to send Traffic to ALL Devices
All Ones:
11111111.1111111.11111111.11111111

29

12/09/2011

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

ADDRESSING TECHNOLOGIES

30

12/09/2011

IP Addresses are divided into five


Classes
First Octet Binary

First Octet Decimal

IP Address
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

First Octet Decimal

IP Address
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
The Subnet Mask determines:
Which bits identifies the Network
portion of the Address
Which bits identifies the Host portion

Each Class has different Network and


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
mask
1 Octet

2 Octet

3 Octet

4 Octet

Class A

10

16

200

10

SN Mask

255

Class B

165

28

12

16

SN Mask

255

255

Class C

196

212

16

200

SN Mask

255

255

255

Prefix
/8

/16

/24

Private IP Addresses are for use within


an organization
Class

Private Address Range

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

Reserved IP Addresses
Address
Network address of all 0s

Function

Means this network or segment.

Network address of all 1s

Means all networks.

Network 127.0.0.1

Reserved for loopback tests.

Node address of all 0s

Means network address or any


host on specified network.

Node address of all 1s

means all nodes on the specified


network

Entire IP address set to 0s ( 0.0.0.0 )

Used to designate the default route.


Also mean any network.

Entire IP address set to1s (255.255.255.255)

Broadcast to all nodes on this


network; also called an all 1s
broadcast
69

HOW THE SUBNET MASK IDENTIFIES


THE NETWORK PART OF THE IP
ADDRESS

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

Default IP Subnet Masks


Octet (Byte)

IP Address
Classes

First
Octet

Class A

1 126

255

255

255

255

255

255

Default Mask >


Class B

128 191

Default Mask >


Class C

192 223

Default Mask >

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

ANDing IP Address with Subnet Mask


gives Network Address
IP Address:

172

38

74

.10

IP Address in Binary:

10101100.00100110.01001010.00001010

Subnet Mask:

11111111.11111111.00000000.00000000

ANDED:

10101100.00100110.00000000.00000000

Network Address:

Try ANDing IP
Addr. and
Subnet Mask
yourself

172

38

A AND B

. 0

36

12/09/2011

HOW TO ASSIGN IP ADDRESSES?

Assigning IP Addresses
Statically
Manual
Configuration

Dynamically
Automatic
DHCP
APIPA

37

12/09/2011

Automatic Private IP Addressing


(APIPA)

Use range:

169.254.0.0
to
169.254.255.255

Used for
DHCP-less
Automatic
Address
Assignment

STEPS TO ASSIGN AN IP ADDRESS

38

12/09/2011

Start right-click My Network Places


click Properties

Select Local Area Connection interface

39

12/09/2011

Local Area Connection Properties


window

Select Internet Protocol (TCP/IP)

40

12/09/2011

ASSIGNING ADDRESSES STATICALLY

Select option Use the following IP


address

41

12/09/2011

Enter the IP address, Subnet Mask,


Default Gateway, and DNS server
addresses

To view TCP/IP setting enter


ipconfig /all in command prompt

42

12/09/2011

Dynamic Addressing with DHCP or


APIPA

DHCP Server Config

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

Subnetting is like slicing up a Pizza,


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

One block of 256 addresses


( 0 255 )

Four blocks of 64 addresses


0 63
64 127
128 191
192 255

Subnetting creates smaller networks


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?
Control Broadcasts
Improve Security
Organize Network by:
Department

Location

Applications
used

Job Function

There are two types of Subnetting

Classful
Original
IP
Address
Classes

All equal
sized
subnets

Classless
No IP
Address
Classes

Subnets
can be of
different
sizes

47

12/09/2011

Summary
Addressing schemes
Unicast
Multicast
Broadcast

Addressing Technologies
Private IP Addresses
Assigning IP Addresses DHCP, static, APIPA
Subnetting
Classful and Classless Addressing

IP version 6 (IPv6)

48

12/09/2011

Identify the IPv6 address formats

Network= 2009 - 1.3 Identify the following address formats

We will cover:

Why go to IPv6
IPv6 features
Abbreviating IPv6 addresses
IPv6 address ranges

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
Addresses

90%
80%
70%
60%

February 3, 2011
Available Pool of Unallocated IPv4 Internet
Addresses Now Completely Emptied
ICANN News Release

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

1985

1990

1995

2000

2005

2010

50

12/09/2011

IPv6 gives Larger Address Space


IP v4 = 32 Bits

IPv6 = 128 bits


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

possible addressable nodes


How big is that number?

How many unique IPv6 addresses are


there?

3.4 * 1038 possible addressable nodes

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

340 UNDECILLION

A billion-trillion times IPv4 capacity

Or 5 * 1028 addresses per person

51

12/09/2011

IPv6 Features

Larger address space


Stateless address autoconfiguration
Multicast
Mandatory network layer security
Simplified header
Mobility
Options Extensibility
Jumbograms

IPv6 Address Format

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

Abbreviating IPV6 Addresses


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

Equivalent Addresses
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

IPV6 ADDRESS RANGES

IPv6 Address Types


Multicast
Anycast

Unicast
IPv6
Address
Types

54

12/09/2011

IPv6 address Ranges


2000::/3

Global Unicast

[RFC4291]

FC00::/7

Unique Local Unicast

[RFC4193]

FE80::/10

Link Local Unicast

[RFC4291]

FF00::/8

Multicast

[RFC4291]

::1/128

Loopback localhost address (127.0.0.1)

::/128

All zeros unspecified address

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

55

12/09/2011

IPV6 Unicast Address Scopes

Global

Global Scope

Unique Local

Routable only
within a site

Link Local

Only valid on a
given link

A single interface may have several


addresses assigned

Link
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
address range

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

Suitable for load balancing and


content delivery services.

57

12/09/2011

Review

The reason for IPv6


Features of IPv6
Abbreviating IPv6 addresses
IPv6 address ranges

58

Potrebbero piacerti anche