CSC521 Communication Protocols
Ch.9 Classless And Subnet Address Extensions (CIDR)
Outline
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Introduction Review Of Relevant Facts Minimizing Network Numbers Proxy ARP Subnet Addressing Flexibility In Subnet Address Assignment Variable-Length Subnets Implementation Of Subnets With Masks Subnet Mask Representation Forwarding In The Presence Of Subnets The Subnet Forwarding Algorithm A Unified Forwarding Algorithm Maintenance Of Subnet Masks 14. Broadcasting To Subnets 15. Anonymous Point-To-Point Networks 16. Classless Addressing And Supernetting 17. CIDR Address Blocks And Bit Masks 18. Address Blocks And CIDR Notation 19. A Classless Addressing Example 20. Data Structures And Algorithms For Classless Lookup 21. Longest-Match And Mixtures Of Route Types 22. CIDR Blocks Reserved For Private Networks 23. Summary
2
Recall: Classful Addressing
In the original IP addressing scheme: network prefix + host suffix
each physical network is assigned a unique network address each host on a network has the network address as a prefix of the host's individual address Routers only examine prefix (small routing tables)
Network-prefix Minimization Problem
Question: How can we minimize the number of assigned network prefixes (especially class B) without abandoning the 32-bit addressing scheme? Two Answers:
Proxy ARP Subnet addressing
Proxy ARP: Layer-2 Solution
Arrange special system to answer ARP requests and forward datagrams between networks
Hosts think they are on same network Allow two physical networks to share a single IP prefix Known informally as the ARP hack
Assessments
Chief advantages
Transparent to hosts No change in IP routing tables
Chief disadvantages
Does not generalize to complex topology Only works on networks that use ARP Most proxy ARP systems require manual configuration
Subnet Addressing
Subdivides the host suffix into a pair of fields for physical network and host
Allows an organization to use a single network prefix for multiple physical networks Interpreted only by routers and hosts at the site; treated like normal address elsewhere
Both physical networks share prefix 128.10 Router R uses third octet of address to choose physical net Address Mask: Each physical network is assigned 32-bit address mask (also called subnet mask)
Use of Address Masks
Each entry in routing table also has address mask
All-1s mask used for host-specific routes Network mask used for network-specific routes Subnet mask used for subnet-specific routes All-0s mask used for default route
Interface Metric [Link] 20 (Default) [Link] 1 (Loopback) [Link] 20 (Local) [Link] 20 (LAN) [Link] 20 (Broadcast)
Active Routes: Network Destination Netmask Gateway [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]
Network Addressing Problems
Problems
Continued exponential Internet growth
Dire prediction (1993): We will exhaust the address space ''in a few years''. Note: address space is not near exhaustion
Subnetting insufficient Limited IP addresses (esp. Class B)
Further Motivation For CIDR: aggregating class C
Limitation of classful addressing
Fewer than seventeen thousand Class B numbers (total 214) More than two million Class C network numbers (221)
Flexibility of CIDR
Merging 256 Class C numbers into a single prefix that is equivalent to Class B Splitting a Class B along power of two boundaries
Solution to problem
Temporary fix until next generation of IP Backward compatible with classful addressing
8
Classless Inter-Domain Routing (CIDR)
CIDR Idea:
permit arbitrary-length network prefixes
CIDR Techniques:
Extended Addressing: subnet + supernet
blocks of address numbers
Forwarding (longest-prefix matching) Route propagation (condensation)
CIDR was predicted to work ''for a few years''
Extremely successful! Will work for at least 25 years!
Supernetting
Supernetting: assigning a block of contiguous class C numbers Route Proliferation
Example: a block of 256 contiguous class C numbers (equal to a class B)
supernetting: single CIDR prefix spans 256 Class C network numbers Classful routing table requires 256 separate entries for each class C
If classful forwarding used, CIDR addresses result in more routes
10
CIDR Block and Slash Notation
[Link]/21
Network Addresses written NUMBER / m
NUMBER is IP prefix; m is ''address mask'' length Example
[Link] / 20
Prefix occupies 20 bits Suffix occupies 12 bits
Mask values must be converted to dotted decimal when configuring a router (and binary internally)
11
Dotted Decimal Equivalents
Example of / 30 block: [Link]/30
useful when customer of ISP has very small network
12
CIDR Forwarding
Implementation Of CIDR Route Lookup
Each entry in routing table has address plus mask Search is organized from most-specific to least-specific (i.e., entry with longest mask is tested first) Known as longest-prefix lookup or longest-prefix search
Implementing Longest-Prefix Matching
Cannot easily use hashing Data structure of choice is binary trie Identifies unique prefix needed to match route
Example of Unique Prefixes
13
Route Propagation
Route Exchange: route per CIDR block
Store address mask with each route Send pair of (address, mask) whenever exchanging routing information
Route Condensation (Aggregation)
Multiple subnets of common prefixes are aggregated into a larger subnet Examples: [Link]/24
Dept. Office Prof's Offices Computer Room 4F (Labs) [Link] [Link] [Link] [Link] - [Link] - [Link] - [Link] - [Link]
How to divide [Link]/24 into two subnets of equal size?
Ans. [Link]/25 and [Link]/25
14
Summary
Two extensions to original classful IP addressing scheme
Subnet addressing CIDR addressing
Both use 32-bit address mask
Subnetting used only within a site CIDR used CIDR mask identifies division between network prefix and host suffix Subnet mask identifies boundary between subnet and individual host
CIDR Techniques Extended Addressing: subnet + supernet
blocks of address numbers
Forwarding (longest-prefix matching) Route propagation (condensation)
15