lecture # 20 ip addressing 1. binary 2 all digital electronics use a binary method for...
TRANSCRIPT
LECTURE # 20IP ADDRESSING
1
Binary2
All digital electronics use a binary method for communication.
Binary can be expressed using only two values: 0 or 1.
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
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
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
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
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
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
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.
Dotted-decimal notation
10
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.
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
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).
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
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
In classful addressing, the address space is divided into five classes: A, B,
C, D, and E.
NoteNote::
16
Finding the class in binary notation
17
Finding the address class
18
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
Finding the Class in decimal Notation
20
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
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
Netid and Hostid
23
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
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.
Blocks in class A
26
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.
Blocks in class B
28
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.
Blocks in class C30
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.
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.
A network address is different from a netid. A network address has both
netid and hostid, with 0s for the hostid.
NoteNote::33
Network address
34
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
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
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
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
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
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
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
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.
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.
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