Routing Within An Autonomous System (RIP, OSPF) Chapter 15 Static vs Dynamic Interior Routes Interior Routers Two routers within an autonomous system Are considered to be interior to one another How do they learn about their own networks? Small, slowly changing systems Establish and modify routes by hand Update table when new network added or deleted Figure…routing is trivial Figure 15.1 Disadvantages of manual system Cannot accommodate rapid growth Cannot accommodate rapid change Need automated methods Respond to change more easily Improve reliability Better response to failures Figure 15.2 Multiple physical paths Usually pick one to be primary Router(s) fail along primary, must change Manually: time-consuming & error prone Even in small internets need automated system For automation Interior routers must communicate Exchange routing information Once data established, advertise One interior router advertises to other autonomous systems via Exterior Gateway Protocol No single interior protocol has emerged Varied topologies and technologies Tradeoffs between simplicity & functionality Easy to install & configure; less functionality Multiple protocols have become popular Small AS Choose a single one; use exclusively internally Larger AS Often choose a small set Interior Gateway Protocol Used as generic description Refers to any algorithm used by interior routers Routers may run BGP to advertise reachability Need an IGP to obtain information within the AS Figure 15.3 Routing Information Protocol (RIP) One of most widely used IGPs Also know as route-d Came from Univ of CA – Berkeley Developed for machines on their LANs Relies on physical network broadcast to make routing exchanges quickly Not designed to use on large WANs Versions of RIP adapted for WANs are sold Popularity not only due to technical merits Was distributed with popular 4BSD UNIX systems Lots of TCP/IP sites used without even considering technical aspects Once installed it became the basis for local routing RIP was built and adopted without a standard Most implementations derived from Berkeley code Interoperability was limited Many undocumented details and subtleties New versions led to more problems Standard appeared in June 1988 RIP Operation Straightforward distance-vector routing Partitions participants into two categories Active: Advertise their routes Only routers Passive: Do not advertise Host must use passive mode Active RIP routers broadcast every 30 seconds Sends routing update message Takes information from current routing database Update is a set of pairs (IP address, integer distance to that network) Hop count is used as the distance metric One hop: directly connected Two hops: reachable through one other router Hops = number of networks datagram will encounter Hop count for shortest path not always optimal 3 Ethernets faster than 2 satellites Some RIP implementations allow assignment of artificially high hop counts when advertising slow networks Active & passive routers listen to broadcasts All update tables according to DV algorithm May take some time for advertisements to propagate Routers use hysteresis to improve performance Does not replace a route with an equal cost route Prevents oscillation among equal paths Timers are used on all routes Solves problem of routes through crashed routers Start timer when install route in table Restart whenever receive msg advertising that route Route is invalid if 180 seconds pass without another advertisement RIP must handle three types of errors Routing loops Algorithm does not explicitly detect routing loops Must either assume participants can be trusted or take precautions to prevent Instabilities Must limit hop count to prevent Maximum possible distance value is 16 If legitimate hop count is higher, must divide the internet into sections or use an alternate protocol Slow convergence Routing messages propagate slowly across the network Can lead to inconsistencies Not unique to RIP; fundamental problem in any DV protocol Hop count limit helps but does not eliminate Figure 15.4 Solving slow convergence “Good news travel quickly; bad news travel slowly” Quick to install good route Unreachable only after timeout; then learn and propagate new route Split horizon update Router does not propagate information over the interface from where the route arrived R2 would not advertise route to network 1 to R1 If R1 loses connectivity, it must quit advertising After a few rounds of routing updates, all routers agree that the network is unreachable Does not prevent all routing loops Hold down Router ignores information for a period of time Typical time is 60 seconds Done after receiving msg that network is unreachable Wait so all machines can get bad news; keeps from mistakenly accepting an out-of-date message All machines must have same idea of hold down Otherwise, get routing loops Disadvantages: If routing loop occurs, will be preserved for the hold down Also preserves incorrect routes during the hold down time Even when alternatives exist Poison reverse When connection disappears Advertising router keeps entry for few update periods Puts infinite cost in the broadcasts Combine with triggered updates Router sends immediate broadcast when get bad news Not wait for next broadcast time Minimizes time it is vulnerable to believing good news These techniques solve some problems; introduce others Triggered updates Suppose many routers share common network Single broadcast changes all tables; triggering more Broadcast avalanche Broadcasts Take substantial bandwidth themselves Loops prevent stopping loops Looping messages may prevent routing msgs to break loops Hold down in WANs Period so long, higher level protocol timers may expire Breaks the connections RIP1 message format Messages are of two types Routing information messages Periodic broadcast of unsolicited response messages Messages to request information Routers or hosts can ask for info with request command Routers reply using a response command Both use same format Figure 15.5 Command Meaning 1 Request for partial or full routing information 2 Response (network-distance pairs from sender’s routing table) 9 Update Request (used with demand circuits) 10 Update Response (used with demand circuits) 11 Update Acknowledge (used with demand circuits) RIP2 Address Conventions Skip….. RIP route interpretation and aggregation Version 1 contains no provision for subnet mask Originally designed for classful addressing Extended to allow subnetting Important restriction: Subnet routes can only go in updates sent across networks that are part of the subnetted prefix Cannot use with variable-length subnet addresses or classless Due to not having explicit subnet mask information May have updates for networks in & out of prefix Router must prepare different update messages RIP2 extensions Contains provisions for explicit subnet mask Also include explicit next-hop information Prevents routing loops Prevents slow conversion RIP2 message format Puts new info in unused octets of address field Router can use both versions simultaneously Version number in same octet; inspect before process Adds 16-bit ROUTE TAG Identify the origin of the route Figure 15.6 Transmitting RIP messages Messages do not have explicit length field Nor any explicit count of entries Rely on delivery mechanism to tell length With TCP/IP Rely on UDP to tell receiver the message length RIP operates on UDP port 520 Disadvantage of RIP hop counts RIP restricts routing to a hop-count metric RIP restricts size of any internet using it Has small hop count value for infinity (16) Limits span to at most 15 routers between hosts Is not a limit on total number or density of routers In any case, hop count is a crude measure Not always get least delay or highest capacity routes Makes routes static; cannot change due to load The Hello Protocol IGP that uses routing metric other than hops Now obsolete Historically, used in original NSFNET backbone “fuzzball” routers Uses metric of delay Provides two functions Synchronizes clocks among a set of machines Allows each machine to compute shortest delay paths Messages carry timestamp as well as routing info Each participating machine maintains table Contains best estimate of neighboring machine clocks Transmit timestamp with each packet Receiver computes estimate of delay on the link by using the timestamp and its estimate of the sender’s clock Periodically poll neighbors to update clock estimates Standard D-V approach for update Send table of destinations & estimated delays Receiver’s update tables if cheaper route advertised Delay Metrics & Oscillation Is delay a good routing metric? Would seem so Worked well in the early Internet backbone Instability is the reason most protocols do not use delay Any protocol that changes routes quickly can become unstable Hop counts fixed; delay is not Minor variations in delay measurements occur Hardware clock drift CPU load during measurement Delays by link-level synchronization If react quickly to slight variations, get twostage oscillation Switch back and forth between alternate paths Heuristics to help avoid oscillation Hold down Slows down changing Round off measurements or use threshold Ignore differences less than the threshold Use average measurement Keep average of recent measurements Use K-out-of-N rule K of the most recent N measurements must be less than the current delay before route can be changed Can still have instability Due to comparing delays on paths with different characteristics Traffic has dramatic effect on delay As load increases, delay grows rapidly Fall into positive feedback cycle Burst of traffic at one place increases delay Protocol changes route New traffic may cause another change in delay Another route change occurs Must have mechanism to dampen oscillation Previous heuristics may not help They help in simple case for paths with same throughput characteristics Not good when paths have different delay and throughput characteristics Compare serial line and satellite link First, both paths idle; serial line have much less delay Then, traffic quickly overloads low capacity line Satellite delay will be less; change to it High capacity; load not significantly change delay But, unloaded serial line will now become attractive Routing will change again and the cycle will continue Oscillations do occur in practice Difficult to manage Combining RIP, Hello, and BGP Single router may use multiple protocols Interior Gateway Protocol Gather routing information within AS Exterior Gateway Protocol Advertise routes to other ASs Should be easy to combine the two Technical and political obstacles exist IGP protocols are routing protocols RIP and HELLO used to update routing tables Get info from other routers inside AS routed implements RIP Advertises information from local routing table Updates local table when it receives updates RIP trusts routers within the AS to send correct data Exterior protocols (BGP) do not trust routers Do not advertise all possible routes in local table Keep database of reachability Apply policy constraints when sending/receiving info Ignoring policy constraints can make some parts of the internet unreachable Example: Suppose router running RIP Propagates route to Purdue; actually has no route Other RIP routers will accept and update Will pass Purdue traffic to the erroneous router Problem if EGP protocol not have policy constraints Border router pass illegal route to other ASs Purdue may become unreachable for parts of the internet Gated: Inter-AS Communication gated Interface between autonomous systems Understands multiple protocols Both IGP’s and BGP Ensures policy constraints are honored Can accept RIP msgs and modify local table (routed) Can advertise routes from within AS using BGP Has rules on which networks it may & may not advertise Also has rules on how to report distances to those networks Links IGP with BGP Open SPF Protocol (OSPF) Chapter 13: link state algorithm Uses SPF to compute shortest paths Scales better than distance-vector algorithms OSPF is an IGP using link state algorithm Designed by Internet Engineering Task Force To encourage adoption of link state technology Tackles several ambitious goals Open standard Anyone can implement without license fees Includes type of service routing Have multiple routes for a given destination Choose by TOS field in IP header OSPF first among TCP/IP protocols to have this Provides load balancing Distributes traffic over multiple, same cost routes Can partition routers and networks into areas Permits growth; makes management easier Allows exchanges to be authenticated Variety of authentication schemes Supports host-specific, subnet-specific, and classless routes Accommodates multi-access nets (Ethernet) Can describe network via virtual network Abstracts away from details of physical connections Provides flexibility for managers Allows routers to exchange routing info learned from external sites Distinguishes where information came from Figure 15.7 Type Meaning 1 Hello (used to test reachability) 2 Database description (topology) 3 Link status request 4 Link status update 5 Link status acknowledgement Figure 15.8 Routers exchange database description msgs Used to initialize network topology database During exchange: One router is master; other is slave Slave acknowledges each description with a response Topology database may be large Can divide into several messages using I and M bits I = 1: is initial message M = 1: additional messages follow Bit S indicates if sent by master (1) or slave (0) Sequence numbers used to make sure all received Figure 15.9 Link Type Meaning 1 Router link 2 Network link 3 Summary link (IP network) 4 Summary link (link to border router) 5 External link (link to another site) Link status request message After exchanging DB descriptions, router may discover parts of its DB are out of date Requests neighbor to send update Lists specific links it wants info about Neighbor responds with most current information about those links Figure 15.10 Figure 15.11 Links from router to: - given area - specific network - single, subnetted IP network - networks at other sites Figure 15.12 Routing with Partial Information Hosts can have partial information Rely on routers Not all routers have complete information Usually single router in AS connects to others Suppose site connects to global Internet At least one router must have connection to an ISP Routers inside AS know all destinations within Have default route to send all traffic to the ISP Examine routing tables Routers at center of Internet know all Have complete set of routes to all destinations Learn from the routing arbiter system They do not use default routing If destination address not in their table: Either address is not valid, or Address is valid but currently unreachable Routers beyond those at center do not know all Have an incomplete set of routes Rely on default routes for addresses they do not have Using default routes for most routers has consequences Local routing errors can go undetected Machine in AS routes packet to external AS Suppose should have gone to local router External system will route it back Preserves connectivity even if routing incorrect Very bad for a WAN Routing update messages will be smaller A good thing! Summary Must have automated routing procedures IGPs Used by 2 routers under control of single mgr Uses either DV or link state algorithm (SPF) RIP: DV implemented by routed Uses split horizon, hold-down and poison reverse Hello: obsolete; uses delay versus hop count OSPF: uses link status algorithm gated Interface between IGP (RIP) and EGP (BGP)