lecture # 20 ip addressing 1. binary 2 all digital electronics use a binary method for...

44
LECTURE # 20 IP ADDRESSING 1

Upload: gwen-peters

Post on 25-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

LECTURE # 20IP ADDRESSING

1

Page 2: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Binary2

All digital electronics use a binary method for communication.

Binary can be expressed using only two values: 0 or 1.

Page 3: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Converting Binary to Decimal

3

First, moving from right to left, create a chart that starts at the decimal number 1 and then double it 7 times.

128 64 32 16 8 4 2 1

Page 4: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Converting Binary to Decimal

4

Given a binary number, place the number under the chart (right justified).

128 64 32 16 8 4 2 1

1 0 1 1 0 0 1 1

•Add the numbers together to arrive at a final decimal amount.

•128 + 32 + 16 + 2 + 1 = 179

Page 5: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Converting Decimal to Binary

5

Find the largest number that is equal to or less than the number you are converting to binary. If our example number is 220, the largest number that is equal to or less than 220 is 128. Place a 1 under that space on the chart.

128 64 32 16 8 4 2 1

Page 6: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Converting Decimal to Binary

6

Next, subtract that number from the original decimal number. Subtracting 128 from 220 gives us 92.

Repeat this process until we have a subtracted result of 0.

128 64 32 16 8 4 2 1

1 1 0 1 1 1 0 0

Page 7: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Counting in Binary7

0 + 1 = 1 1 + 1 = 10 (carry the 1) 10 + 1 = 11 11 + 1 = 100 100 + 1 = 101 101 + 1 = 110 110 + 1 = 111

Page 8: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Binary Counting Chart8

1 1 11 1011

2 10 12 1100

3 11 13 1101

4 100 14 1110

5 101 15 1111

6 110 16 10000

7 111 17 10001

8 1000 18 10010

9 1001 19 10011

10 1010 20 10100

Page 9: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Addressing Principles9

Logical addresses in TCP/IP are 32 bits in length.

To make addressing more humanly manageable, the 32 bits are broken into four 8 bit octets.

We separate the octets by using a period symbol – 135.87.252.57. This is referred to as dotted decimal notation.

Page 10: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Dotted-decimal notation

10

Page 11: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

TCP/IP Host11

A host is a device that has a network interface card connected to a network.

If a device has two network interfaces, it should be considered two separate hosts.

Each host that is attached to a TCP/IP network must have a unique TCP/IP address.

Page 12: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

TCP/IP Addresses12

.

133.120.75.8

86

131.107.0.0131.107.0.0

131.107.3.27

133.120.0.0133.120.0.0

129.102.12.7

129.102.0.0

129.102.16.2

90

94

MARIA AVE

Page 13: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

TCP/IP Addresses13

IP Addresses divided into two parts(network address and host address) : Network ID or Net ID

Analogous to a street address. Host ID

Analogous to a house or building number. TCP/IP Addresses are hierarchical addresses

(combination of location ID and host ID) as opposed to flat addresses (e.g. MAC address).

Page 14: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 1Example 1

Change the following IP addresses from binary notation to dotted-decimal notation.

a. 10000001 00001011 00001011 11101111

b. 11111001 10011011 11111011 00001111

SolutionSolution

We replace each group of 8 bits with its equivalent decimal number and add dots for separation:a. 129.11.11.239b. 249.155.251.15

14

Page 15: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 2Example 2

Change the following IP addresses from dotted-decimal notation to binary notation.

a. 111.56.45.78

b. 75.45.34.78

SolutionSolutionWe replace each decimal number with its binary equivalent

a. 01101111 00111000 00101101 01001110b. 01001011 00101101 00100010 01001110

15

Page 16: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

In classful addressing, the address space is divided into five classes: A, B,

C, D, and E.

NoteNote::

16

Page 17: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Finding the class in binary notation

17

Page 18: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Finding the address class

18

Page 19: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 3Example 3

Find the class of each address:

a. 000000001 00001011 00001011 11101111

b. 111111110011 10011011 11111011 00001111

SolutionSolution

a. The first bit is 0; this is a class A address.b. The first 4 bits are 1s; this is a class E address.

19

Page 20: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Finding the Class in decimal Notation

20

Page 21: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 4Example 4

Find the class of each address:a. 227.12.14.87b. 252.5.15.111c. 134.11.78.56

SolutionSolution

a.The first byte is 227 (b/w 224 and 239); the class is D.b.The first byte is 252 (b/w 240 and 255)the class is E.c.The first byte is 134 (b/w 128 and 191); the class is B.

21

Page 22: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example22

A 00001010 00000010 00000000 00100101 B 10101100 00010000 00001010 00000001 C 10000001 00110100 00000110 00000001

Solution A 10.2.0.37 B 172.16.10.1 C 129.52.6.1

Page 23: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Netid and Hostid

23

Page 24: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Class A Address24

First bit will always be a 0. Remaining bits can be either 0s or 1s. Range of first octet is 00000001 to

01111111 Network addresses cannot be all 0s. 127 is reserved for loopback testing.

126 valid Class A network addresses 1.x.y.z to 126.x.y.z

Page 25: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Host ID Portion25

Cannot be all 0s If host portion is all 0s, represents a

network address. Cannot be all 1s

If host portion is all 1s, represents a broadcast.

Page 26: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Blocks in class A

26

Page 27: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Class B Address27

First two bits will always be a 10. Remaining bits can be either 0s or 1s. Range of first octet is 10000000 to

10111111 Range of networks 128.0.y.z to

191.255.y.z 16,384 valid Class B network IDs.

Page 28: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Blocks in class B

28

Page 29: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Class C Address29

First three bits will always be a 110. Remaining bits can be either 0s or 1s. Range of class C addresses is

11000000.x.y.z to 11011111.x.y.z 192.0.0.z to 223.255.255.z.

2,097,152 valid Class C network addresses.

Page 30: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Blocks in class C30

Page 31: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Class D Address31

First octet in binary is defined as 1110xxxx, replacing x’s with whatever we wish.

Range of Class D addresses is from 224.x.y.z to 239.x.y.z.

Used for multicasting – method of sending a single packet to multiple hosts.

Page 32: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Class E Address32

First octet is 1111xxxx, replacing x’s with whatever we wish.

Address ranges from 240.x.y.z to 255.x.y.z.

Experimental address range that is not used in actual networks.

Page 33: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

A network address is different from a netid. A network address has both

netid and hostid, with 0s for the hostid.

NoteNote::33

Page 34: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Network address

34

Page 35: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 5Example 5

Given the address 23.56.7.91, find the network address.

SolutionSolution

The class is A. Only the first byte defines the netid. We can find the network address by replacing the hostid bytes (56.7.91) with 0s. Therefore, the network address is 23.0.0.0.

35

Page 36: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 6Example 6

Given the address 132.6.17.85, find the network address.

SolutionSolution

The class is B. The first 2 bytes defines the netid. We can find the network address by replacing the hostid bytes (17.85) with 0s. Therefore, the network address is 132.6.0.0.

36

Page 37: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Example 7Example 7

Given the network address 17.0.0.0, find the class.

SolutionSolution

The class is A because the netid is only 1 byte.

37

Page 38: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Addressing Guidelines38

Network ID Cannot Be 127 127 is reserved for lookback functions

Network ID and Host ID Cannot Be 255 (All Bits Set to 1) 255 is a broadcast address

Network ID and Host ID Cannot Be 0 (All Bits Set to 0) 0 means “this network only” Example: 145.20.0.0 refers to Class B network

145.20.0.0 Host ID Must Be Unique to the Network

Page 39: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Assigning Network IDs39

11 22 33

124.x.y.z124.x.y.z 192.121.73.z192.121.73.z 131.107.y.z131.107.y.z

Router Router

Page 40: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Assigning Host IDs40

Router Router

124.0.0.27124.0.0.27

124.0.0.28124.0.0.28

124.0.0.29124.0.0.29

131.107.0.27131.107.0.27

131.107.0.28131.107.0.28

131.107.0.29131.107.0.29

192.121.73.

1192.121.73.

1

124.0.0.1124.0.0.1 192.121.73.

2192.121.73.

2

131.107.0.1131.107.0.1

124.x.y.z124.x.y.z 192.121.73.z192.121.73.z 131.107.0.z131.107.0.z

11 22 33

Page 41: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Address Class Summary41

[[

NumberNumberof Networksof Networks

NumberNumberof Networksof Networks

126126

16,38416,384

2,097,1522,097,152

Number of HostsNumber of Hostsper Networkper Network

Number of HostsNumber of Hostsper Networkper Network

16,777,21416,777,214

65,53465,534

254254

Class AClass AClass AClass A

Class BClass BClass BClass B

Class CClass CClass CClass C

Range ofRange ofNetwork IDs Network IDs (First Octet)(First Octet)

Range ofRange ofNetwork IDs Network IDs (First Octet)(First Octet)

1 – 1261 – 126

128 – 191128 – 191

192 – 223192 – 223

Page 42: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Reserved IP Addresses42

Defined in RFC 1918. Class A

10.0.0.0 to 10.255.255.255 Class B

172.16.0.0 to 172.31.255.255 Class C

192.168.0.0 to 192.168.255.255 Good choice for LAN numbering.

Page 43: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

Reserved IP Addresses43

169.254.0.0 to 169.254.255.255 used for operating systems that

automatically assign addresses when a DHCP server is unavailable.

Page 44: LECTURE # 20 IP ADDRESSING 1. Binary 2  All digital electronics use a binary method for communication.  Binary can be expressed using only two values:

44

Europe :194.0.0.0 – 195.255.255.255

North America:198.0.0.0 – 199.255.255.255

Central & South America:200.0.0.0 – 201.255.255.255

Asia & Pacific:202.0.0.0 – 203.255.255.255

Some addresses allocated