TDC 363 Introduction to LANs Routing Protocols and RIP Greg Brewster DePaul University TDC 363 1
Dynamic Routing Routing Protocols Distance Vector vs. Link State Protocols RIPv1 & RIPv2 RIP Problems Slow Convergence Routing Loops / Count to Infinity Discontiguous Networks and Summarization Partial Solutions Max Hops = 15 / Triggered Updates / Timers Split Horizon no auto-summary TDC 363 2
Routing Protocols Static routing is complex and not scalable. We want automatic routing table updates! Routers use dynamic routing protocols to do this. Dynamic Routing Protocols Routers exchange routing information packets with other routers to learn about all possible routes to all destination subnets within a routing domain. Routers choose least-cost route to each destination subnet and keep that route in their routing table. Routing tables are dynamically updated when network topology changes (i.e. a link goes up/down). TDC 363 3
Dynamic Routing Protocols The purpose of a dynamic routing protocol is to: -Discover remote networks -Maintaining up-to-date routing information -Choosing the best path to destination networks based on some path metric (least cost routing). -Ability to find a new best path if the current path is no longer available ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4
Routing Protocols Metrics Metric A value used by a routing protocol to determine which routes are better than others. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5
Routing Protocols Metrics Metrics used in IP routing protocols -Bandwidth -Cost -Delay -Hop count -Load -Reliability ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6
Routing Protocols Metrics The Metric Field in the Routing Table Metric used for each routing protocol -RIP - hop count -IGRP & EIGRP - Bandwidth (used by default), Delay (used by default), Load, Reliability -IS-IS & OSPF Cost, Bandwidth (Cisco s implementation) ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7
Routing Protocols Metrics Load balancing Routers will distribute packets equally among multiple equal-cost paths ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8
Administrative Distance of a Route Purpose of a metric It s a calculated value used to determine the best path to a destination Purpose of Administrative Distance It s a numeric value that specifies the preference of a particular routing protocol ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9
Administrative Distance of a Route Identifying the Administrative Distance (AD) in a routing table It is the first number in the brackets in the routing table ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10
Administrative Distance of a Route AD values of Dynamic Routing Protocols ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11
Dynamic Routing Protocols Components of a routing protocol Algorithm Used for collecting/processing routing information and best path determination Routing protocol messages These are messages for discovering neighbors and exchange of routing information ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12
Types of Routing Protocols Interior Gateway Protocols (IGPs) Routers within same Autonomous System or customer site exchange routing information about subnets within that AS or site (called the routing domain). Objective: synchronize routing tables so that all routers contain correct routes to all subnets in AS. Exterior Gateway Protocols (EGPs) Border routers in different AS exchange routing information with each other. Objective: Gain information about how to reach subnets in other Autonomous Systems. TDC 363 13
Classifying Routing Protocols Types of routing protocols: -Interior Gateway Protocols (IGP) -Exterior Gateway Protocols (EGP) ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14
Classifying Routing Protocols Interior Gateway Protocol Types: Distance Vector & Link State Routing Protocols Distance vector routes are advertised as vectors of distance & direction. incomplete view of network topology (only neighbors). periodic updates. Link state complete view of network topology is created. updates are not periodic. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15
Criteria used to compare routing protocols -Time to convergence -Scalability -Resource usage -Implementation & maintenance Distance Vector protocol advantages: Lowest resource usage Easiest implementation and maintenance Link State protocol advantages: Fastest time to convergence Greatest scalability ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16
Distance Vector Routing Protocols ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17
Distance Vector Protocols In Distance-Vector routing protocols, each router essentially sends a copy of its routing table to neighbor routers at regular intervals. Each neighbor computes its own distance metric for each destination subnet and keeps the smallest metric route (least cost path) in its own table. Examples: Routing Information Protocol (RIP) uses hop count metric. Cisco (Enhanced) Interior Gateway Routing Protocol (EIGRP, IGRP) may use bandwidth, delay, reliability, load and/or hop count as metrics. By default, bandwidth and delay are used in a combined metric. TDC 363 18
Dynamic Distance Vector Protocols Share only with neighbors Share at regular intervals Share the distance vector: a router s distance to all other routers within the AS Routes are calculated based on the distance vectors received from the neighbors. It is based on the Bellman-Ford algorithm. (Don t worry about the details of the algorithm) Cisco IGRP and EIGRP are examples. RIP (Routing Information Protocol) is an example Encapsulated in UDP: sent to well known port 520.( RFC 1058 (RIPv1); RFC 1388 (RIPv2), RFC 2080 (RIPng for IPv6) TDC 363 19
Classful vs. Classless Routing In Classful Routing, we make the following assumptions: RIRs, ISPs only allocate Class A, Class B or Class C address blocks to customers. Internet backbone router table entries only use default masks. Customers use only straight subnetting that is, all subnets are the same size. All subnets of a particular network use the same mask. Subnets from the same classful network must be physically contiguous that is, they cannot be separated by another network. Routing protocols only advertise network addresses and do not advertise subnet masks. TDC 363 20
Classless Routing In Classless Routing, the assumptions are: RIRs and ISPs can allocate address blocks in any 2 x size. Internet backbone router table entries can use any mask. This is called CIDR (Classless InterDomain Routing). Routers can use different masks on different subnets from the same network. This is called Variable Length Subnet Masks (VLSM). Subnets from the same address block can be separated by other networks (not required to be contiguous). Routing protocols advertise subnet mask along with network address TDC 363 21
Routing Protocols Note: IGRP and EIGRP are Cisco proprietary protocols. All other protocols are public standards (RFCs). TDC 363 22
Time Line TDC 363 23
RIPv1 Basic Operations Once every 30 seconds, each router sends RIP msg to each neighbor router: Starts with <subnet> <hops> from routing table Adds 1 to each <hops> value. Sends resulting distance vector to all neighbors When router receives RIP msg from neighbor router Rx For each <subnet> in RIP msg If the received <hops> value is better than current entry in routing table for <subnet>, then update route table with new hop count and set Next Hop = Rx (the router this message came from). TDC 363 24
RIP v1 Message Format Each message exchanged between routers using RIP version 1 protocol contains: Command field: Request or Response Address of source router A <Dest. Subnet>, <Hop Count> entry for each subnet in the routing table of the source router Note: Depending on MTU, may need to send several RIP messages to send all routing table information. TDC 363 25
RIP Update Algorithm Receive: a RIP message from neighbor router <Rx> on interface <mx> (where <Hops> already incremented) For each entry <Net>, <Hops> in RIP msg: If destination <Net> not in routing table Add Routing Table Entry: /* New destination */ Default subnet mask, Destination = <Net>, Distance = <Hops>, Next Hop = <Rx>, Interface = <mx> Else If destination <Net> is in routing table If Next Hop = <Rx>, then Update Routing Table Entry: /* update distance */ Distance = <Hops> Else If Next Hop not <Rx>, and (<Hops>) < current table Hops Update Routing Table Entry: /* found better path */ Destination = <Net>, Distance = <Hops>, Next Hop = <Rx>, Interface = <mx> TDC 363 26
Examples of RIP updates by router B, connected to A, C, E, F. (FYI: Cisco routers increment hop counts before sending the RIP message). Routing Table for Router C <Dest> <Hops> RIP updates Routing Table for Router B TDC 363 27
Network Discovery Router initial start up (Cold Starts) -Initial network discovery Directly connected networks are initially placed in routing table ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28
Network Discovery Initial Exchange of Routing Information If a routing protocol is configured then -Routers will exchange routing information Routing updates received from other routers -Router checks update for new information If there is new information: -Metric is updated -New information is stored in routing table ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29
Network Discovery Exchange of Routing Information Router convergence is reached when -All routing tables in the network contain the same network information Routers continue to exchange routing information -If no new information is found then Convergence is reached ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30
Basic RIPv1 Configuration A typical topology suitable for use by RIPv1 includes: -Three router set up -No PCs attached to LANs -Use of 5 different IP subnets ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31
Basic RIPv1 Configuration Router RIP Command To enable RIP enter: -Router rip at the global configuration prompt -Prompt will look like R1(config-router)# ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32
Basic RIPv1 Configuration network command network <network> Enables RIP on all interfaces that belong to <network> RIP will advertise <network> in RIP updates sent to out these interfaces once every 30 seconds ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 33
Verification and Troubleshooting Show ip Route To verify and troubleshoot routing -Use the following commands: -show ip route -show ip protocols -debug ip rip ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34
Verification and Troubleshooting show ip protocols command -Displays routing protocol configured on router ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35
Verification and Troubleshooting Debug ip rip command -Used to display RIP routing updates as they are happening ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 36
Verification and Troubleshooting Passive interface command -Used to prevent a router from sending RIP updates out an interface -Example: Router(config-router)# passive-interface <interface> Example: passive-interface Fa0/0 ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37
Summary: Commands used by RIP Rtr(config)#router rip Command Rtr(config-router)#network Command s purpose Enables RIP routing process Associates a network with a RIP routing process Rtr#debug ip rip used to view real time RIP routing updates Rtr(config-router)#passive-interface fa0/0 Rtr(config-router)#default-information originate Rtr#show ip protocols Prevent RIP updates from going out an interface Used by RIP to propagate default routes Used to display timers used by RIP ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38
RIP v1 Problems Several problems with the RIP version 1 protocol are solved in RIP version 2: RIPv1 had no authentication mechanism to verify identity of sending router RIPv1 has no method for interacting with Exterior Gateway Protocols (such as BGP) RIPv1 messages carry no subnet mask, so, for received <network>, the receiving router assumes: If incoming interface IP is in same classful network as <network>, then uses mask of incoming interface. Otherwise, assumes default classful subnet mask. RIPv1 messages cannot be used to advertise other Next Hops besides the source router. TDC 363 39
RIP version 2 Routing Information Protocol version 2: Adds Authentication Data entry to provide secure identification of source router. Basically, it s just a password, but better than RIPv1. Adds Route Tag field to carry AS number information from BGP. Adds Subnet Mask field to allow variable length subnetting on addresses in message Adds Next-Hop Address field to allow one router to advertise routes through a different Next Hop router. TDC 363 40
Figure 13-15 RIP version 2 Route Tag: Distinguish multiple domains running on the same wire/subnet. Carries information such as AS #. It can be used to enable RIP to receive information from an exterior routing protocol. TDC 363 41
RIPv2 Extensions Subnet mask carried with route entry allow supports for classless and VLSM. Authentication option for routing updates Next hop carried with each route Route tags for external use Respond/integrates with RIPv1 Uses multicast 224.0.0.9 instead of broadcast Still uses UDP/520: same as RIPv1 TDC 363 42
Configuring RIPv2 Enabling and Verifying RIPv2 Configuring RIP on a Cisco router By default it is running RIPv1 ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43
Configuring RIPv2 Configuring RIPv2 on a Cisco router -Requires using the version 2 command -RIPv2 ignores RIPv1 updates To verify RIPv2 is configured use the show ip protocols command ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 44
RIP Routing Problems Slow Convergence (Either version) When there is a change in the network (i.e. link goes up or down), it may take several minutes before that change is propagated to all routers Routing Loops and Count to Infinity problem When links go down, RIP networks may temporarily experience loops where data is sent uselessly in a cycle until its TTL expires. Loops are eventually resolved, but it may take a few minutes. Cannot handle discontiguous networks if autosummarization is used. TDC 363 Greg Brewster, DePaul University 45
Improving Slow Convergence RIP sets maximum hop count of 15 In both RIP protocols, maximum legal hop count is 15. A hop count of 16 is used to indicate an unreachable network. Triggered Updates When changes occur in the network (i.e. a link goes up or down - that is, hop count changes to or from a value of 16), then a router will send out new table update immediately rather than waiting for the usual 30-second timer to expire. TDC 363 Greg Brewster, DePaul University 46
Routing Table Maintenance Triggered Updates Conditions in which triggered updates are sent -Interface changes state -Route becomes unreachable -New route is placed in routing table ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 47
Routing Loops Routing loops are A condition in which a packet is continuously transmitted within a series of routers without ever reaching its destination. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 48
Routing Loops Count to Infinity This is a routing loop whereby RIP routing packets loop, continuously increasing hop counts. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 49
Routing Loops Setting a maximum Distance Vector routing protocols set a specified metric value to indicate infinity Once a router counts to infinity it marks the route as unreachable ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 50
Partial Solutions for Loops Holddown Timers When a route goes down, the router keeps it down and ignores all advertisements received for that route for a holddown time. Split Horizon When router A sends RIP messages to router B, it does not include any Destinations where its Next Hop field is equal to router B s address. Split Horizon with Poisoned Reverse When router A sends RIP messages to router B, it will send Hops=16 for any Destinations where its Next Hop field is currently set to router B s address. TDC 363 Greg Brewster, DePaul University 51
Routing Loops Preventing loops with holddown timers -Holddown timers allow a router to not accept any changes to a route for a specified period of time. -Point of using holddown timers Allows routing updates to propagate through network with the most current information. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 52
Routing Loops The Split Horizon Rule is used to prevent routing loops Split Horizon rule: A router should not advertise a network through the interface from which the update came. ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 53
Routing Loops Split horizon with poison reverse The rule states that once a router learns of an unreachable route through an interface, it will advertise it back as unreachable (hops = 16) through the same interface ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 54
RIP Configuration Options RIP Timers RIP uses 4 timers: Update Timer time between RIP updates (def: 30 sec.) Invalid Timer time since last update received before a route is marked invalid. (def: 180 sec.). Invalid routes are advertised as unreachable, but still forward packets. Holddown Timer length of holddown state entered when received update indicates route is unreachable. (def: 180 sec.) During this time route updates are ignored and route is advertised as unreachable, but still forwards packets. Flush Timer time since last update received before a route is removed from the routing table. (def: 240 sec.) TDC 363 Greg Brewster, DePaul University 55
RIP Configuration Options RIP Timers Don t mess with RIP timers unless you know what you re doing. But you can change them. TDC 363 Greg Brewster, DePaul University 56
RIP Configuration Options RIP Timers RIP uses 4 timers: Update Timer time between RIP updates (def: 30 sec.) Invalid Timer time since last update received before a route is marked invalid. (def: 180 sec.). Invalid routes are advertised as unreachable, but still forward packets. Holddown Timer length of holddown state entered when received update indicates route is unreachable. (def: 180 sec.) During this time route updates are ignored and route is advertised as unreachable, but still forwards packets. Flush Timer time since last update received before a route is removed from the routing table. (def: 240 sec.) TDC 363 Greg Brewster, DePaul University 57
RIP Configuration Options RIP Timers Don t mess with RIP timers unless you know what you re doing. But you can change them. TDC 363 Greg Brewster, DePaul University 58
RIP over Slow Links If you run RIP over a low-speed or dial-up link, you can suppress periodic RIP updates and only allow triggered updates. Configured in interface configuration mode. TDC 363 Greg Brewster, DePaul University 59
Classful Versus Classless Routing Classful Routing Protocol: Does not support VLSM. Routing updates sent do not include the subnet mask. Subnets are not advertised to a different major network. Discontiguous subnets are not visible to each other. RIP Version 1 (RIPv1) is a classful routing protocol. Classless Routing Protocol: Supports VLSM. Routing updates sent include the subnet mask. Subnets can be advertised to a different major network. Discontiguous subnets are visible to each other. RIPv2, EIGRP, OSPF, IS-IS, and BGP are classless routing protocols. Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 60
Routing Table Structure Cisco displays routing table entries hierarchically under classful network entries called parent routes. If all subnets are same size, then routing table displays common prefix length (/24) with parent route. Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 61
Routing Table Structure If subnets are different sizes (VLSM), then routing table displays default classful prefix length on parent route plus variably subnetted, then displays prefix length on each child route. Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 62
Discontiguous Subnets - Classful Routing Classful routing protocols do not support discontiguous networks. Discontiguous subnets are subnets of the same major network that are separated by a different major network. For example, RIPv1 has been configured on all three routers. Routers R2 and R3 advertise 172.16.0.0 to R1. They cannot advertise the 172.16.1.0 /24 and 172.16.2.0 /24 subnets across a different major network because RIPv1 is classful. R1 therefore receives routes about 172.16.0.0 /16 from two different directions and it might make an incorrect routing decision. Fa0/0 172.16.1.0 /24 R2 192.168.1.0 /24 RIPv1 update 172.16.0.0 R1 192.168.2.0 /24 RIPv1 update 172.16.0.0 R3 Fa0/0 172.16.2.0 /24 Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 63
Discontiguous Subnets - Classless Routing Classless routing protocols support discontiguous networks IF auto-summary is DISABLED. For example, RIPv2 has been configured on all three routers. Because of RIPv2, routers R2 and R3 can now advertise the 172.16.1.0 /24 and 172.16.2.0 /24 subnets across a different major network. R1 therefore receives routes with valid subnet information and can now make a correct routing decision. R1 Routing Table: 172.16.1.0/24 172.16.2.0/24 Fa0/0 172.16.1.0 /24 R2 192.168.1.0 /24 RIPv2 update 172.16.1.0/24 R1 192.168.2.0 /24 RIPv2 update 172.16.2.0/24 R3 Fa0/0 172.16.2.0 /24 Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 64
RIPv1 or RIPv2: Auto-Summary Can t handle discontiguous networks Router R2 thinks that all subnets of network 172.30.0.0/16 are reachable through either serial interface and does load balancing. Routers R1 and R3 each advertise classful network 172.30.0.0/16 out serial interface. TDC 363 Greg Brewster, DePaul University 65
Route Summarization Route Summarization is the process of combining a number of subnet routes into a single route when advertising them out a router interface. Summarizing routes reduces the size of the routing messages and reduces the number of routing entries in the routing tables of the receiving routers. Automatic Summarization is the process of automatically summarizing to single classful network route when the outgoing interface is on a different classful network. Both RIPv1 and RIPv2, by default, have automatic summarization enabled. Chapter 1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 66
RIPv2: Default behavior Auto-summary is enabled Router R2 thinks that all subnets of network 172.30.0.0/16 are reachable through either serial interface and does load balancing. Routers R1 and R3 each advertise classful network 172.30.0.0/16 out serial interface. TDC 363 Greg Brewster, DePaul University 67
RIPv2 Auto-Summary RIPv2, by default, has automatic summarization enabled to maintain compatibility with RIPv1. But, you can turn off auto-summary in RIPv2 with the no auto-summary command. TDC 363 Greg Brewster, DePaul University 68
RIPv2: Advertising Subnets If a router has multiple subnets in its routing table for a single classful network, N, RIPv2 advertises them as follows: If the outgoing interface connects to a subnet of the same classful network N, then: RIPv2 advertises all subnets out this interface correctly, each with its own mask. If the outgoing interface connects to a subnet of a different classful network then: By default, RIPv2 performs automatic network summarization and advertises the full classful network N out this interface. May cause incorrect routing to any discontiguous subnets. If no auto-summary is configured, then RIPv2 correctly advertises each subnet individually with its own subnet mask. TDC 363 Greg Brewster, DePaul University 69
RIPv2: no auto-summary Auto-summary is disabled Router R2 receives advertisements for all 6 subnets of 172.30.0.0 and stores them in routing table for correct routing. Routers R1 and R3 advertise all subnets correctly. (config-router)# no auto-summary TDC 363 Greg Brewster, DePaul University 70
Manual Summarization But, summarization can be a good thing. It reduces the size of routing messages and routing tables. Can we use it responsibly? Yes, after configuring no auto-summary, you can manually specify how subnets should be summarized by RIP out any interface. TDC 363 Greg Brewster, DePaul University 71
RIPv2: no auto-summary Manual summarization configured on R1 Router R2 receives advertisements for 5 subnets of 172.30.0.0 and stores them in routing table for correct routing. Routers R1 advertises route 172.30.0.0/22 out interface S0/0/0. R1 (config-if)# ip summary-address rip 172.30.0.0 255.255.252.0 Can R3 configure one manual summarization for its172.30 subnets? TDC 363 Greg Brewster, DePaul University 72
Summary Routing Protocol Distance Vector Classless Routing Protocol Uses Hold- Down Timers Use of Split Horizon or Split Horizon w/ Poison Reverse Max Hop count = 15 Auto Summary Support CIDR Supports VLSM Uses Authentication RIPv1 Yes No Yes Yes Yes Yes No No No RIPv2 Yes Yes Yes Yes Yes Yes Yes Yes Yes ITE PC v4.0 Chapter 1 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 73