Lecture 7: IP Addressing Scheme II Dr. Mohd Nazri Bin Mohd Warip High Performance Broadband Networks Research Group Embedded, Networks and Advanced Computing Research Cluster School of Computer and Communication Engineering Universiti Malaysia Perlis Session 2013/2014 Dr. Mohd Nazri Mohd Warip Lecture Outline Subnetting Design VLSM Design CIDR Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 2 Subnet Design Considerations The key criteria for deployment of an addressing plan: 1. How many total subnets does the organization need today? 2. How many total subnets will the organization need in the future? 3. How many hosts are on the organization’s largest subnet today? 4. How many hosts will there be on the organization’s largest subnet in the future? Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 3 Subnet Example 1 Given network address a.b.c.d/x and required n hosts number. Find number of q subnet? Steps to solved. − Defining the subnet mask / Extended prefix length. − Defining the subnet number. − The all-zeros (0s) subnet and all-ones (1s) subnet. − Defining host addresses for each subnet − Defining the broadcast address for each subnet. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 4 Subnet Example 1 An organization is assigned the network address 193.1.1.0/24 and it needs to defined six subnets. The largest subnet is required to support 25 hosts. − Defining the subnet mask / Extended prefix length. − Defining the subnet number. − The all-zeros (0s) subnet and all-ones (1s) subnet. − Defining host addresses for each subnet − Defining the broadcast address for each subnet. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 5 Subnet Example 1 (Solution) Defining the subnet mask / Extended prefix length − Determine the number bit required: 6 subnets. − 23=8 and 3 bits are required to enumerate the 8 subnets in the block and have 2 unused subnets reserved for future growth. − The organization is subnetting a /24 and extended network prefix becomes /27 = 255.255.255.224. Network Host Number bits Network Prefix 193.1.1.0/24 11000001 .00000001 .00000001 .00000000 255.255.255.224 11111111 .11111111 .11111111 .11100000 Extended Network Prefix Tx Dr. Mohd Nazri Mohd Warip Subnet Number bits November 2013 / EKT 544 Lecture 7 Rx 6 Subnet Example 1 (Solution) Defining the subnet Numbers − The 8 subnets:0 (001), 1 (001), 2 (010), 3 (011), 4 (100), 5 (101), 6 (110), and 7 (111) but required subnet #6 (110) 11000001 00000001 00000001 00000000 193.1.1.0/24 Subnet #0 11000001 .00000001 .00000001 .00000000 193.1.1.0/27 Subnet #1 11000001 .00000001 .00000001 .00100000 193.1.1.32/27 Subnet #2 11000001 .00000001 .00000001 .01000000 193.1.1.64/27 Subnet #3 11000001 .00000001 .00000001 .01100000 193.1.1.96/27 Subnet #4 11000001 .00000001 .00000001 .10000000 193.1.1.128/27 Subnet #5 11000001 .00000001 .00000001 .10100000 193.1.1.160/27 Subnet #6 11000001 .00000001 .00000001 .11000000 193.1.1.192/27 Subnet #7 11000001 .00000001 .00000001 .11100000 193.1.1.224/27 Tx Extended Network Prefix Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Subnet Number bits Base Net Rx Host Number 7 Subnet Example 1 (Solution) The All-0s Subnet and All-1s Subnet Subnet Route 193.1.1.0/27 Network Route 193.1.1.0/24 11000001 .00000001 .00000001 .00000000 27-bit prefix 11000001 .00000001 .00000001 .00000000 .00000001 .00000001 .11111111 27-bit prefix 11000001 .00000001 .00000001 .11111111 All-0s Subnet − The All-0s subnet (default route) and All-1 Subnet Route 193.1.1.255/27 Network Route 193.1.1.255/24 Tx Dr. Mohd Nazri Mohd Warip 11000001 24-bit prefix November 2013 / EKT 544 Lecture 7 Rx 8 All-1s Subnet 24-bit prefix Subnet Example 1 (Solution) Defining host address for each subnet − The All-0s subnet (base network/subnetwork) and All-1s host number (broadcast address / subnetwork). 25 – 2 = 30 hosts. 11000001 .00000001 .00000001 .01000000 193.1.1.64/27 Host #1 11000001 .00000001 .00000001 .01000001 193.1.1.65/27 Host #2 11000001 .00000001 .00000001 .01000010 193.1.1.66/27 Host #3 11000001 .00000001 .00000001 .01000011 Host #4 11000001 .00000001 .00000001 .01000100 : : 193.1.1.67/27 193.1.1.68/27 Host #15 : : Extended Network Prefix 11000001 .00000001 .00000001 .01001111 : : : Host #29 11000001 .00000001 .00000001 .01011101 193.1.1.93/27 Tx 11000001 .00000001 .00000001 .01011110 193.1.1.94/27 Host #30 Dr. Mohd Nazri Mohd Warip : Network Prefix : Extended November 2013 / EKT 544 Lecture 7 : Host Number Bit Subnet #2 : 193.1.1.79/27 : Rx 9 Subnet Example 1 (Solution) Defining host address for each subnet − The valid host address for subnet #6. The 5-bit host number field: 25 – 2 = 30 hosts. 11000001 .00000001 .00000001 .11000000 193.1.1.192/27 Host #1 11000001 .00000001 .00000001 .11000001 193.1.1.193/27 Host #2 11000001 .00000001 .00000001 .11000010 193.1.1.194/27 Host #3 11000001 .00000001 .00000001 .11000011 Host #4 11000001 .00000001 .00000001 .11000100 : : 193.1.1.195/27 193.1.1.196/27 Host #15 : : Extended Network Prefix 11000001 .00000001 .00000001 .11001111 : : : Host #29 11000001 .00000001 .00000001 .11011101 193.1.1.221/27 Tx 11000001 .00000001 .00000001 .11011110 193.1.1.222/27 Host #30 Dr. Mohd Nazri Mohd Warip : Network Prefix : Extended November 2013 / EKT 544 Lecture 7 : Host Number Bit Subnet #6 : 193.1.1.207/27 : Rx 10 Subnet Example 1 (Solution) Defining the Broadcast Address for Each Subnet − The broadcast address for Subnet #n is one less than the base address for Subnet #(n + 1) Broadcast Address for Subnet #2 is all-1s host address 11000001 00000001 00000001 01011111 =193.1.1.95 Extended Network Prefix Broadcast Address for Subnet #6 is all-1s host address 11000001 00000001 00000001 11011111 Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 =193.1.1.223 Rx 11 Subnet Example 2 Given network address a.b.c.d/x. Find n hosts on each subnet? Steps to solved. − Defining the subnet mask / Extended prefix length. − Defining each of the subnet numbers. − Defining host addresses for each subnet. − Defining the broadcast address for each subnet. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 12 Subnet Example 2 An organization is assigned the network number 140.25.0.0/16 and it must create a set of subnets that supports up to 60 hosts on each subnet. Steps to solved. − Defining the subnet mask / Extended prefix length. − Defining each of the subnet numbers. − Defining host addresses for each subnet. − Defining the broadcast address for each subnet. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 13 Subnet Example 2 (Solution) Defining the subnet mask / Extended prefix length − Determine the number bit required for 60 hosts on each subnets: 27 – 2 = 126 hosts → 7 bits in the host number field − The organization is subnetting a /16 and extended network prefix becomes /25 = 255.255.255.128. − 9 bits subnet number field. 29 = 512 subnets Network Host Number bits Network Prefix 140.25.0.0/16 10001100 .00011001 .00000000 .00000000 255.255.255.128 11111111 .11111111 .11111111 .10000000 Tx Dr. Mohd Nazri Mohd Warip Extended Network Prefix (25-bit) Subnet Number bits November 2013 / EKT 544 Lecture 7 Rx 14 Subnet Example 2 (Solution) Defining Each of the Subnet Numbers − The 512 subnets will be numbered 0 through 511. The 9-bit binary are: 0(0000000002), 1 (0000000012), 3 (0000000112),….., 511 (1111111112) 10001100 00011001 00000000 00000000 140.25.0.0/16 Subnet #0 10001100 00011001 .00000000 .00000000 140.25.0.0/25 Subnet #1 10001100 00011001 .00000000 .10000000 140.25.0.128/25 Subnet #2 10001100 00011001 .00000001 .00000000 140.25.1.0/25 Subnet #3 10001100 00011001 .00000001 .10000000 140.25.1.128/25 Subnet #4 10001100 00011001 .00000010 .00000000 140.25.2.0/25 Subnet #5 10001100 00011001 .00000010 .10000000 140.25.2.128/25 Subnet #510 10001100 00011001 .11111111 .00000000 140.25.255.0/25 Subnet #511 10001100 .10000000 Host Number 140.25.255.128/ 25 Tx Tx 00011001 Dr. Mohd Nazri Mohd Warip Extended .11111111 November 2013 / EKT 544 Lecture 7 Network Prefix Subnet Number bits Base Net Rx 15 Subnet Example 2 (Solution) Defining host address for each subnet − The valid host address for subnet #3. The 7-bit host number field: 27 – 2 = 126 hosts. 10001100 .00011001 .00000001 .10000000 140.25.1.128/25 Host #1 10001100 .00011001 .00000001 .10000001 140.25.1.129/25 Host #2 10001100 .00011001 .00000001 .10000010 140.25.1.130/25 Host #3 10001100 .00011001 .00000001 .10000011 Host #4 10001100 .00011001 .00000001 .10000100 : : 140.25.1.131/25 140.25.1.132/25 Host #62 : : Extended Network Prefix 10001100 .00011001 .00000001 .10111110 : : : Host #125 10001100 .00011001 .00000001 .11111101 140.25.1.253/25 10001100 .00011001 .00000001 .11111110 140.25.1.254/25 Tx Host #126 Dr. Mohd Nazri Mohd Warip : Network Prefix : Extended November 2013 / EKT 544 Lecture 7 : Host Number Bit Subnet #3 : 140.25.1.190/25 : Rx 16 Subnet Example 2 (Solution) Defining the Broadcast Address for Each Subnet − The broadcast address for Subnet #3 is one less than the base for Subnet #4 (140.25.2.0). − The broadcast address for Subnet #n is one less than the base address for Subnet #(n + 1) Broadcast Address for Subnet #3 is all-1s host address 10001100 00011001 00000001 11111111 =140.25.1.255 Extended Network Prefix Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 17 Address Assignment and Summarization Definition Description FLSM (Fixed) A single subnet mask for the entire IP network number. VLSM (Variable) Permits the use of different subnet masks for a network number. Summarization Routing protocols can aggregate subnet routes into one larger route. CIDR (Classless) Implemented in BGP4 to aggregate network routes into a continuous block of address space that is advertised to the rest of the internet; decreases the number of BGP routes to advertise. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 18 VLSM Variable Length Subnet Masks (VLSM): the process of subnetting a subnet to fit your needs. VLSM helps optimize available address space and specify a different subnet mask for the same network number on various subnet. VLSM further subdivide a network to prevent the wasting of IP addresses. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 19 VLSM Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 20 VLSM Classful routing. − only allows for one subnet mask for all networks VLSM and classless routing − This is the process of subnetting a subnet − More than one subnet mask can be used − More efficient use of IP addresses as compared to classful IP addressing Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 21 VLSM Design Considerations The key criteria for deployment of VLSM design. The same set of design decisions must be made at each level of the hierarchy: 1. How many total subnets does this level need today? 2. How many total subnets will this level need in the future? 3. How many hosts are on this level’s largest subnet today? 4. How many hosts will be on this level’s largest subnet be in the future? Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 22 When to Use VLSM? Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 23 A Waste of IP Address Allocation Wasting Host Addresses on WAN Connections Consider class C address 192.168.187.0/27 network Subnet Host 3 bits for subnet = 8 - 1 5 bits for hosts 7 useable subnets 30 hosts per subnet But we don’t want to waste 3 x 30 host subnets on the WAN connections so we subnet one of the subnets Must therefore have VLSM enabled routers Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 24 Using VLSM for WAN Connections Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 25 Subnetting details Tx Subnet 6 (/27) further subnetted with mask of /30 to provide 8 subnets in total with 4 hosts per subnet (2 bits). Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 26 VLSM Example Given network address a.b.c.d/i. Find VLSM Steps to solved. − Define the i subnets of a.b.c.d/i. − Define the host addresses for subnet #p (a.b.e.d/j). − Define the sub-subnets for subnet #q (a.b.f.d/j). − Define host addresses for subnet #q - #p (a.b.g.d/k). − Define the sub-subnet for subnet #q - #q (a.b.h.d/k). − Define host addresses for subnet #q - #q - #r (a.b.h.r/l) Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 27 Classless Inter-Domain Routing CIDR allows routing protocols to summarize multiple networks, a block of addresses, as a single route. CIDR deals with Routing Table Explosion Problem − Networks represented by prefix and mask − Pre-CIDR: Network with range of 16 contiguous class C blocks requires 16 entries − Post-CIDR: Network with range of 16 contiguous class C blocks requires 1 entry Solution: Route according to prefix of address, not class Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 28 CIDR Allocation Principles (RFC1518-1520) IP address assignment reflects physical topology of network. Network topology follows continental/national boundaries − IP addresses should be assigned on this basis Transit routing domains (TRDs) have unique IP prefix − carry traffic between routing domains − interconnected non-hierarchically, cross national boundaries − Most routing domains single-homed: attached to a single TRD − Such domains assigned addresses with TRD's IP prefix − All of the addresses attached to a TRD aggregated into 1table entry Implementation primarily through BGPv4 (RFC 1520) Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 29 CIDR and VLSM Can only subnet a subnet that is empty Classless InterDomain Routing (CIDR) and VLSM not only prevents address waste, but also promotes route aggregation (OR summarization). Classless routing protocols carry a prefix that consists of 32-bit IP address and bit mask in the routing updates Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 30 CIDR and Route Summarization CIDR = Route Summarization A supernet summarizes multiple network addresses with a mask less than the classful mask. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 31 CIDR and Route Summarization 192.168.0.0/23, 192.168.2.0/23, 192.168.4.0/22, and 192.168.8.0/21 are all subnets of 192.168.0.0/20 Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 32 CIDR and Route Summarization Propagating VLSM and supernet routes requires a classless routing protocol, because the subnet mask can no longer be determined by the value of the first octet. Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 33 Longest Prefix Match CIDR impacts routing & forwarding Routing tables and routing protocols must carry IP address and mask Multiple entries may match a given IP destination address Example: Routing table may contain − 205.100.0.0/22 which corresponds to a given supernet − 205.100.0.0/20 which results from aggregation of a larger number of destinations into a supernet − Packet must be routed using the more specific route, that is, the longest prefix match Several fast longest-prefix matching algorithms are available Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 34 IP Routing Protocols IP routing protocols are characterized by: − Classful or classless IP addressing/routing − Static and dynamic routing (distance vector and link state) − routing metrics − Variable-Length Subnet Mask (VLSM) to conserve and use efficiently the total IP addresses allocation − route summarization across network boundaries − timers Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 35 IP Routing Protocols IP routing provides a mechanism to route packets from different network addresses classified as an inter-domain or Interior Gateway Protocol (IGP) and intra-domain or Exterior Gateway Protocol (EGP) routing protocols. IGP is designed to distribute routing information within an Autonomous System (AS) and uses the IP address to establish the route, such as Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), and Open Shortest Path First (OSPF). EGP is also used to exchange routing information among different Autonomous Systems (ASs) and depends on an AS number to construct paths, for example, Border Gateway Protocol (BGP). Tx Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 Rx 36 References Kurose, J. F. and Ross, K. W., “Computer Networking A Top-Down Approach”, 6th. Edition, Pearson, 2012. ISBN: 9780273768968 Alberto Leon-Garcia and Indra Widjaja., “Communication Networks: Fundamental Concepts and Key Architectures”, 2nd. Edition, McGraw Hill, 2006. Tanenbaum, A. S., “Computer Network”, 5th Edition. Prentice-Hall, 2011. William Stallings, Data & Computer Communications, 8th. Edition, Prentice Hall, 2009. Cisco Systems, http://www.cisco.com Dr. Mohd Nazri Mohd Warip November 2013 / EKT 544 Lecture 7 37