Upload
mohammed-faris-majeed
View
85
Download
0
Tags:
Embed Size (px)
Citation preview
A Tour through OSPF
Xipeng Xiao
ACS Lab, Dept. of Computer Sci.
Michigan State University
What’s OSPF
• Open Shortest Path First– a routing protocol based on Dijkstra’s SPF Algorithm
• One kind of Interior Gateway Protocol (IGP), runs within an Autonomous Systems (AS)– the Internet is divided into many ASs
– within AS runs IGP: • examples: RIP, IGRP, EIGRP, OSPF, IS-IS
– outside AS runs EGP: • BGP is a standardized EGP
– in OSPF, an AS is further divided into multiple Areas
What’s OSPF (cont’d)• Link State Protocol
– link state vs. distance vector
– link: network interface
– link state: description of the network interface• IP address, network mask, network type, bandwidth, etc.
– a router runs one OSPF algorithm, keeps one link state database (LSDB) for every area it belongs to. The router then uses the link state database to calculate its routing table
• if a router belongs to multiple areas, then it runs multiple OSPF algorithms, keeps multiple LSDBs.
– All LSDBs of all the routers within the same area are fully synchronized
• identical after reaching the stable state
– Synchronization is reached by exchanging 5 types of link state advertisements between adjacent routers
• router link, network link, network summary link, ASBR summary link, external link
– The topology of the network is represented by the LSDB
Key features of OSPF• Link state protocol, not distance vector-based
• Each router has its own LSDB. The route table is calculated from the LSDB.
• Requiring less amount of advertisement traffic by grouping networks into areas
• Hierarchical routing– topology of an area is hidden from outside the area
• Supporting Variable Length Subnet Mask (VLSM) – because the network mask is carried in every advertisement
• All OSPF protocol messages are authenticated– two authenticated schemes: simple password, encryption
• Being able to use different routes for different TOS
• Supporting Equal-cost multiple paths for the same destination– enabling load balancing
Paradigm of the Internet
ISP
ASRouter
BGP
AS(OSPF)
Router
BGP
Router
Router
AS
RouterBGP
AS
RouterBGP
Router
Router
A Sample Autonomous System
Routing Table Calculation from A Directed Graph
• For each node (router), makes it as the root, uses the Dijkstra’s Algorithm to calculate the Shortest-Path-Tree
• Routing table structureDestination
IDMask Next hop Cost interface
In order to calculate the routing table ...
• The goal of a routing protocol is to calculate the routing table
• In order to calculate the routing table, we must solve these problems – Given a topology graph of an AS, how to derive the
corresponding directed graph
– How to come up with the topology graph• How to reflect the topology change in a timely fashion
• reduce the amount of control traffic, reduce the processing overhead
– How to assign cost to each edge in the graph
• Desirable feature: fast convergence to a stable routing table
From Topology Graph to Directed Graph
Other Problems to solved
• How to assign cost to each edge in the graph– An edge corresponds to a link (interface)
– By default, the cost of the link is • 108/link bandwidth (in bps)
– The cost can be manually configured by the network administrator
• How to come up with the topology graph– The topology graph is represented by the link state database
– Every node exchanges connectivity information with its adjacent nodes to build the link state database
• how to define adjacency
• A node can be: a router or a network
• We must know all the neighbors of a node in order to come up with the topology graph
Router Link Advertisement (Type 1) and Network Link Advertisement (Type 2)
• Router link Advertisement : every router tells its adjacent nodes which nodes (routers, networks) it can reach– RT 1: link #1 to network 111, link #2 to network 113
• Network link Advertisement– A network is a group of hosts.
• It cannot announce its connectivity by itself
• There must be a router to announce connectivity on behalf of the network
– Designated router (DR)
– Backup designated router (BDR)
– Network link advertisement• announce all the routers attached to this network
• RT 4 for network 113: – link #1 to RT1, link #2 to RT2, link #3 to RT3, link #4 to RT4
How to elect DR & BDR
• Hello Protocol runs among neighbors– to elect the DR & BDR
• Each router has a priority configured by the administrator
• if no DR or BDR, all the neighbors will hold an election– highest priority => DR
– second highest priority => BDR
– tie break
• Every other node becomes adjacent node of the DR and BDR
– to detect if the adjacent node is functional or not
– The introduction of DR and BDR greatly reduces the number of adjacent node pairs
• from O(n2) to O(n1)
Neighbors and Adjacency
• What’s a neighbor– Depends on the kind of network
• Point-to-Point link: the router at the other end
• Broadcast Multiple Access network: all other routers
• Non-Broadcast Multiple Access network (NBMA): neighbors are manually specified by the network administrators
• What’s adjacency– Not all neighbors become adjacent nodes
– Depends on the kind of network• Point-to-Point link: neighbor => adjacent node
• Broadcast Multiple Access network: – DR and BDR are adjacent nodes of every other node
– only DR and BDR are adjacent nodes of any node
• Non-Broadcast Multiple Access network (NBMA): – only DR and BDR are adjacent nodes of any node
Neighbors and Adjacency (cont’d)
• Routing information (link state advertisement) is exchanged only between adjacent nodes
• The introduction of DR and BDR greatly reduces the number of adjacent node pairs – from O(n2) to O(n1)
– many fewer link state advertisement messages
• With the router link advertisement and network link advertisement, it is “enough” to derive the topology within the AS
• uses the techniques introduced before, we can calculate the routes for each node to very other node
Link State Database Synchronization
External Link Advertisement (Type 5)
• A router must also know how to reach the destinations outside the AS
• Autonomous System Border Routers (ASBR) learn routes to destinations outside the AS from BGP
• The ASBR redistributes these routes to “ALL” the routers within the AS
AS
Router
Router
Router
BGP
BGP
OSPF
OSPFType 1
Type 2
External Link Advertisement (cont’d)
• All routers within the AS calculate routes to destinations outside the AS based on the external link advertisements– each external link also has a cost associated with it
• Type 1 cost: comparable with the OSPF cost
• Type 2 cost: so much more significant than the OSPF cost that the OSPF cost can be omitted in calculating the cost of the path
• If there are type 1 routes and type 2 routes to the same destination, type 1 routes are always preferred than type 2 routes
To improve the Performance ...
• So far, the routers within an AS can calculate routes to all the reachable destinations, internal or external.
• OSPF can do much better than that …– distribute link state information in a timely fashion
• send out link state advertisements immediately after the link states change
– the link state advertisements are flooded throughout the whole AS. Upon receiving an advertisement, a router may have to modify its own link state database and run Dijkstra’s Algorithm to recalculate the routing table
• requires significant amount of processing
– In order to reduce the processing overhead, we must limit the size of the area which will be affected by a link state change
OSPF Area
• What’s an Area?– Groups of networks and routers
– In the router configuration, an area is configured as ranges of addresses
• example: 198.15.2.0 to 198.15.3.FF, 198.15.7.*
• An area’s topology is hidden from outside the area
• A router in an area is UNAWARE of the topology outside the area
• router link advertisements and network link advertisements are flooded only throughout the area, not the entire AS
• External link advertisements are still flooded throughout the entire AS
Network Summary Link Advertisement (Type 3)
• Since network link advertisements and router link advertisements are flooded only throughout an area, we need some means to tell a router in an area how to reach destinations outside the area but within the same AS
• Different areas are connected by Area Border Routers (ABR).
• A special area called the Backbone area (ID 0.0.0.0) will carry transit traffic from one area to another– The backbone is an area consisting of networks and routers
(including ABRs)
– all ABRs belong to the backbone area
The Backbone Area
• The backbone area must be contiguous– Otherwise some areas may become unreachable from another
area
• In case of being uncontiguous, use virtual link(s)– uncontiguous examples:
• merging two backbone areas (of two organizations) into one
• want to add a new area but cannot add it to the backbone
• Virtual link: link between two ABRs– the network administrator must manually configured the two
ends of the virtual link
BackboneArea
Area 1Router
OSPF
Area 2Router
Area 4Router
Area 3Router
Network Summary Link Advertisement (cont’d)
• Using its routing table, each ABR summarizes the reachability information of its area and distributes this information to other routers in the backbone– summarize in the sense of route aggregation
– example: • the ranges of area 1: 198.15.1.* to 198.15.15.* (15 class C
networks)
• summarized into only 1 link:– link ID: 198.15.0.0, mask: FF.FF.F0.00, cost: XX
– cost of the summarized link set to the minimum of all links to each individual networks
• The backbone routers have reachability information about every networks in the entire AS
Network Summary Link Advertisement (cont’d)
• The backbone ABRs in turn summarize the reachability information to routers in the non-backbone areas
• Every router in the AS knows how to reach other destination in the same AS
ASBR Summary Link Advertisement (Type 4)
• Only information about external link to remote destinations is not enough. We must also know how to reach the ASBRs of the AS
• When an ABR generates network summary link advertisements, it also generates an advertisement for each ASBR with that area (if any)
Routing Information Flows among areas
Stub Area
• In a LSDB, number of external links >> number of internal links– big memory and processing burden for a router
• For some networks, shortest routes to destinations may not always be required. Sub-optimal routes are acceptable.– These networks and the associated routers can be grouped as a
stub area
• External link advertisements are not flooded into the stub area.– A route to the default router is advertised to the routers within
the stub area instead
• The introduction of Stub Area greatly reduce the resource requirement of the routers within these areas
The Flooding Procedure of Link State Advertisement
• Advertisements are sent only to adjacent nodes
• In order for the information to reach all routers in the area, we must have a flooding procedure
• Flooding is realized by relaying the advertisements hop-by hop
• Upon receiving an advertisement message, the receiving router will start a validating process. If the message is valid, the receiving router will send an Ack to the sender
• If the Ack is not received within a timeout period, the sender will retransmit the message
The Link State Database (LSDB)
• LSDB is constructed from the five types of link advertisements
• Every advertisement has a sequence# associated with it. – The seq# is used to determine which advertisement instance is
newer
• Each advertisement in the LSDB has an Age associated with it. – If the age reach MAXAGE, that advertisement instance is
flushed
– Upon receiving a newer advertisement, the age is reset to 0
A Sample Autonomous System
Key features of OSPF
• Each router has its own LSDB. The route table is calculated from the LSDB.
• Requiring less amount of advertisement traffic by grouping networks into areas
• Supporting Variable Length Subnet Mask (VLSM) because the network mask is carried in every advertisement
• All OSPF protocol messages are authenticated– two authenticated schemes: simple password, encryption
• Being able to use different routes for different TOS
• Supporting Equal-cost multiple paths for the same destination– enabling load balancing