Top Banner
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All ri ghts reserved. 1 Computer Networks and Internets with Internet Applications, 4e By Douglas E. Comer Lecture PowerPoints By Lami Kaya, [email protected]
39

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

Dec 18, 2015

Download

Documents

Carmella Taylor
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 1

Computer Networks and Internets with Internet Applications, 4e

By Douglas E. Comer

Lecture PowerPoints

By Lami Kaya, [email protected]

Page 2: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 2

Chapter 18

IP: Internet Protocol Addresses

Page 3: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 3

Topics Covered• 18.1 Introduction

• 18.2 Addresses For The Virtual Internet

• 18.3 The IP Addressing Scheme

• 18.4 The IP Address Hierarchy

• 18.5 Original Classes Of IP Addresses

• 18.6 Computing The Class of An Address

• 18.7 Dotted Decimal Notation

• 18.8 Classes And Dotted Decimal Notation

• 18.9 Division Of The Address Space

• 18.10 Authority For Addresses

• 18.11 A Classful Addressing Example

• 18.12 Subnet And Classless Addressing

• 18.13 Address Masks

Page 4: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 4

Topics Covered (cont)• 18.14 CIDR Notation • 18.15 A CIDR Address Block Example • 18.16 CIDR Host Addresses • 18.17 Special IP Addresses

– 18.17.1 NW Address – 18.17.2 Directed Broadcast Address – 18.17.3 Limited Broadcast Address – 18.17.4 This Computer Address

– 18.17.5 Loopback Address • 18.18 Summary Of Special IP Addresses • 18.19 The Berkeley Broadcast Address Form • 18.20 Routers And The IP Addressing Principle • 18.21 Multi-Homed Hosts

Page 5: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 5

18.1 Introduction

The chapter• begins a description of protocols that makes an internet

appear to be a single, seamless system• introduces the addressing scheme used by the Internet

Protocol (IP) • explains how the original IP addressing scheme divided

addresses into classes• discusses subnet addressing and classless addressing,

two additions to the IP addressing scheme

Page 6: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 6

18.2 Addresses For The Virtual Internet

• Chief differences between an internet and a physical NW – an internet is merely an abstraction imagined by its designers

and created entirely by SW

• Designers are free to choose – addresses, packet formats, and delivery techniques

• All host computers must use a uniform/unique addresses• Physical NW addresses do not suffice this requirements

– addresses used by two technologies may be incompatible because they are different sizes or have different formats

Page 7: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 7

18.3 The IP Addressing Scheme

• In the TCP/IP protocol stack, addressing is specified by the Internet Protocol (IP)

• The IP standard specifies that each host is assigned a unique 32-bit number – known as Internet Protocol address or Internet address

• Each packet sent across an internet contains the 32-bit IP address of– the sender (source) and recipient (destination)

Page 8: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 8

18.4 The IP Address Hierarchy

• Each 32-bit IP address is divided into two parts: – a prefix, identifies the physical NW

• Each physical NW is assigned a unique “NW number”

– a suffix, identifies an individual computer on that NW– the two-level hierarchy is designed to make routing efficient

• The IP address hierarchy provides following– Each computer is assigned a unique address – NW number assignments must be coordinated globally– Suffixes can be assigned locally without global coordination

Page 9: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 9

18.5 Original Classes Of IP Addresses

• The prefix needs sufficient bits to allow a unique NW number to be assigned to each physical NW

• The suffix needs sufficient bits to permit each computer– to be assigned a unique suffix

• Designers chose a compromise addressing scheme – that can accommodate large and small NW

• In original scheme, which is known as classful addressing– The first four bits of an address determine the class

• Figure 18.1 illustrates the five address classes

Page 10: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 10

Page 11: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 11

18.6 Computing The Class of An Address

• Classful IP addresses are self identifying because the class of the address can be computed from the address

• Part of the motivation for using leading bits for classes arises from computational considerations:– using bits can decrease computation time.– computers can examine bits faster than comparing integers

• Figure 18.2 illustrates the contents of the table used in the computation

Page 12: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 12

Page 13: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 13

18.7 Dotted Decimal Notation

• When interacting with a user– we use a notation that is more convenient for humans to

understand, called dotted decimal notation – each 8-bit section of a 32-bit number as a decimal value and

uses periods to separate the sections.

• Figure 18.3 illustrates examples of binary numbers and the equivalent dotted decimal forms

• Dotted decimal treats each octet as an unsigned binary integer– dotted decimal addresses range

from 0.0.0.0 through 255.255.255.255

Page 14: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 14

Page 15: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 15

18.8 Classes And Dotted Decimal Notation

• Dotted decimal worked well with classful IP addresses– IP uses octet boundaries to separate an address– class A the last three octets correspond to a host– class B last two octets of host suffix– class C last one octet for host

• Dotted decimal notation does not make individual bits of an address visible– class must be recognized from the decimal value of the first

octet

• Figure 18.4 shows the decimal range of values for each class

Page 16: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 16

Page 17: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 17

18.9 Division Of The Address Space

• The IP class scheme does not divide the 32-bit address space into equal size classes,– classes do not contain the same number of NW– Ex: half of all IP addresses are in class A– class A can contain only 128 NW

• Figure 18.5 summarizes the maximum number of NWs available – in each class and the maximum number of hosts per NW

Page 18: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 18

Page 19: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 19

18.10 Authority For Addresses • For global Internet,

– an organization obtains NW numbers from an Internet Service Provider ( ISP)

• ISPs coordinate with a central organization– the Internet Company Assigned Number and Names (ICANN)– Authority to ensure that each NW prefix is unique

• For a private internet, – organization can choose prefix

• A single NW administrator assigns prefixes to all NW in the company's internet – to ensure that numbers are not duplicated

• To help an organization choose addresses– RFC 1597 recommends class A, B, and C addresses that can be

used in “private internets” private IP addresses

Page 20: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 20

18.11 A Classful Addressing Example

• Consider an organization that chooses to form a private TCP/IP internet – which consists of four physical NW as Figure 18.6

• The NW administrator estimates the ultimate size of each physical NW– uses that size to choose a prefix

• IP address assigned to a host – always begins with the prefix that has been assigned to the NW– suffixes, which are assigned by the local NW administrator, can

be arbitrary numbers

Page 21: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 21

Page 22: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 22

18.12 Subnet And Classless Addressing

• As the Internet grew, classful addressing scheme became a limitation– the IP address space was being exhausted– because all NW had to choose one of three possible sizes, many

addresses were unused

• Two new mechanisms were devised to overcome– subnet addressing– classless addressing

• Consider a NW that contains 9 hosts– Only four bits are needed to represent all possible host values– However, a classful C address, which has the fewest hosts

possible, devotes eight bits to the host suffix– Classless addressing solves the problem by allowing an ISP to

assign a prefix that is an arbitrary number of bits

Page 23: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 23

18.13 Address Masks • Classless and subnet addressing requires an additional information

– the 32-bit address itself and– 32-bit specifying the boundary between the prefix and the suffix– called “subnet mask”

• The bit-mask representation makes such comparison efficient• A destination address, D , and a pair (A, M) that represents an IP

address and a address maskA = (D & M)

• Example, consider the following 32-bit subnet mask:11111111 11111111 00000000 00000000 = 255.255.0.0

• The 32-bit NW prefix:10000000 00001010 00000000 00000000 = 128.10.0.0

• Consider10000000 00001010 00000010 00000011 = 128.10.2.3

• A logical ``and &'‘ of A = (D & M) produces 10000000 00001010 00000000 00000000

Page 24: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 24

18.14 CIDR Notation

• When humans enter a prefix and an address mask, they do not use binary representation– Instead, use a modified form of dotted decimal addressing

• known as “CIDR notation”

– The mask associated with an address by appended by a slash and the size of the mask in decimal

• Ex: – 128.10.0.0 with 16-bit NW prefix and a 16-bit host suffix.– In CIDR notation, the address can be written:

128.10.0.0 / 16

Page 25: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 25

18.15 A CIDR Address Block Example (1)

CIDR adds flexibility:• suppose an ISP begins with a single class B prefix

(e.g., 128.211.0.0 )• In classful, the prefix as corresponding to a single NW, the ISP can

only assign the prefix to one customer, up to 2^16 hosts• classful only works if ISP has a customer with many computers:• If it needs to assign the entire prefix, the ISP can choose a 16-bit

CIDR mask• If the ISP has two customers with only 12 computers each, the

classful cannot be used– 128.211.0.0 / 16

• If two customers with only twelve computers each, the ISP can use CIDR to partition the address into different pieces

Page 26: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 26

18.15 A CIDR Address Block Example (2)

For example• one customer can be assigned:

128.211.0.16 / 28

• and the other customer can be assigned: 128.211.0.32 / 28

• Although both customers have the same mask size (28 bits), the prefixes differ

• Thus, there is no ambiguity -- each customer has a unique prefix.

Page 27: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 27

18.16 CIDR Host Addresses

• Once an ISP assigns a customer a CIDR prefix, the customer can assign host addresses.

• Suppose an organization is assigned 128.211.0.16 / 28• Bits 28 through 31 correspond to the host suffix• The CIDR mask / 28 corresponds to 255.255.255.240• Assigning all possible 4-bit values as host suffixes, the values that

can be assigned are limited to decimal values 1 through 14• Figure 18.7 also illustrates a disadvantage of CIDR and subnet• addressing -- because the host suffix can start on an arbitrary

boundary, values are not easy to read in dotted decimal.• Ex. when combined with the NW prefix, the fourteen possible host

suffixes result in dotted decimal values from 128.211.0.17 through 128.211.0.30

Page 28: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 28

Page 29: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 29

18.17 Special IP Addresses

• In addition to assigning an address to each computer– it is convenient to have addresses that can be used to denote

NW or sets of computers

• IP defines a set of special address reserved • Special addresses are never assigned to hosts

– 18.17.1 Network Address – 18.17.2 Directed Broadcast Address – 18.17.3 Limited Broadcast Address – 18.17.4 This Computer Address – 18.17.5 Loopback Address

Page 30: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 30

18.17.1 Network Address

• It is convenient to have an address that can be used to denote the prefix assigned to a given NW

• IP reserves host address zero– and uses it to denote a NW – Ex: 128.211.0.0 / 16 denotes a NW that has been assigned the

prefix 128.211

• The NW address refers to the NW itself – and not to the host computers attached to that NW

• The NW address should never appear as the destination address in a packet

Page 31: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 31

18.17.2 Directed Broadcast Address• To send a copy of a packet to all hosts on a

– NW uses “broadcasting”

• When a packet is sent to a directed broadcast address – a single copy of the packet travels across the internet until it

reaches the specified NW– The packet is then delivered to all hosts on the NW

• The directed broadcast address– suffix that consists of all 1 bits– IP reserves the host address that contains all 1 bits

• If a NW HW supports broadcast– a directed broadcast will be delivered using the HW broadcast

ca

• When no HW support– SW send a separate copy of the packet to each host on the NW

Page 32: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 32

18.17.3 Limited Broadcast Address

• The term “limited broadcast” refers to a broadcast on a local physical NW– informally, we say that the broadcast is limited to a ``single wire''

• Used during system startup by a computer that does not yet know the NW number

• IP reserves the address consisting of all 1 bits to refer to limited broadcast– IP will broadcast any packet sent to the all-ones address across

the local NW

Page 33: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 33

18.17.4 This Computer Address

• A computer needs to know its IP address to send or receive packets – each packet contains the address of the source/destination

• The TCP/IP contains protocols a computer can use to obtain its IP address automatically when it boots

• The startup protocols use IP to communicate• When using startup protocols

– a computer cannot supply a correct IP source address

• To handle such cases, IP reserves the address that consists of all zeroes to mean “this computer”

Page 34: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 34

18.17.5 Loopback Address

• Programmers often use “loopback” testing for preliminary debugging an application

• Each application includes the code needed to interact with TCP/IP

• Instead of separate computers, the programmer runs these programs on a single computer by using loopback

• When one application sends, the data travels down the protocol stack, which forwards it back to originator– during loopback testing no packets ever leave a computer

• IP reserves the NW prefix 127 / 8 for use with loopback• By convention, programmers often use host number 1 ,

making 127.0.0.1 the most popular form of loopback

Page 35: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 35

Page 36: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 36

18.19 The Berkeley Broadcast Address Form

• Uni of California at Berkeley implemented some TCP/IP protocols as part of Berkeley SW Distribution (BSD) UNIX

• The BSD implementation contained a nonstandard feature that has affected many subsequent implementations– Instead of using a host suffix of all ones to represent a directed

broadcast address

– the Berkeley implementation used a host suffix that contained all zeroes, known as “Berkeley broadcast”

• Unfortunately, many computer manufacturers derived their early TCP/IP SW from the Berkeley implementation

• Some TCP/IP implementations include a configuration parameter that can select between the TCP/IP standard and the Berkeley form

Page 37: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 37

18.20 Routers And The IP Addressing Principle

• Each router is assigned two or more IP addresses. – Each IP address contains a prefix that specifies a NW– Each IP address identifies a connection between– Each interface is assigned an address

• IP does not require that the same suffix be assigned to all interfaces of a router

• But using the same suffix can help humans who manage the internet for easy remembering

Page 38: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 38

Page 39: © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 39

18.21 Multi-Homed Hosts

• Can a host have multiple NW connections?

Answer is Yes!• A host computer that connects to multiple NW

– called “multi-homed”– a multi-homed host has multiple protocol addresses

• Multi-homing is sometimes used to increase reliability– if one NW fails, the host can still reach the internet through the

second connection

• Multi-homing can also be used to increase performance– connections to multiple NW can make it possible to send traffic

directly and avoid routers, which are sometimes congested