Supernetting/Classless InterDomain Routing Lecture Organization In this lecture, we will discuss two important IP addressing techniques that aim to conserve IP address space and reduce the size of Internet Routing tables. ◦ We will first discuss Supernetting (a technique now obsolete) ◦ We shall conclude with an elaborate discussion on CIDR. SUPERNETTING Supernetting (RFC 1338) Class A and B addresses are almost depleted. However, class C addresses are still available But, the size of class block, 256, is too small ◦ Solution: Supernetting Supernetting is the concept of taking two or more numerically contiguous (Class C) network address blocks and consolidating them into a single, larger network address. Several class C networks are combined to create a supernet. ◦ Logical and physical consolidation of networks. ◦ Supernetting would also let you advertise just one network block Organization can apply for a set of class C address blocks instead of just one. Organization can then use these addresses in one supernetwork: Physical consolidation of networks Rajan Shankaran 4 A Supernetwork Rajan Shankaran 5 Assigning Class C addresses under Supernetting Random assignment ◦ Routers treat each block separately. ◦ N entries in routing table for N blocks. ◦ All N addresses belong to one organization. Assigning on a set of rules ◦ Making a superblock out of all the assigned blocks. ◦ Routing table then has a single entry. Rajan Shankaran 6 Supernetting Rules Rule #1: The number of blocks (Class C network addresses) must be a power of 2. (1, 2, 4, 8, 16…) Rule #2: The blocks must be contiguous (numbering in the third octet) in the address space. (no gaps between the blocks) Rule #3: The third byte of the first address of the superblock must be evenly divisible by the number of blocks. ◦ Example: If number of blocks is N, the third byte must be divisible by N. Rule #4: Single interface condition Rajan Shankaran 7 Example A company needs 600 addresses. Which of the following set of class C address blocks can be used to form a Supernet for this company? a. 198.47.32.0 b. 198.47.32.0 c. 198.47.31.0 d. 198.47.32.0 198.47.33.0 198.47.42.0 198.47.32.0 198.47.33.0 198.47.34.0 198.47.52.0 198.47.33.0 198.47.34.0 198.47.62.0 198.47.52.0 198.47.35.0 a: No, there are only three blocks. b: No, the blocks are not contiguous. c: No, 31 in the first block is not divisible by 4. d:Yes, all three requirements are fulfilled. Rajan Shankaran 8 Supernet Mask For A, B, C addresses the first address in the block and the mask define the block (range of addresses). For subnets, the first address in the subnet and the subnet mask completely define the subblock (the range of addresses). In case of Supernet, the first address in the block and the Supernet mask completely defines the block. Supernet is the reverse of subnet ◦ Subnet: more 1s than default. ◦ Supernet: Less 1s than default. Rajan Shankaran 9 Example We need to make a supernetwork out of 16 class C addresses (sometimes called )blocks. What is the supernet mask? We have 16 addresses/blocks. Default subnet mask: 255.255.255.0= 11111111 11111111 11111111 00000000 For 16 addresses we need to change four least significant bits in the 3rd octet to 0s in the default mask. So the mask is 11111111 11111111 11110000 00000000 or 255.255.240.0 Rajan Shankaran 10 Example A Supernet has a first address of 205.16.32.0 and a Supernet mask of 255.255.248.0. How many blocks are in this Supernet and what is the range of addresses? The Supernet has 21 1s. The default mask has 24 1s. Since the difference is 3, there are 23 or 8 blocks in this Supernet. The blocks are 205.16.32.0 to 205.16.39.0. The first address is 205.16.32.0. The last address is 205.16.39.255. Rajan Shankaran 11 Example An organization requires 2000 addresses to cater to a large multimedia laboratory. Suggest a suitable Supernetting scheme to cater to this requirement. Step 1: Determine the size of Supernet Block. Each Class C address provides 256 addresses. Use eight Class C networks, or CIDR /21, to give us 2,048 possible addresses: Step 2: Eight Class C addresses provide 2048 addresses: Actual number of host addresses obtained is 2046 (cannot use the first and the last address ) Step 3: Select a starting address that fulfils all Supernetting rules: The starting address chosen is 192.168.16.0 (satisfies the rules of Supernet) Starting with 192.168.16.0, all "connected" networks must be consecutive in the numbering of the third octet. Refer to the table in the next slide. Rajan Shankaran 12 Supernetting Plan for the organization Network Available Addresses Usage Circumstances 192.168.16.0 1-255 First address not available 192.168.17.0 0-255 All addresses in range available 192.168.18.0 0-255 All addresses in range available 192.168.19.0 0-255 All addresses in range available 192.168.20.0 0-255 All addresses in range available 192.168.21.0 0-255 All addresses in range available 192.168.22.0 0-255 All addresses in range available 192.168.23.0 0-254 Last address not available Note: A peculiar way of using addresses. Why? Rajan Shankaran 13 Classless Inter-Domain Routing Classless Inter-Domain Routing (CIDR) (RFC 1518/RFC 4632) A new addressing scheme which allows for more efficient allocation of IP addresses than the old Class A, B, and C address scheme. ◦ CIDR and Supernetting standards developed independently- Not related. Used Synonymously with Route Summarization (aggregation) and Variable Length Subnet Mask (VLSM) but its different CIDR itself refers to the administrative assignment of large address blocks and the related summarized routes for the purpose of reducing the size of the routing tables. Rajan Shankaran 15 CIDR Need for CIDR Running out of IP addresses Running out of capacity in the global routing tables How Were These Problems Solved? ◦ Restructuring IP address assignments to increase efficiency ◦ Hierarchical routing aggregation to minimize route table entries Rajan Shankaran 16 CIDR Procedure Administrative Technical Rajan Shankaran 17 CIDR Procedure CIDR Procedure Administrative: A hierarchy of ISPs where larger ISPs control large blocks of addresses and assign smaller blocks to smaller ISPs and customers. The Internet Assigned Numbers Authority (IANA) issues to regional Internet registries (RIRs) large, short-prefix CIDR blocks. For example, 62.0.0.0/8 (with over sixteen million addresses) is administered by RIPE NCC, the European RIR. The RIRs, each responsible for a single, large, geographic area, such as Europe or North America, subdivide these blocks and allocate subnets to local Internet registries (LIRs). Similar subdividing may be repeated several times at lower levels of delegation. Rajan Shankaran 18 CIDR Procedure Technical: It involves the process of route summarization/aggregation as well as creating variable length subnetting blocks. ◦ Route summarization (also called route aggregation) can reduce the number of routes that a router must maintain, because it is a method of representing a series of network numbers in a single summary address. Rajan Shankaran 19 Figure: Hierarchical routing with ISPs Restructuring IP Address Assignments Standard subnetting procedure was used by the main ISP to create smaller blocks. To begin with this ISP was assigned a mask of /20 Furthermore, Instead of being limited to network identifiers (or "prefixes") of 8, 16 or 24 bits, The ISP used a mask (prefix length ) of its choice. To create sub blocks. CIDR currently normally uses prefixes anywhere from 13 to 27 bits. Thus, blocks of addresses can be assigned to networks as small as 32 hosts or to those with over 500,000 hosts. CIDR address includes the standard 32-bit IP address and also information on how many bits are used for the network prefix. For example, in the CIDR address 206.13.01.48/25, the "/25" indicates the first 25 bits are used to identify the unique network leaving the remaining bits to identify the specific host. Note: n= prefix length, 32-n = suffix length Rajan Shankaran 21 Block allocation CIDR Rules Rule #1: Number of addresses in a block must be a power of 2. Rule #2: The beginning address of a block must be evenly divisible by the number of addresses. Rule #3: Addresses must be contiguous. Rajan Shankaran 22 What is a block? Block Size: In CIDR notation, the "block" refers to the number of host addresses available within a network defined by the CIDR mask. Calculation: The block size is calculated as 2^(32-n) for IPv4, where n is the prefix length (the number after the slash in CIDR notation). Example: In a /24 network, there are 2^(3224) = 2^8 = 256 total addresses. In other words, a /24 network (block) contains 256 addresses. CIDR: Rule#2 Rule#3: First IP Address of the block must be divisible by the size of the block. If any binary pattern consisting of (m + n) bits is divided by 2n, then• Remainder is least significant n bits • Quotient is most significant m bits So, any binary pattern is divisible by 2n, if and only if its least significant n bits are 0. Example Consider a binary pattern01100100.00000001.00000010.01000000 (represented as 100.1.2.64) • It is divisible by 25 since its least significant 5 bits are zero. • It is divisible by 26 since its least significant 6 bits are zero. • It is not divisible by 27 since its least significant 7 bits are not zero. CIDR Rules Rule 2 Example: Let's consider a /29 CIDR block, which has 8 addresses (2^3 = 8). Let's look at two potential starting addresses: 1. Valid starting address: 192.168.1.8 Binary: 11000000.10101000.00000001.00001000 2. Invalid starting address: 192.168.1.10 Binary: 11000000.10101000.00000001.00001010 Analysis: For 192.168.1.8: Last 3 bits: 000 This address is valid because the last 3 bits are all zeros, making it divisible by 8. For 192.168.1.10: Last 3 bits: 010 This address is invalid because the last 3 bits are not all zeros, making it not divisible by 8. Example Which of the following can be the beginning address of a block that contains 16 addresses? 205.16.37.32 190.16.42.44 17.17.33.80 123.45.24.52 Rajan Shankaran 26 Example Which of the following can be the beginning address of a block that contains 16 addresses? 205.16.37.32 190.16.42.44 ANS: Option 1 fulfills both the requirements and therefore can serve as the beginning address of the block. Rajan Shankaran 27 Example Organization has a block with beginning address and prefix length: 205.16.37.24/29. ◦ What is the range of addresses contained in the block (BLOCK SIZE)? ◦ What is the last address in the block? ANS To find the last address: keep first 29 bits and change the remaining bits to all 1s: 111 There are only 8 addresses in the block. Last address; 205.16.37.31. Rajan Shankaran 28 Creating sub-blocks using subnetting The number of addresses in the subblock should be a power of 2. The prefix length (mask) for each subnetwork should be found using the following formula: nsub= n +log2(N/Nsub) Where: nsub= subnetwork mask n: original mask N: number of addresses granted to the organization Nsub: assigned number of addresses to each subnetwork Rajan Shankaran 29 Exercise An organization is granted the block 130.34.12.64/26. The organization needs four subnetworks, each with an equal number of hosts. Design the subnetworks and find the information about each network. Solution The number of addresses for the whole network can be found as N = 232 − 26 = 64. The first address in the network is 130.34.12.64/26 and the last address is 130.34.12.127/26.We now design the subnetworks: 1. We grant 16 addresses for each subnetwork to meet the first requirement (64/16 is a power of 2). 2. The subnetwork mask for each subnetwork is: Rajan Shankaran 30 Address Aggregation The CIDR addressing scheme also enables "route aggregation" in which a single high-level route entry can represent many lower-level routes in the global routing tables. ICANN assigns a block of addresses to an ISP. Each ISP in turn, divides its assigned block into smaller sub blocks and grants the sub-blocks to its customers. Many blocks of addresses aggregated in one block and granted to one ISP. Rajan Shankaran 31 Address Aggregation- Example Top Level Address : 140.24.7.0/24 Rajan Shankaran 32 Route Aggregation/Summarization: Procedure Step 1: Write down the binary version of each component subnet, one on top of another. Step 2: Inspect the binary values to find how many consecutive bits have the exact same value in all component subnets. That number of bits is the prefix length. Step 3: Write a new 32-bit number at the bottom of the list by copying y bits from the previous number, y being the prefix length. Write binary 0s for remaining bits. Step 4: Convert the bits to decimal. Rajan Shankaran 33 Example An organization is assigned the following 4 sub blocks: 100.16.0.0 /16, 100.17.0.0 /16, 100.18.0.0 /16, and 100.19.0.0 /16. Find the summarized address. ◦ 100 16 = 01100100 00010000 ◦ 100 17 = 01100100 00010001 ◦ 100 18 = 01100100 00010010 ◦ 100 19 = 01100100 00010011 Interesting Octet: 3rd octet Mask: Common bits set to 1: 255.252.0.0 Number of common bits – mask Length. Summarized route: 100.16.0.0/14 Verification Rajan Shankaran 34 Another Example Summarize the network given below: 172.16.0.0/24 172.16.1.0/24 172.16.2.0/24 172.16.3.0/24 Solution The binary equivalents of the shown addresses are as follows: 3rd octet is the significant one, let's convert 3rd octet to binary. 172.16.0.0 = 172.16.000000 00.00000000 172.16.1.0 = 172.16.000000 01.00000000 172.16.2.0 = 172.16.000000 10.00000000 172.16.3.0 = 172.16.000000 11.00000000 Here the first 16 bits (172.16) are fixed, and the first 6 bits of the 3rd octet is identical. Now 22 bits are fixed represents the network portion and the remaining is 12 bits are our host portion. So, the summary address is 172.16.0.0/22. Verification Another Example Summarize the network given below: 172.31.20.0/24 172.31.21.0/24 172.31.22.0/24 172.31.23.0/24 172.31.24.0/24 Solution The binary equivalents of the shown addresses are as follows: 3rd octet is the significant one: 172.31.20.0/24 10101100 00011111 0001 0100 00000000 172.31.21.0/24 10101100 00011111 0001 0101 00000000 172.31.22.0/24 10101100 00011111 0001 0110 00000000 172.31.23.0/24 10101100 00011111 0001 0111 00000000 172.31.24.0/24 10101100 00011111 0001 1011 00000000 172.31.16.0/20: Is this correct?? Previous Example Analysis What do you observe? Two types of summaries: Inclusive Summary Exclusive Summary Exercise Summarize the network given below: 192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 192.168.4.0/24 192.168.5.0/24 192.168.6.0/24 192.168.7.0/24 How about this crooked block? Can we summarise these addresses in a meaningful way? 192.168.1.160/30 192.168.1.164/29 192.168.1.172/29 192.168.1.180/30 Forwarding with Classless Addressing In classful addressing we can have a routing table with three columns; in classless addressing, we need at least four columns. Example Example; Show the forwarding process if the packet arrives at R1 with destination address 201.4.22.35 Routing table for router R1 Rajan Shankaran 40 Longest Prefix Matching Top Level Address : 140.24.7.0/24 What happens if Organization 4 can be no longer connected to R1? It moves under R4 under a different service Provider which is in charge of a different address block Rajan Shankaran 41 Longest Prefix Matching: Exception Route Rajan Shankaran 42 CIDR versus Variable Length Subnet Mask (VLSM) Similarities ◦ Recursive scheme to create smaller subnetworks. ◦ Extended Prefix support ◦ Longest prefix match forwarding algorithm. ◦ Topologically significant addresses for aggregation. Differences ◦ Recursion visibility ◦ Classful verses Classless Rajan Shankaran 43 CIDR versus Supernetting Supernetting was not introduced with CIDR. ◦ RFC 1338 (Supernetting) : a standalone strategy for improving the aggregatability of IP address blocks ◦ Introduced 15 months before CIDR ◦ CIDR made supernetting infinitely more useful. CIDR: Not a summarization of classful addresses(such as class C in Supernetting) ◦ Works on variable length blocks called network prefixes that can be carved out of any type of address space (A, B or C). When CIDR is deployed, there is no need for Supernetting. Furthermore, an organization can use subnetting in its allocated block of addresses. As an example, if the site prefix given to an organization is /17, the subnet prefix length can be 20 to create 8 subnets. (23) . Rajan Shankaran 44 CIDR versus Supernetting CIDR: An administrative procedure for arranging the Internet architecture in a hierarchy. Supernetting is simply a technical procedure for summarizing contiguous Class C addresses. Logical versus Physical consolidation. Rajan Shankaran 45 Address Aggregation