Sunteți pe pagina 1din 51

CS 1302

Data Communications &


Networking
Chapter 19 – Host-to-Host Delivery:
IP Addressing

FDP on Computer Networks 1


Introduction to TCP/IP
Addresses

172.18.0.1 172.16.0.1

172.18.0.2 172.16.0.2
HDR SADA DATA
10.13.0.0 192.168.1.0
10.13.0.1 172.17.0.1 172.17.0.2 192.168.1.1

– Unique addressing allows communication


between end stations
– Path choice is based on location
•Location is represented by an address
FDP on Computer Networks 2
IP Addressing
32 bits
Dotted
Decimal Network Host

Maximum 255 255 255 255

FDP on Computer Networks 3


IP Addressing
32 bits
Dotted
Decimal Network Host

Maximum 255 255 255 255


1 8 9 16 17 24 25 32

Binary 11111111 11111111 11111111 11111111

16
8
4
2
1
128
64
32
64
128
32
16
8
4
2
1
128
32
16
8
4
2
1
128
64

8
4
2
1
64

32
16

FDP on Computer Networks 4


IP Addressing
32 bits
Dotted
Decimal Network Host

Maximum 255 255 255 255


1 8 9 16 17 24 25 32

Binary 11111111 11111111 11111111 11111111

128

8
4
2
1
64
32
16
8
4
2
1
128
64
32
16
128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
Example 1
Decimal 172 16 122 204
Example 10101100 00010000 01111010 11001100
Binary
FDP on Computer Networks 5
IP Address Classes
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
•Class E: Research

FDP on Computer Networks 6


Unicast, Multicast, and
Reserved Addresses
• Unicast address – identifies a specific
device
• Multicast address – identifies a host
belongs to a group or groups (used only
as a destination address)
• Reserved addresses – class E addresses;
only used in special cases

FDP on Computer Networks 7


Class A Addresses
• Numerically the lowest
• Use only one byte to identify the class type and
netid
• Three bytes are available for hostid numbers
• 127 possible class A networks with a maximum
of 16,777,214 computers on each network
• Designed for large organizations with a large
number of hosts or routers
• Many addresses are wasted

FDP on Computer Networks 8


Class B Addresses
• First two octets are the network number and
the last two octets are the host number
• 16,382 possible blocks for assignment to
organizations with a maximum of 65,534
computers on each network
• Designed for mid-size organizations that may
have tens of thousands of hosts or routers
• Many addresses are wasted

FDP on Computer Networks 9


Class C Addresses
• The first three octets are the network number
and the last octet is the host number
• 2,096,896 blocks for assignment to
organizations
• First three bytes (netid) are the same
• Each block only contains 256 addresses,
which may be smaller than what many
organizations need

FDP on Computer Networks 10


Blocks in Class C

FDP on Computer Networks 11


Class D and Class E Addresses
• Class D – reserved for multicast
addresses
– Multicasting – transmission method which
allows copies of a single packet to be sent to
a selected group of receivers
• Class E – reserved for future use

FDP on Computer Networks 12


Network Address
• First address in the block, assigned to the organization
• Defines the network itself and cannot be assigned to a
host
• Has both netid and hostid, with 0s for the hostid
• Defines the network to the rest of the Internet

FDP on Computer Networks 13


IP Address Classes
Bits: 1 8 9 16 17 24 25 32
0NNNNNNN Host Host Host
Class A:
Range (1-126)

Bits: 1 8 9 16 17 24 25 32
10NNNNNN Network Host Host
Class B:
Range (128-191)
1 8 9 16 17 24 25 32
Bits:
110NNNNN Network Network Host
Class C:
Range (192-223)
1 8 9 16 17 24 25 32
Bits:
1110MMMM Multicast Group Multicast Group Multicast Group
Class D:
Range (224-239)
FDP on Computer Networks 14
Host Addresses
172.16.2.1 10.1.1.1
10.6.24.2
E1
172.16.3.10 E0 10.250.8.11
172.16.2.10

172.16.12.12 10.180.30.118

Routing Table
172.16 . 12 . 12 Network Interface
Network Host 172.16.0.0 E0
10.0.0.0 E1
FDP on Computer Networks 15
IP Address Classes Exercise

Address Class Network Host

10.2.1.1

128.63.2.100

201.222.5.64

192.6.141.2

130.113.64.16

256.241.201.10

FDP on Computer Networks 16


Addressing without Subnets

172.16.0.1 172.16.0.2 172.16.0.3 172.16.255.253 172.16.255.254

…...

172.16.0.0

•Network 172.16.0.0
FDP on Computer Networks 17
Addressing with Subnets

172.16.3.0

172.16.4.0

172.16.1.0 172.16.2.0

•Network 172.16.0.0
FDP on Computer Networks 18
Subnetting
• IP addressing is hierarchical
• First reach a device through its network id
(netid)
• Then reach the host itself using the second
portion (hostid)
• Since an organization may not have enough
address, subnetting may be used to divide
the network into smaller networks or
subnetworks
FDP on Computer Networks 19
Network Hierarchies

Network with two levels of hierarchy (not subnetted) Network with three levels of hierarchy (subnetted)

FDP on Computer Networks 20


Subnetting (cont)

• Subnetting creates an intermediate level of


hierarchy
• IP datagram routing then involves three steps:
delivery to the site, delivery to the subnetwork, and
delivery to the host

FDP on Computer Networks 21


Masking
• Extracts the address of the physical network
from an IP address
• Used by routers inside the organization

FDP on Computer Networks 22


Boundary Level Masking
• If mask numbers are either 255 or 0:
– Bytes in the IP address that correspond to 255 in the
mask will be repeated in the subnet mask
– Bytes in the address that correspond to 0 in the mask
will change to 0 in the subnet address

IP address 45 23 21 8
Mask 255 255 0 0

Subnet 45 23 0 0

FDP on Computer Networks 23


Nonboundary-Level Masking
• If masking is not at the boundary level
(mask numbers are not just 255 or 0)
– Bytes in the IP address that correspond to 255
in the mask will be repeated in the subnet
address
– Bytes in the IP address that correspond to 0 in
the mask will change to 0 in the subnet address
– For other bytes, use the bit-wise AND operator

FDP on Computer Networks 24


Nonboundary-Level Masking
Example
IP address 45 123 21 8
Mask 255 192 0 0

Subnet 45 64 0 0

123 01111011
192 11000000
64 01000000

FDP on Computer Networks 25


Subnet Addressing
172.16.2.200 172.16.3.5
172.16.3.1
E1
172.16.2.2 E0 172.16.3.100
172.16.2.1

172.16.2.160 172.16.3.150

New Routing Table


172.16 . 2 . 160 Network Interface
Network Host 172.16.0.0 E0
172.16.0.0 E1
FDP on Computer Networks 26
Subnet Addressing
172.16.2.200 172.16.3.5
172.16.3.1
E1
172.16.2.2 E0 172.16.3.100
172.16.2.1

172.16.2.160 172.16.3.150

New Routing Table


172.16 . 2 . 160 Network Interface
Network Subnet Host 172.16.2.0 E0
172.16.3.0 E1
FDP on Computer Networks 27
Subnet Mask
Network Host

IP
Address
172 16 0 0
Network Host
Default
Subnet
Mask
255 255 0 0
11111111 11111111 00000000 00000000
Also written as “/16” where 16 represents the number of 1s
in the mask.
Network Subnet Host
8-bit
Subnet 255 255 255 0
Mask
Also written as “/24” where 24 represents the number of 1s
in the mask.
FDP on Computer Networks 28
Decimal Equivalents of Bit
Patterns
128 64 32 16 8 4 2 1

1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255

FDP on Computer Networks 29


Subnet Mask without Subnets
Network Host

172.16.2.160 10101100 00010000 00000010 10100000

255.255.0.0 11111111 11111111 00000000 00000000

10101100 00010000 00000000 00000000

Network 172 16 0 0
Number

•Subnets not in use—the default


FDP on Computer Networks 30
Subnet Mask with Subnets
Network Subnet Host

172.16.2.160 10101100 00010000 00000010 10100000

255.255.255.0 11111111 11111111 11111111 00000000

10101100 00010000 00000010 00000000

192
224
240
248
252
255
128

254
Network
Number 172 16 2 0

•Network number extended by eight bits


FDP on Computer Networks 31
Subnet Mask with Subnets
(cont.)
Network Subnet Host

172.16.2.160 10101100 00010000 00000010 10100000

255.255.255.192 11111111 11111111 11111111 11000000

10101100 00010000 00000010 10000000

192
224
240
248
252
255
128
192
224
240
248
252
254
255
128

254
Network
Number 172 16 2 128

•Network number extended by ten bits


FDP on Computer Networks 32
Subnet Mask Exercise

Address Subnet Mask Class Subnet

172.16.2.10 255.255.255.0

10.6.24.20 255.255.240.0

10.30.36.12 255.255.255.0

FDP on Computer Networks 33


Broadcast Addresses

172.16.3.0

172.16.4.0

172.16.1.0

172.16.3.255 172.16.2.0
(Directed broadcast)

255.255.255.255
(Local network broadcast)
X
172.16.255.255
(All subnets broadcast)
FDP on Computer Networks 34
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 Mask

Subnet 4

Broadcast

First

Last
FDP on Computer Networks 35
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

Subnet

Broadcast

First

Last
FDP on Computer Networks 36
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

Subnet

Broadcast

First

Last 7
FDP on Computer Networks 37
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

10000000 Subnet 4

Broadcast

First

Last
FDP on Computer Networks 38
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

10000000 Subnet 4

10111111 Broadcast
5
First 6

Last
FDP on Computer Networks 39
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

10000000 Subnet 4

10111111 Broadcast
5
10000001 First 6

Last
FDP on Computer Networks 40
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2

10000000 Subnet 4

10111111 Broadcast
5
10000001 First 6

10111110 Last 7
FDP on Computer Networks 41
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2


8
10101100 00010000 00000010 10000000 Subnet 4

10101100 00010000 00000010 10111111 Broadcast


5
10101100 00010000 00000010 10000001 First 6

10101100 00010000 00000010 10111110 Last 7


FDP on Computer Networks 42
Addressing Summary Example
172 16 2 160

172.16.2.160 10101100 00010000 00000010 10100000 Host 1

255.255.255.192 11111111 11111111 11111111 11000000 Mask 2


9 8
172.16.2.128 10101100 00010000 00000010 10000000 Subnet 4

172.16.2.191 10101100 00010000 00000010 10111111 Broadcast


5
172.16.2.129 10101100 00010000 00000010 10000001 First 6

172.16.2.190 10101100 00010000 00000010 10111110 Last 7


FDP on Computer Networks 43
Class B Subnet Example
IP Host Address: 172.16.2.121
Subnet Mask: 255.255.255.0
Network Network Subnet Host

172.16.2.121: 10101100 00010000 00000010 01111001


255.255.255.0: 11111111 11111111 11111111 00000000

Subnet: 10101100 00010000 00000010 00000000


Broadcast: 10101100 00010000 00000010 11111111

•Subnet Address = 172.16.2.0


•Host Addresses = 172.16.2.1–172.16.2.254
•Broadcast Address = 172.16.2.255
•Eight bits of subnetting
FDP on Computer Networks 44
Subnet Planning
20 subnets
5 hosts per subnet
Class C address:
192.168.5.0

192.168.5.16
Other
subnets

192.168.5.32 192.168.5.48

FDP on Computer Networks 45


Class C Subnet Planning
Example
IP Host Address: 192.168.5.121
Subnet Mask: 255.255.255.248
Network Network Network Subnet Host

192.168.5.121: 11000000 10101000 00000101 01111001


255.255.255.248: 11111111 11111111 11111111 11111000

Subnet: 11000000 10101000 00000101 01111000


Broadcast: 11000000 10101000 00000101 01111111

•Subnet Address = 192.168.5.120


•Host Addresses = 192.168.5.121–192.168.5.126
•Broadcast Address = 192.168.5.127
•Five Bits of Subnetting
FDP on Computer Networks 46
Broadcast Addresses Exercise

Address Subnet Mask Class Subnet Broadcast

201.222.10.60 255.255.255.248

15.16.193.6 255.255.248.0

128.16.32.13 255.255.255.252

153.50.6.27 255.255.255.128

FDP on Computer Networks 47


Dynamic Address Configuration
• Dynamic Host Configuration Protocol
(DHCP) is a protocol designed to
dynamically provide information such as a
station’s IP address, the subnet mask, the
IP address of the router, and the IP
address of a name server
• Allows for temporary leases from a pool of
available addresses

FDP on Computer Networks 48


Network Address Translation
• Allows a user to have a large set of addresses internally
and one address, or a small set of addresses, externally
• May use an address within the reserved set
• NAT software on a router provides the single connection
to the global Internet

Range Total

10.0.0.0 to 10.255.255.255 224

172.16.0.0 to 172.31.255.255 220

192.168.0.0 to 192.168.255.255 216


FDP on Computer Networks 49
Supernetting
• Class C blocks have a maximum number
of 256 addresses
• Supernetting allows an organization to
combine several class C blocks to create a
larger range of addresses

• Covered in more advanced networking


coursesm
FDP on Computer Networks 50
Classless Addressing
• Addressing mechanism in which the IP
address space is not divided into classes
• Block ranges are variable, as long as they
are a power of 2 (2, 4, 8,…)
• Masking is also used as well as subnetting
• Requires a different routing scheme,
discussed later

FDP on Computer Networks 51

S-ar putea să vă placă și