classless and subnet address extensions (cidr)

39
Classless and Subnet Address Extensions (CIDR) Chapter 10

Upload: naeva

Post on 23-Feb-2016

116 views

Category:

Documents


0 download

DESCRIPTION

Classless and Subnet Address Extensions (CIDR). Chapter 10. Introduction. Five extensions of the IP address scheme, designed to conserve network prefixes Transparent routers Proxy ARP Subnet Addressing Anonymous Point-To-Point Networks Classless Addressing. Relevant Facts. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Classless and Subnet Address Extensions (CIDR)

Classless and Subnet Address Extensions (CIDR)

Chapter 10

Page 2: Classless and Subnet Address Extensions (CIDR)

Introduction

• Five extensions of the IP address scheme, designed to conserve network prefixes– Transparent routers– Proxy ARP– Subnet Addressing– Anonymous Point-To-Point Networks– Classless Addressing

Page 3: Classless and Subnet Address Extensions (CIDR)

Relevant Facts

• In the original IP addressing scheme:– Each network is assigned a unique network address– Each host on that network has the network address as a

prefix of the host’s address

• Advantage of this scheme:– Routers keep one routing entry per network– Only the network portion of the address is examined

when making routing decisions

Page 4: Classless and Subnet Address Extensions (CIDR)

Relevant Facts

• Remember original IP addresses– Class A: 8 bit network id, 24 bit host id– Class B: 16 bit network id, 16 bit host id– Class C: 24 bit network id, 8 bit host id

• Sites may modify this scheme as long as:– All hosts and routers agree to the modified scheme– Other sites on the Internet can treat addresses as a

network prefix and a host suffix

Page 5: Classless and Subnet Address Extensions (CIDR)

Minimizing Network Numbers

• Growth has made the original addressing scheme unfeasible for the future– Overhead of managing network addresses– Routing tables are large and exchanging routing

information requires significant effort– Address space will be exhausted (see p. 148)

• Three ways of sharing one network among multiple physical networks follows

Page 6: Classless and Subnet Address Extensions (CIDR)

Transparent Routers

• A router is used to make it look as though several hosts are connected to a WAN

• It is transparent because other routers and hosts on the WAN do not know that it exists

• The router is connected to hosts in a local area network on one side (as a multiplexer), and to a single host port of the WAN on the other

Page 7: Classless and Subnet Address Extensions (CIDR)

H1

H2

H3

H4

TWide Area Network

T is a transparent router connecting multiplehosts to a WAN. Hosts are assigned addressesas if they connected directly to the WAN.

Page 8: Classless and Subnet Address Extensions (CIDR)

Transparent Routers

• The local area network does not have its own IP prefix

• The router demultiplexes datagrams that arrive from the WAN and sends them to the host using a table of addresses

• The router also accepts datagrams from the hosts and sends them across the WAN to the destinations

Page 9: Classless and Subnet Address Extensions (CIDR)

Transparent Routers

• Advantages– requires fewer network addresses since the LAN does

not need a separate IP prefix– supports load balancing

• Disadvantages– works with networks with a large number of host

addresses• good for class A, not good for class C

– may not provide allservices (ICMP and SNMP)

Page 10: Classless and Subnet Address Extensions (CIDR)

Proxy ARP

• Applies to networks that use ARP to bind internet addresses to physical addresses

• Allows one network address to be shared by two physical networks

• A router which runs proxy ARP answers ARP requests on each network for hosts on the other network

• Also called: ARP hack and promiscuous ARP

Page 11: Classless and Subnet Address Extensions (CIDR)

Main Network

H1 H2 H3

H4 H5

Hidden Network

R

Router running proxy ARP

Page 12: Classless and Subnet Address Extensions (CIDR)

Proxy ARP

• When H1 needs to talk to H4, it uses ARP• R captures the ARP request from H1 and

responds with R’s physical address• H1 sends datagrams destined for H4 to R• R looks in its routing table to route the

datagram on to H4 on the hidden network

Page 13: Classless and Subnet Address Extensions (CIDR)

Proxy ARP

• Advantage– It can be added to a single router without

changing the routing tables in other hosts or routers on this network

• Disadvantages– Only works on networks that use ARP– Spoofing: one machine claims to be another

Page 14: Classless and Subnet Address Extensions (CIDR)

Subnet Addressing

• Most widely used technique of the 3• Standardized, required part of IP addressing• A single site has a single class B address

assigned to it, but has 2 or more networks• Only local routers know that there are

multiple networks at this site

Page 15: Classless and Subnet Address Extensions (CIDR)

Rest of the Internet

H1 H2

H3H4

R

all traffic to128.10.0.0

Network 128.10.2.0

Network 128.10.1.0128.10.1.1 128.10.1.2

128.10.2.1 128.10.2.2

Page 16: Classless and Subnet Address Extensions (CIDR)

Subnet Addressing

• The address 128.10.0.0 is used for both networks at the site

• Routers in the internet send to either network as though it was a single network

• Only R knows that there are two networks and looks at the third octet to route– The two networks are called subnets

Page 17: Classless and Subnet Address Extensions (CIDR)

Subnet Addressing

• Instead of dividing the 32-bit IP address into (netid, hostid), we use (net portion, local portion)

• The interpretation of the local portion of the address is left to the site– The net or internet portion identifies a site – The local portion identifies a physical network

and a host

Page 18: Classless and Subnet Address Extensions (CIDR)

Subnet Addressing

• Conceptual 32-bit address in original addressing with conceptual subnet addressing– Hierarchical addressing and hierarchical routing

Internet part

Internet part

Local part

PhysicalNetwork Host

Page 19: Classless and Subnet Address Extensions (CIDR)

Flexibility in Subnet Address Assignment• Sites are allowed flexibility in choice of address

assignment

R4 R5

R2 R3

To the rest of theInternet

R1

Network 1

Network 2 Network 3

Network 4 Network 5

Page 20: Classless and Subnet Address Extensions (CIDR)

Flexibility in Subnet Address Assignment• See Figure 10.6

– For fixed length subnetting• When a site has a large number of subnets, the

number of hosts must be small• When a site has a large number of hosts, the number

of subnets will be small

Page 21: Classless and Subnet Address Extensions (CIDR)

Variable Length Subnets

• An organization may choose a partition size for each physical network– Since the organization may have large and

small networks, this gives flexibility to the site• Disadvantage:

– Possible address ambiguity

Page 22: Classless and Subnet Address Extensions (CIDR)

Subnets with Masks

• For subnetting of either kind, a 32-bit subnet mask specifies the division– Bits in the mask are set to 1 if machines on the

network treat the corresponding bit in the address as part of the subnet prefix, 0 if not

– Example: the mask 11111111 11111111 11111111 00000000says the first 3 octets identify the network, and the fourth identifies the host

Page 23: Classless and Subnet Address Extensions (CIDR)

Subnets with Masks

• Subnet masks do not necessarily have to select contiguous bits of the address, i.e.:11111111 11111111 00011000 01000000

… not recommended!

Page 24: Classless and Subnet Address Extensions (CIDR)

Subnet Mask Representation

• Masks may be represented in dotted decimal (binary is difficult)as in 255.255.255.0

• They may be represented as a 3-tuple{network #, subnet #, host #} where -1 means “all ones”{-1, -1, 0} is 255.255.255.0{128.23, -1, 0} is 128.23.255.0

Page 25: Classless and Subnet Address Extensions (CIDR)

Routing with Subnets

• Hosts connected to networks that are not subnetted must communicate with hosts on networks that are subnetted

• Rule: To achieve optimal routing, a machine M must use subnet routing for an IP network address N, unless there is a single path P such that P is a shortest path between M and every physical network that is a subnet of N.

Page 26: Classless and Subnet Address Extensions (CIDR)

Routing with Subnets

• Guideline: All subnets of a given network IP address must be contiguous, the subnet masks should be uniform across all networks, and all machines should participate in subnet routing.

Page 27: Classless and Subnet Address Extensions (CIDR)

Questions

• How does this modify the routing algorithm?• How are subnet masks assigned?• How do we broadcast to subnets?

Page 28: Classless and Subnet Address Extensions (CIDR)

Anonymous Point to Point Networks• When a leased line connects two routers,

the line and the two routers are not given addresses– No hardware address is needed– The interface software ignores the next hop

address when sending datagrams– The connection is known as an unnumbered

network, or anonymous network

Page 29: Classless and Subnet Address Extensions (CIDR)

R1 R2

128.10.0.0 128.211.0.0

128.10.2.250 128.211.0.100

leased line

1 2

Routing Table in R1

128.10.0.0

To reach hostson network Route To Using Interface #

12

Deliver Directdefault 128.211.0.100

Page 30: Classless and Subnet Address Extensions (CIDR)

Classless Addressing

• Allows addresses assigned to a single organization to span multiple classes

• Why adopted?– The classful scheme did not divide network addresses

into classes equally (<17K class B networks, >2M class C networks)

– Class C addresses were assigned slowly– Class B addresses would be exhausted (Running out of

address space ROADS)

Page 31: Classless and Subnet Address Extensions (CIDR)

Classless Addressing (Supernetting)• Consider a medium-sized organization that

joins the Internet– A class B address is preferred over a class C– But the organization may be given a block of 256

contiguous class C addresses– This would also be a useful way to have Internet

Service Providers (ISPs) provide IP addresses to an organization

• The ISP allocates addresses from the set to subscribers

Page 32: Classless and Subnet Address Extensions (CIDR)

Supernetting Effects on Routing

• A new problem is created:– Now routing table is increased incredibly– Instead of one class B address, we now have 256

class C addresses• How can the problem be fixed?

– Collapsing a block of contiguous addresses into a single entry: (network address, count)

• network address is the smallest @ in the block• count is the number of network @s in the block

Page 33: Classless and Subnet Address Extensions (CIDR)

Supernetting Effects on Routing

• Example:– The pair (127.92.61.25, 4) specifies the four

network addresses• 127.92.61.25• 127.92.61.26• 127.92.61.27• 127.92.61.28

• Routing tables can be smaller

Page 34: Classless and Subnet Address Extensions (CIDR)

CIDR

• What has just been described is Classless Inter-Domain Routing (CIDR)– The name does not indicate that it also involves

addressing– It is not restricted to Class C addresses– It does not really use an integer, but requires

that the number of blocks is a power of two, and this power is identified using a bit mask

Page 35: Classless and Subnet Address Extensions (CIDR)

CIDR

• Example:– An organization is assigned a block of 2048

contiguous addresses, beginning at 128.211.168.0

– lowest: 128.211.168.010000000 11010011 10100000 00000000

– highest: 128.211.175.25510000000 11010011 10101111 11111111

Page 36: Classless and Subnet Address Extensions (CIDR)

CIDR

• CIDR requires 2 things:– The lowest address in the block– A 32-bit mask which shows where the division

between prefix and suffix occurs– 11111111 11111111 11111000 00000000

after the 21st bit in this case

Page 37: Classless and Subnet Address Extensions (CIDR)

CIDR Notation

• A shorthand way of representing the address and the mask length is also called slash notation

• The block of addresses is indicated by the first address followed by a decimal indicating the bit position 21128.211.168.0/21– See figure 10.11 for CIDR prefixes

Page 38: Classless and Subnet Address Extensions (CIDR)

CIDR Example

• Work problem in Section 10.21

Page 39: Classless and Subnet Address Extensions (CIDR)

Summary

• Techniques have been invented to conserve IP addresses:– Extend the address space of a single network to include

hosts on an attached local network– A router answers ARP requests for hosts– Share one IP network address among several networks– Let a point-to-point connection be unnumbered– Allow division between prefix and suffix to occur

anywhere