1 Introduction to Classless Routing CCNA 3/Module 1
2 Overview: Classful/Classless Routing Classful routing - a network must use the same subnet mask for the entire network Network IP Network Subnet Mask Classless routing – using more than one subnet mask for a network address “subnetting a subnet” Network IP Network Subnet Masks
3 Overview: (Classful) IPv4 Addressing Limits IPv4 – 20 years old IPv4 – even with subnetting, couldn’t handle the global demand for Internet connectivity Class B space was on the verge of depletion. Rapid and substantial increase in the size of the Internet's routing tables. As more Class C's came online, the flood of new network information threatened Internet routers' capability to cope.
4 Overview: (Classful) IPv4 Addressing Limits Provides IP scheme with limitations: Class A – 126 networks: 16,777,214 hosts each Class B – 65,000 networks: 65,534 hosts each Class C – 2 million networks: 254 hosts each While available addresses were running out, only 3% of assigned addresses were actually being used! Subnet zero, broadcast addresses, pool of unused addresses at Class A and B sites, etc.
5 Overview: Scalability & Routing Tables Maximum theoretical routing table size is 60,000 entries. Classful addressing would have hit this capacity by mid Internet growth would have ended.
What is VLSM and why is it used? The purpose of VLSM is to alleviate the shortage of IP addresses VLSM allows: More than one subnet mask within the same NW Or... Multiple SNMasks with ONE IP Address Use of long mask on networks with few hosts Use of short mask on networks with many hosts In order to use VLSM, the routing protocol must support it. Cisco routers with the following routing protocols support VLSM: OSPF (Open Shortest Path First) IS-IS (Integrated Intermediate System to Intermediate System) EIGRP (Enhanced Interior Gateway Routing Protocol) RIP v2 Static Routing
What is VLSM and why is it used? Classful routing protocols use one subnet mask for a single network Ex: , must use subnet mask VLSM allows a single autonomous system to have networks with different subnet masks, for example: Use a 30-bit subnet mask on network connections ( ) Use a 24-bit subnet mask for user networks up to 250 users ( ) Use a 22-bit subnet mask for user networks up to 1000 users ( )
A waste of space In classless routing, it was recommended that first and last subnet not be used First (SN 0) had same address for the network and subnet Last subnet (all-1’s) was the broadcast Always could have been used, was not recommended practice Address depletion has lead to use of these subnets Now acceptable practice to use the first and last subnets in conjunction with VLSM
A waste of space Network Address Borrow 3 bits = SNM Subnets =0, 32, 64, 96, 128, 160, 192, 224
A waste of space If subnet zero is used, there are 8 useable subnets Each subnet can support 30 hosts Cisco routers use subnet zero by default IOS v If no ip subnet-zero command is used on the router, there are 7 useable subnets with 30 hosts per subnet If supporting 4 routers (1 subnet each) that need 3 WAN links to each other, all subnets are used No room for growth Waste of 28 host addresses for each WAN (point-to- point) links or 1/3 of potential address space Network Address Borrow 3 bits = SNM Subnets =0, 32, 64, 96, 128, 160, 192, 224
A waste of space FOSTER(config)# no ip subnet-zero Disables the capability to use subnets that include the network address of the unsubnetted network
When to use VLSM Design addressing scheme that allows: Growth Doesn’t waste addresses on point-to-point links VLSM addressing applied instead results in: Variable sized subnets Take 1 of the 3 subnets and subnet it again Example (last subnet) Apply a 30 bit mask ( ) Creates a possible 8 ranges of addresses with 30 bits Best solution for point-to-point links – use 2 host addresses instead of 30
Calculating subnets with VLSM VLSM helps to manage IP addresses VLSM can use one SNM for a point-to-point link and one SNM for a LAN
Calculating subnets with VLSM Foster’s Fabulous FilmsFoster’s Fabulous Films 2 routers 1 in Hollywood (100 hosts) 1 in Ravenna (50 hosts) 1 WAN link (2 needed) IP/NW Address: Class C Use the BIGGEST first:
Calculating subnets with VLSM Foster’s Fabulous FilmsFoster’s Fabulous Films 2 routers 1 in Hollywood (100 hosts) 1 in Ravenna (50 hosts) 1 WAN link (2 needed) IP/NW Address: Class C Use the BIGGEST first: 100 /25 50 /26 2 /30
Calculating subnets with VLSM If VLSM were used instead of classful routing: A 24-bit mask could be used for LAN segments for 250 hosts A 30-bit mask could be used for WAN segments for 2 hosts /20 (would accommodate 4094 hosts) Binary = SNM = VLSM address /26 (needed for 62 hosts) Binary = SNM = If /20 used, but only 10 hosts on segment, would provide 4094 hosts and waste 4084 addresses By further subnetting /20 to /26, gain 64 subnets (2 6 ) each supporting 62 hosts
Calculating Subnets w/VLSM Procedure to subnet a subnet /20 to /26 using VLSM: 1. Write in binary form Binary = Draw a vertical line between the 20 th and 21 st bits (the original subnet boundary) 3. Draw a vertical line between the 26 th and 27 th bits extending the bits to segment/host needs 4. Calculate the number of subnet addresses between the two vertical lines (lowest to highest) in value
Calculating Subnets w/VLSM Keep in mind that only unused subnets can be further subnetted If any address for a subnet is used cannot be further subnetted
Route Aggregation w/VLSM Every network needs a separate entry in routing table Each subnet needs a separate entry Aggregation will reduce routing table size When using VLSM keep subnetwork numbers grouped together in the network to allow for aggregation by using Classless InterDomain Routing (CIDR) Router needs to carry only one route /23
Route Aggregation w/VLSM Using CIDR and VLSM prevents address waste and promotes route aggregation or summarization Without summarization, Internet would collapse Summarization reduces burden on upstream routers This process of summarization continues until entire network is advertised as a single aggregate route Summarization is also called supernetting Possible if the routers of a network run a classless routing protocol such as OSPF or EIGRP Consists of IP address and bit mask in routing updates The summary route uses prefix common to all addresses of organization
Route Aggregation w/VLSM Carefully assign addresses in a hierarchical fashion to share same high-order bits for summarization A router must know subnets attached in detail A router does not need to tell other routers about subnets A router using aggregate routes has fewer entries in routing table VLSM allows for summarization of routes Works even if networks are not contiguous VLSM increases flexibly by summarization on higher-order bits Used to calculate the network number of the summary route Uses only shared highest-order bits
Configuring VLSM If VLSM is chosen, it must be configured correctly Example: One router has to support 60 hosts, needs 6 bits in host portion of address to provide 62 possible address (2 6 = 64 – 2 = 60) /26 (leaves 6 bits for hosts) One router has to support 28 hosts, needs 5 bits in host portion of address to provide 30 possible hosts (2 5 = 32 – 2 = 30) /27 (leaves 5 bits for hosts) Two routers have to support 12 hosts each, needs 4 bits in host portion of address to provide 14 possible hosts (2 4 = 16 – 2 = 14) /28 (leaves 4 bits for hosts) /28 (leaves 4 bits for hosts)
Configuring VLSM Point-to-point connections are: /30 (2 address required, 2 bits = 2 host addresses) /30 (2 address required, 2 bits = 2 host addresses) /30 (2 address required, 2 bits = 2 host addresses) Choices = Configuration as follows for the /30 network (.136/30 - network address;.139/30 - broadcast address;.137/30 and 138/30 – host addresses: (config)#interface serial 0 (config-if)#ip address (config)#interface serial1 (config-if)#ip address
RIP History Internet is a collection of autonomous systems (AS) Each AS is administered by a single entity Each AS has its own routing technology Routing protocol used within AS is Interior Gateway Protocol Routing protocol used between Autonomous Systems is an Exterior Gateway Protocol RIP v1: is an IGP that is classful was designed to work within moderate-sized AS is a distance vector routing protocol by default, broadcasts entire routing table every 30 seconds uses hop count as metric (16 max) is capable of load balancing 6 equal-cost paths (4 default) Does not send subnet mask information in its updates Is not able to support VLSM or CIDR
RIP History If the router receives information about a network, and the receiving interface belongs to same network but is on a different subnet, the router applies the one subnet mask configured on the receiving interface Class A default classful mask is Class B default classful mask is Class C default classful mask is
RIP v2 Features RIP v2 is an Improved version of RIP v1 with following features: Distance vector protocol Uses hop count as metric Uses hold-down timers (prevent routing loops), default 180 sec. Uses split horizon to prevent routing loops Uses 16 hops as infinite distance Provides prefix routing (sends subnet mask with route update) Supports use of classless routing (VLSM) Multicasts updates using address for better efficiency Provides authentication in updates Clear text - default MD5 encryption – typically used to encrypt enable secret passwords (Message-Digest 5)
Comparing RIP v1 & v2 RIP v1RIP v2 Easy to configure Supports classful routingSupports classless routing No subnet info sent with routing updates (considered a limitation of v1) Sends subnet mask with routing update No authenticationProvides for authentication Uses hop count 16 hops as metric for infinite distance Broadcasts routing table updates Multicasts updates Does not support prefix routing (all devices in same network must use same subnet mask) Supports prefix routing (VLSM, different subnet masks can be used in same network)
Configuring RIP v2 To enable a dynamic routing protocol: 1. Select routing protocol FOSTER(config)# router rip FOSTER(config-router)# version 2 2.Configure routing protocol with the network IP address (identify physically connected network that will receive routing tables) FOSTER(config-router)# network FOSTER(config-router)# network Assign IP/SNM to interfaces
Verifying RIP v2 FOSTER# show ip protocols Shows protocol name Tells when updates are sent and when the next is due FOSTER# show ip route Tells if routers have learned about a newly added network Displays IP routing table FOSTER# show ip interface brief Summary of information status of interface FOSTER# show running-config Checks for a misconfigured routing protocol
Verifying RIP v2 RIP updates table every 30 seconds If no update received in 180 seconds, route marked as down If no update after 240 seconds, removes from routing table entry
Troubleshooting RIP v2 Foster# debug ip rip Displays RIP routing updates as they are sent and received Foster# no debug all Foster# undebug all Turns off all debugging
Default Routes Three ways a router learns about paths: 1. Static routes – manual configuration of routes (next hop) Uses ip route command 2. Default routes – manually defined path to take when there is no known route to a destination 3. Dynamic routes – routers lean paths by receiving updates from other routers
Default Routes Default Route Command: FOSTER(config)# ip route Default NWTells that 8 bits of subnetting in effect Next hop router Default Route Command: FOSTER(config)# ip route Default NWTells that 8 bits of subnetting in effect Next hop router
Default Routes Used to: 1. Give packets that are not ID’d in the routing table a place to go Usually a router that connects to the Internet 2. Connect a router with a static default route DYNAMIC PROTOCOL Default Route Command FOSTER(config)# ip default-network Default NW