560 likes | 708 Views
Link State & OSPF. Administrativia. Static Routing lab Wording problems VM stability issues How are the labs going? I will start upgrades of VMs today… will send e-mail w/ new password when done Opportunities Cruzio … I’m waiting to hear back
E N D
Link State & OSPF CE 151 - Advanced Networks
Administrativia • Static Routing lab • Wording problems • VM stability issues • How are the labs going? • I will start upgrades of VMs today… will send e-mail w/ new password when done • Opportunities • Cruzio… I’m waiting to hear back • NMO Software Development for Cisco Advanced Services… waiting for applications • Expect more from campus network operations group… • Next week • Link Layer lab due Wednesday, 4/24 • Link-State Routing quiz Thursday, 4/25 • Project proposal due Tuesday 4/30 • Topic • Draft outline • What you need to investigate CE 151 - Advanced Networks
Routing Introduction • Remember… delivery of IP packets implemented by two processes • Forwarding • Routing • Dynamic routing process is a distributed computation • Triggered by topology changes • Processing defined by a routing protocol • Output of the computation is forwarding state • Goal of computation is convergence • After finite sequence of topology changes • Process should terminate updates to forwarding state • Forwarding state should be correct • Loop-free (after convergence vs. instantaneous) • With desired characteristics: performance, possibly conform to policy CE 151 - Advanced Networks
“Fate-sharing” Principle • “The fate-sharing model suggests that it is acceptable to lose the state information associated with an entity if, at the same time, the entity itself is lost.” Dave Clark, “Design Philosophy of the DARPA Internet Protocols”, SIGCOMM ‘88. • Benefits • Ensures the failure of any single component of an internet does not invalidate state located elsewhere in the internet • Localizing the effects of any failures • More robust system • Internet routing architecture co-locates • Forwarding state • Routing process that computes the state • Compared with virtual-circuit routing? CE 151 - Advanced Networks
Routing Protocol • A set of algorithms and messages that are used to exchange topology information and populate the forwarding table with the routing protocol’s choice of best paths. • Purpose: • Discover remote subnets • Maintain up-to-date forwarding tables • Choose the best path to destination subnets • Componentsof a routing protocol: • Algorithm: • Procedures for • Processing routing information • Selecting best-paths • The data structures needed for these steps. • Routing protocol messages: • Discover neighboring routers • Exchange topology information CE 151 - Advanced Networks
Classifying Routing Protocols • Function: • Intra-domain/Interior Gateway Protocol (IGP) • Inter-domain/Exterior Gateway Protocol (EGP) • Algorithm… distinguished by information exchanged: • Distance-Vector • Link-State • Path-Vector CE 151 - Advanced Networks
Functional Classification • An autonomous system (AS) or routing domainis a region of the Internet that is administered by a single entity • UCSC’s network • IBM’s corporate network • AT&T’s ISP network • Routing inside an AS • Focus is on performance • Popular protocols: RIP, OSPF, IS-IS • Called intra-domain or internal gateway (IGP)routing • Routing between ASs • Focus is on policy • Popular protocol: BGP • Called inter-domain or external gateway (EGP) routing CE 151 - Advanced Networks
How ensure correct routes? • Recall requirement for correctness of routing protocol • Loop-free • Desired path characteristics • Two strategies for ensuring correctness • Use identical algorithm for selecting paths • Share minimal topology information • Use identical path selection algorithm at all nodes • Used for IGP/Intra-domain routing • Use link-state or distance vector protocol • Use custom (private) algorithm for selecting paths • Share full path information • Use policy-specific path selection algorithm at each node • Used for EGP/Inter-domain routing • Use path-vector protocol CE 151 - Advanced Networks
Algorithm Classification • Distance-Vector • Vectors of destination and distance sent to neighbors • “Tell your neighbors about the rest of the network” • Destination in terms of a network prefix • Distance in terms of a metric: hop count, delay, bandwidth • Use DistributedBellman-Ford path selection algorithm • Popular protocol: Routing Information Protocol (RIP) • Link-State • Flood description of your links (link state) • “Tell the rest of the network about your neighbors” • Links described by • End-point routers of subnet in internet • Cost of subnet: delay, bandwidth • Use Dijkstra path selection algorithm • Popular protocol: Open Shortest Path First (OSPF) • Path-Vector • Routes advertised as full-paths • Paths described by sequence of ASs • Popular protocol is Border Gateway Routing Protocol (BGP) CE 151 - Advanced Networks
Destination-Based Forwarding • Internet routing uses a single path per destination • Destination-based forwarding is a restricted version of single-path • A path through a node to a destination… • …must be an extension of the path from the node to the destination. • This is coming back to haunt us… CE 151 - Advanced Networks
Review • The Internet implements a distributed routing architecture that is triggered by topology change events. • Convergence of routing in the Internet depends on the stability of the network topology for a sufficient period of time. • The Fate-Sharing Principle – “It is acceptable to lose the state information associated with an entity if, at the same time, the entity itself is lost.” • Ensures the failure of any single component of an internet does not invalidate state located elsewhere in the internet • Localizing the effects of any failures • Results in a more robust system • Achieved in Internet by co-locating • Forwarding state • Routing process that computes the state CE 151 - Advanced Networks
Review • An Autonomous System (AS) is a region of the Internet that is administered by a single entity and follows a single routing policy. • Functional classification of routing protocols • IGP - routing inside an AS • Share minimal topology information • Use identical path selection algorithm at all nodes • Optimize performance • EGP - routing between ASs • Share full path information • Use custom path selection algorithm at each node to implement desired policies • Enforce policies CE 151 - Advanced Networks
Review • Algorithmic classification of routing protocols • Distance-vector • Send vectors of distances to destinations to neighbors • “Tell your neighbors about the rest of the network” • “Distributed computation” • Link-state • Flood description of your links to all routers • “Tell the rest of the network about your neighbors” • “Distributed database” • Path-vector • Distance-vector with full paths CE 151 - Advanced Networks
Review • Destination-based forwarding • A path through a node to a destination… must be an extension of the path from the node to the destination • Tends concentrates traffic on a subset of the network topology. CE 151 - Advanced Networks
Link-State CE 151 - Advanced Networks
Routing Algorithms • Distance-Vector • Vectors of destination and distance sent to neighbors • “Tell your neighbors about the rest of the network” • Destination in terms of a network prefix • Distance in terms of a metric: hop count, delay, bandwidth • Use Distributed Bellman-Ford path selection algorithm • Popular protocol: Routing Information Protocol (RIP) • Link-State • Flood description of your links (link state) • “Tell the rest of the network about your neighbors” • Links described by • End-point routers of subnet in internet • Cost of subnet: delay, bandwidth • Use Dijkstra path selection algorithm • Popular protocol: Open Shortest Path First (OSPF) • Path-Vector • Routes advertised as full-paths • Paths described by sequence of ASs • Popular protocol is Border Gateway Routing Protocol (BGP) CE 151 - Advanced Networks
Routing Algorithms • Distance-Vector • Vectors of destination and distance sent to neighbors • “Tell your neighbors about the rest of the network” • Destination in terms of a network prefix • Distance in terms of a metric: hop count, delay, bandwidth • Use Distributed Bellman-Ford path selection algorithm • Popular protocol: Routing Information Protocol (RIP) • Link-State • Flood description of your links (link state) • “Tell the rest of the network about your neighbors” • Links described by • End-point routers of subnet in internet • Cost of subnet: delay, bandwidth • Use Dijkstra path selection algorithm • Popular protocol: Open Shortest Path First (OSPF) • Path-Vector • Routes advertised as full-paths • Paths described by sequence of ASs • Popular protocol is Border Gateway Routing Protocol (BGP) CE 151 - Advanced Networks
How ensure correct routes? • Recall requirement for correctness of routing protocol • Loop-free • Desired path characteristics • Two strategies for ensuring correctness • Use identical algorithm for selecting paths • Share minimal topology information • Use identical path selection algorithm at all nodes • Used for IGP/Intra-domain routing • Use link-state or distance vector protocol • Use custom (private) algorithm for selecting paths • Share full path information • Use policy-specific path selection algorithm at each node • Used for EGP/Inter-domain routing • Use path-vector protocol CE 151 - Advanced Networks
How ensure correct routes? • Recall requirement for correctness of routing protocol • Loop-free • Desired path characteristics • Two strategies for ensuring correctness • Use identical algorithm for selecting paths • Share minimal topology information • Use identical path selection algorithm at all nodes • Used for IGP/Intra-domain routing • Use link-state or distance vector protocol • Use custom (private) algorithm for selecting paths • Share full path information • Use policy-specific path selection algorithm at each node • Used for EGP/Inter-domain routing • Use path-vector protocol CE 151 - Advanced Networks
Link-State Protocols • Are Interior-Gateway Protocols (IGPs) • Exchange link-state information • Pair of routers connected by a subnet • Cost of subnet (hop count, delay, etc.) • Conceptually, very simple… CE 151 - Advanced Networks
Link-State Protocols • Maintains a topology database of all the links it has heard of • Initialize with the subnets it is connected to. • Floods link-state updates describing its directly connected subnets, including any changes to these links. • “Tell the rest of the network about your neighbors” • Participates in the flooding of link-state updates from other routers. • On update of its topology database • Runs a shortest-path algorithm on the database to compute routes • Dijkstra is most efficient • Updates its forwarding table with any changes. CE 151 - Advanced Networks
Characterizing Link State Link-State • # updates per link change? • One. • How far propagate updates? • Flooded to all nodes. • One update, global distribution. • Scaling problems due to flooding • As we’ll see next lecture, the characteristics of distance vector… • …are very different • …hint at a much better solution CE 151 - Advanced Networks
Dijstra Shortest-Path Algorithm • Breadth-first search of paths, by increasing path cost, for best paths to all destinations. Terminate when path has been found for all destinations. • Maintain two sets • Destinations for which shortest paths have been found. • Permanently labeled destinations P • Initialize with self • Destinations for which candidate shortest paths have been found. • Temporarily labeled destinations T • Initialize with my neighbors. • Iterate • Move shortest path in T, say for destination D, to P • Add routes for D’s neighbors, that are extensions of the path to T, to T if they are shorter than the current path in T for each neighbor. The “relaxation” step. • Repeat until a route has been added to P for all destinations CE 151 - Advanced Networks
More formally… • Eis the set of edges. • wij is the weight of the link between nodes i and j. • P and T… see previous slide. • P and T entries are triples, <d, p, w>: • d is the destination • p is the predecessor • w is the link weight CE 151 - Advanced Networks
B,2 C, 7 B,2 C, 2 3 2 3 2 A,0 D, A,0 F, D, E, 2 2 6 1 E,4 F, 4 G, H, G, H, B,2 B,2 C, C, D, D, A,0 A,0 F,6 F, E,4 E,4 G,5 G,5 H, H, B,2 C, C,9 B,2 D, D, A,0 A,0 F,6 F,6 E,4 E,4 G,5 H,8 G,5 H,8 C,9 B,2 D,10 A,0 F,6 E,4 G,5 H,8 Dijkstra… path cost CE 151 - Advanced Networks
Translating to a Protocol • Dijkstra requires a “centralized” implementation • Maintain a full graph of the network, on an event-driven basis • Re-compute routes as the graph changes • Flood changes to your links • “Brute-force” protocol. • Straight-forward, easy to understand • Inefficient… lots of overhead CE 151 - Advanced Networks
Review • Dijkstra • Iterates on “next shortest path” • Requires centralized computation • LS protocols • Is an IGP • Implements a centralized routing model • Floods link-state updates describing current state of its links • “Tell the rest of the network about your neighbors” • Use Dijkstra algorithm because it is most efficient shortest-path algorithm CE 151 - Advanced Networks
The Challenge of Internet Routing • Independent routing computations at each router… • Need to compute paths that… • Support destination-based forwarding • Are shortest • Are loop-free • This is trickier than it looks… CE 151 - Advanced Networks
Examples illustrating challenges of distributed routing… CE 151 - Advanced Networks
Correct solution depends on combination of routing algorithm and algebra used for metrics. CE 151 - Advanced Networks
OSPF CE 151 - Advanced Networks
OSPF • OSPF = Open Shortest Path First • The most widely used routing protocol • The complexity of OSPF is significant • History: • 1989: RFC 1131 OSPF Version 1 • 1991: RFC1247 OSPF Version 2 • 1994: RFC 1583 OSPF Version 2 (revised) • 1997: RFC 2178 OSPF Version 2 (revised) • 1998: RFC 2328 OSPF Version 2 (current version) CE 151 - Advanced Networks
What We Cover… • Messages • Router IDs • Flooding process • Metrics • Designated routers • Areas CE 151 - Advanced Networks
OSPF Messages • An OSPF message can contain one of five packet types. • OSPF is embedded directly in an IP frame (doesn’t use UDP) • Protocol field is set to 89 (OSPF) • Destination address is typically set to one of two multicast addresses: • 224.0.0.5 (“AllSPFRouters”… Hello messages) or • 224.0.0.6 (“AllDRouters”… routing info to “Designated Routers”). • If the OSPF packet is encapsulated in an Ethernet frame, the destination MAC address is also a multicast address: • 01-00-5E-00-00-05 or 01-00-5E-00-00-06 CE 151 - Advanced Networks
OSPF Packet Types • Hello: Used to establish and maintain adjacency with other OSPF routers. • DBD: The database description (DBD) packet contains an abbreviated list of the sending router’s link-state database and is used by receiving routers to check against the local link-state database. • LSR: Receiving routers can then request more information about any entry in the DBD by sending a link-state request (LSR). • LSU: Link-state update (LSU) packets are used to reply to LSRs and to announce new information. LSUs contain seven different types of link-state advertisements (LSA). • LSAck: When an LSU is received, the router sends a link-state acknowledgment (LSAck) to confirm receipt of the LSU. CE 151 - Advanced Networks
OSPF Message Header 2: current version is OSPF V2 ID of the Area from which the packet originated Message types: 1: Hello (tests reachability) 2: Database description 3: Link Status request 4: Link state update 5: Link state acknowledgement 0: no authentication 1: Cleartext password 2: MD5 checksum (added to end packet) Standard IP checksum taken over entire packet Authentication passwd = 1: 64 cleartext password Authentication passwd = 2: 0x0000 (16 bits) KeyID (8 bits) Length of MD5 checksum (8 bits) Nondecreasing sequence number (32 bits) Prevents replay attacks CE 151 - Advanced Networks
Router ID Router ID Router ID Router ID Router ID Router ID RouterIDs • Router ID plays an important role in OSPF • Uniquely identifies each router in a routing domain • Used in Designated Router election process (explained later) • Router ID is an IP address of a router • Cisco routers use following algorithm to determine Router ID • IP address configured with OSPF router-id command • If not configured, use highest IP address of a loopback interface • If no loopback interfaces, use highest active IP address of physical interface • Advantage of loopback interface is it cannot fail CE 151 - Advanced Networks
OSPF Hello Packets • Used to • Discover OSPF neighbors and establish neighbor adjacencies • Elect the Designated Router and Backup Designated Router on multiaccess networks such as Ethernet and Frame Relay • Negotiate • Hello interval (e.g. 10 sec on Ethernet segments) • Dead interval: time to declare neighbor down (4x Hello interval) • Network type • Five network types • Point-to-point • Point-to-multipoint • Broadcast multiaccess (Ethernet) • Nonbroadcastmultiaccess (Frame Relay) • Virtual links CE 151 - Advanced Networks
OSPF LSU Packets • Link State Update (LSU) packets • Used for OSPF routing updates • Contain one or more LSAs • Link State Advertisements (LSAs) • Contain route information for destination networks • There are 11 types of LSAs CE 151 - Advanced Networks
Link State Advertisement (LSA) • The LSA of router 10.10.10.1 is as follows: • Link State ID: 10.10.10.1 = can be Router ID • Advertising Router: 10.10.10.1 = Router ID • Number of links: 3 = 2 links plus router itself • Description of Link 1: Link ID = 10.1.1.1, Metric = 4 • Description of Link 2: Link ID = 10.1.2.1, Metric = 3 • Description of Link 3: Link ID = 10.10.10.1, Metric = 0 Each router sends its LSA to all routers in the network(using a method called reliable flooding) CE 151 - Advanced Networks
LSA Format LSA Header Link 1 Link 2 CE 151 - Advanced Networks
OSPF Metrics • The OSPF metric is called cost. The following passage is from RFC 2328: • A cost is associated with the output side of each router interface. This cost is configurable • RFC 2328 does not specify which values should be used to determine the cost. • In Cisco IOS • Link cost is 108 ÷ link bandwidth. • Reference bandwidth (108) can be changed with auto-cost referencebandwidth • Modify link bandwidth value with bandwidth CE 151 - Advanced Networks
Link State Database • The collection of all LSAs is called the link-state database • Each router has and identical link-state database • Useful for debugging: Each router has a complete description of the network • If neighboring routers discover each other for the first time, they will exchange their link-state databases • The link-state databases are synchronized using reliable flooding CE 151 - Advanced Networks
Link State Database Each router has a database which contains the LSAs from all other routers CE 151 - Advanced Networks
Neighbor Discovery • Router multicasts OSPF Hello packets on all OSPF-enabled interfaces. • If two routers share a link, they can become neighbors, and establish an adjacency • After becoming a neighbor, routers exchange their link state databases Scenario:Router 10.1.10.2 restarts CE 151 - Advanced Networks
Discovery of adjacency Neighbor discovery and database synchronization Scenario:Router 10.1.10.2 restarts After neighbors are discovered the nodes exchange their databases Sends database description. (description only contains LSA headers) Sends empty database description Database description of 10.1.10.2 Acknowledges receipt of description CE 151 - Advanced Networks
Regular LSA exchanges 10.1.10.2 explicitly requests each LSA from 10.1.10.1 10.1.10.1 sends requested LSAs 10.1.10.2 has more recent value for 10.0.1.6 and sends it to 10.1.10.1(with higher sequence number) CE 151 - Advanced Networks
Dissemination of LSA-Update • A router sends and refloods LSA-Updates, whenever the topology or link cost changes. (If a received LSA does not contain new information, the router will not flood the packet) • Exception: Infrequently (every 30 minutes), a router will flood LSAs even if there are no new changes. • Acknowledgements of LSA-updates: • explicit ACK, or • implicit via reception of an LSA-Update CE 151 - Advanced Networks
Why Designated Routers? • Large number of adjacencies • Full mesh of adjacencies • n(n - 1)/2 adjacencies • Excessive load from flooding LSAs CE 151 - Advanced Networks
Electing Designated Router • OSPF elects a Designated Router (DR) on multiaccess networks • DR is collection and distribution point for LSAs on network • Backup Designated Router (BDR) also elected for case where DR fails 224.0.0.5 224.0.0.6 CE 151 - Advanced Networks