Classless and Subnet Address Extensions (CIDR)
Click here to load reader
description
Transcript of Classless and Subnet Address Extensions (CIDR)
![Page 1: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/1.jpg)
Classless and Subnet Address Extensions (CIDR)
• Topics:– There are problems with the IP addressing
scheme we’ve studied– We’ll study some ways to get around these
problems
![Page 2: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/2.jpg)
Review: IP Addresses
![Page 3: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/3.jpg)
Problems with IP Addresses
• The designers of IP addresses did not foresee the Internet’s tremendous growth– Higher overhead to manage network addresses– Larger routing tables– IP addresses might one day be exhausted
![Page 4: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/4.jpg)
Solution to IP Addresses Problems
• The same IP network prefix can be shared by multiple physical networks
• A site can choose to assign and use IP addresses in unusual ways internally as long as:– All hosts and routers at the site honor the site’s
addressing scheme
– The site’s addressing scheme is transparent to other sites on the internet
![Page 5: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/5.jpg)
Strategy 1: Transparent Routers
• A network with a class A IP address can be extended:
T
H1
H2
H3
H4
10.0.0.0
![Page 6: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/6.jpg)
Transparent Routers (cont)
• Hosts on LAN are assigned IP addresses as if they were on WAN
• LAN does not need its own network prefix
• Traffic for hosts on LAN is multiplexed through T
• Other hosts and routers on the WAN do not know T exists
![Page 7: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/7.jpg)
Transparent Routers
• Advantages– Require fewer network addresses (LAN doesn’t
need a separate network prefix)– Load balancing
• Disadvantages– Require a large address space– Do not provide all the services of standard
routers
![Page 8: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/8.jpg)
Strategy 2: Proxy ARP
• Using ARP, map a single network prefix into two physical addresses
RRouter running proxy ARP
Main network
Hidden network
H1 H2 H3
H4 H5 H6
![Page 9: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/9.jpg)
Proxy ARP (cont)
• Gives the illusion that all hosts are on the same physical network
• Router R answers ARP requests on each network for hosts on the other
• R answers ARPs with its own hardware address (it lies)
• When R receives a datagram it forwards it to the correct physical address
![Page 10: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/10.jpg)
Proxy ARP
• Advantages– Require fewer network addresses– Only the router running proxy ARP needs to
know what’s going on
• Disadvantages– Can only be used if the network uses ARP for
address resolution– Allows spoofing
![Page 11: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/11.jpg)
Strategy 3: Subnet Addressing
• Hierarchical addressing
R
H1Rest of
the internet
All traffic to
128.10.0.0
Network 128.10.1.0
Network 128.10.2.0
H2
H3 H4
128.10.1.1 128.10.1.2
128.10.2.1 128.10.2.2
![Page 12: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/12.jpg)
Subnet Addressing (cont)
• R receives all traffic for network 128.10.0.0
• R routes the datagram to a physical network based on bits in the hostid field of the IP address
• Another level has been added to the addressing hierarchy
![Page 13: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/13.jpg)
Subnet Addressing (cont)
• Regular (Class B) IP address:
• New interpretation (locally only):
0 8 16 24 311 0 netid hostid
0 8 16 24 311 0 netid subnet hostid
![Page 14: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/14.jpg)
Subnet Addressing (cont)
• Advantages– Minimizes network address usage– Accommodates growth
• Disadvantages– Added layer of complexity– Difficult to change once hierarchy is
established
![Page 15: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/15.jpg)
Subnet Addressing (cont)
• Flexible
Allows 256 physical networks with 256 hosts each
Allows 8 physical networks with 8192 hosts each
0 8 16 24 311 0 netid subnet hostid
0 8 16 19 311 0 netid sub hostid
![Page 16: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/16.jpg)
Subnet Masks
• 32 bits – 1 if the bit is part of the network address– 0 if the bit is part of the host address
• Example - a class B network:
• Subnet mask: – 11111111 11111111 11111111 00000000
0 8 16 24 311 0 netid subnet hostid
![Page 17: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/17.jpg)
Subnet Masks
• Subnet bits do not have to be contiguous:– Mask = 11111111 11111111 00001010 10000000
= subnet id
= host id
0 8 16 24 311 0 netid
![Page 18: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/18.jpg)
Representing Subnet Masks in Dotted Decimal Notation
• Example - a class B network:
• Subnet mask: – 11111111 11111111 11111111 00000000
• Dotted Decimal:– 255.255.255.0
0 8 16 24 311 0 netid subnet hostid
![Page 19: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/19.jpg)
Representing Subnet Masks in 3-tuple Notation
• Subnet mask: – 11111111 11111111 11111111 00000000
• 3-tuple notation– {<netid>,<subnet id>,<hostid>}– -1 means “all ones”– {-1,-1,0}
![Page 20: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/20.jpg)
Routing in the Presence of Subnets
• All hosts and routers must use a subnet routing algorithm
R2R1 H
Net 3 (subnet of address N)Net 2 (subnet of address N)
Net 1 (not a subnet address)
![Page 21: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/21.jpg)
The Subnet Routing Algorithm
• Recall the standard routing table:– (netid, next hop)
• N = netid portion of IP address
• Compare N with netid
• Match = send datagram to next hop
• Routing when subnets are in use:– (subnet mask, netid, next hop)
• N = IP address & subnet mask
• Compare N with netid
• Match = send datagram to next hop
![Page 22: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/22.jpg)
Using Subnet Masks for Routing
• Host-specific routes– (20.0.0.3, 30.0.0.7)– (255.255.255.255 , 20.0.0.3 , 30.0.0.7)
• Default routes– (default, 40.0.0.8)– (0.0.0.0 , 0.0.0.0 , 40.0.0.8)
• Standard, non-subnet class B network – (128.0.0.0, 10.0.0.3)– (255.255.0.0 , 128.0.0.0 , 10.0.0.3)
![Page 23: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/23.jpg)
A Unified Routing Algorithm
Extract the destination IP address, D, from the datagram and compute the netid, N
If N matches any directly connected network address deliver the datagram directly over that network
elsefor each entry (M,N,NH) in the routing table {
I = M&Dif (I == N) then send datagram to NH}
if no matches were found declare a routing error
![Page 24: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/24.jpg)
Broadcasting to Subnets
• IP address = 128.0.255.255– Broadcast to all hosts on network 128
• What if network 128 has subnets?– Routers that interconnect the subnets must propagate
the datagram to all physical networks
– But the routers must take care not to route the datagrams in loops (reverse path forwarding)
• Can you broadcast to just one subnet?– Yes: {network, subnet, -1}
![Page 25: Classless and Subnet Address Extensions (CIDR)](https://reader037.fdocuments.in/reader037/viewer/2022100221/56814846550346895db55c61/html5/thumbnails/25.jpg)
Summary
• Problem: IP v4 addresses (especially class B) would be exhausted
• Solutions:– Subnet addressing - conserve network addresses by
using the same network address for multiple physical networks
– New version of IP (v6) with larger addresses– Supernet addressing - conserve class B network
addresses by allowing a single organization to use multiple class C network addresses