RFC 1245
OSPF Protocol Analysis
OSPF protocol analysis ๐ฆ
okay bestie, this is RFC 1245 ๐ and it's called "OSPF protocol analysis" โจ. It comes from the Network Working Group, with J. Moy as editor, and J. Moy writes from Proteon, Inc. ๐ It was published in July 1991 ๐ . It's an informational memo, so it's just sharing info with the Internet community and not a standard ๐ธ. The header doesn't list anything it obsoletes or updates.
Status of this Memo
so this memo is here to give the Internet community information ๐ง It doesn't specify any Internet standard. Distribution is unlimited, so share it with your whole group chat ๐ If you have comments, send them to ospf@trantor.umd.edu ๐ฌ
Abstract
okay so this is the first of two reports on the OSPF protocol ๐ฅ The IAB/ IESG need these reports before an Internet routing protocol can move up to Draft Standard Status ๐ OSPF is a TCP/IP routing protocol made to run inside one Autonomous System, which makes it an Interior Gateway Protocol ๐
Version 1 of OSPF was published in RFC 1131 ๐ Version 2 came later and is documented in RFC 1247 โจ All the differences between version 1 and version 2 are explained in Appendix F of RFC 1247. This report is about OSPF Version 2 ๐ฆ
This report sums up the key features of OSPF V2. It also looks at how the protocol will perform and scale on the Internet ๐
1.0 Introduction
so this document covers how OSPF V2 meets the requirements the IAB/IESG set for an Internet routing protocol to reach Draft Standard state ๐ Those requirements are summarized below, and the rest of the report shows how OSPF V2 hits each one ๐
- What are the key features and algorithms of the protocol? โจ
- How much link bandwidth, router memory and router CPU cycles does the protocol consume under normal conditions? ๐ง
- For these metrics, how does the usage scale as the routing environment grows? This should include topologies at least an order of magnitude larger than the current environment. ๐
- What are the limits of the protocol for these metrics? (I.e., when will the routing protocol break?) ๐
- For what environments is the protocol well suited, and for what is it not suitable? ๐
1.1 Acknowledgments
OSPF was developed by the OSPF Working Group of the Internet Engineering Task Force ๐ซถ
2.0 Key features of the OSPF protocol
this section is the highlight reel โจ OSPF is an Internal gateway protocol, built to be used inside a single Autonomous System ๐ง It's link-state (SPF-based), which is different from the distance-vector or Bellman-Ford approach you get in protocols like RIP ๐ฅ
Individual link state advertisements (LSAs) describe pieces of the OSPF routing domain (the Autonomous System) ๐ฆ They get flooded all over the routing domain and together they form the link state database ๐ธ Every router has an identical link state database, and a reliable flooding algorithm keeps them all in sync ๐ From that database, each router builds its routing table by calculating a shortest-path tree with itself as the root. This calculation is commonly called the Dijkstra procedure ๐
LSAs are small, bestie ๐ Each one describes just one little piece of the routing domain: either the neighborhood of a single router, the neighborhood of a single transit network, a single inter-area route (see below), or a single external route ๐ซถ
Here are the other key features of OSPF ๐
- Adjacency bringup. Certain pairs of OSPF routers become "adjacent" โจ When an adjacency forms, the two routers sync up their link state databases by swapping database summaries in OSPF Database Exchange packets ๐ After that, adjacent routers keep their databases in sync through the reliable flooding algorithm ๐ฆ Routers connected by serial lines always become adjacent ๐ฅ On multi-access networks (like ethernets or X.25 PDNs), every router attached to the network becomes adjacent to both the Designated Router and the Backup Designated router ๐
- Designated router. A Designated Router gets elected on all multi-access networks (like ethernets or X.25 PDNs) ๐ That network's Designated Router originates the network LSA that describes the network's local environment ๐ It also plays a special role in flooding, since every router on the network syncs its link state database by sending and receiving LSAs to and from the Designated Router during the flooding process ๐
- Backup Designated Router. A Backup Designated Router is elected on multi-access networks to make it smoother when the Designated Router changes, which happens when the current one disappears ๐ง In that case the Backup DR takes over, and it doesn't have to go through the adjacency bringup process on the LAN, because it already did that in its backup role โจ Even before anyone notices the Designated Router is gone, the Backup DR enables the reliable flooding algorithm to keep going in the DR's absence ๐
- Non-broadcast multi-access network support. OSPF treats these networks (like X.25 PDNs) pretty much like LANs, so a DR gets elected and a network LSA gets generated ๐ธ The catch is that routers attached to these networks need extra configuration info to find each other at first ๐
- OSPF areas. OSPF lets you break an Autonomous System into regions called areas ๐ฆ This is useful for a few reasons. First, it adds an extra layer of routing protection, since routing within an area is shielded from all information outside that area ๐ก๏ธ Second, splitting an Autonomous System into areas lowers the CPU cost (in cycles) of the Dijkstra procedure ๐ง
- Flexible import of external routing information. In OSPF, each external route is imported into the Autonomous System in its own separate LSA ๐ That cuts down on flooding traffic, since external routes change a lot and you only want to flood the changes ๐ฅ It also allows partial routing table updates when just one external route changes โจ OSPF external LSAs have some extra tricks too ๐ A forwarding address can go in the external LSA, which skips extra hops at the edge of the Autonomous System ๐ง There are two levels of external metrics you can set, type 1 and type 2 ๐ External routes can also be tagged with a 32-bit number (the external route tag, which is often used as the AS number of the route's origin), and that makes external route management way easier in a transit Autonomous System ๐
- Four level routing hierarchy. OSPF has four levels of routing hierarchy, or trust model: intra-area, inter-area, external type 1 and external type 2 routes ๐ That gives you multiple levels of routing protection and simpler routing management across an Autonomous System ๐ซถ
- Virtual links. By letting you configure virtual links, OSPF takes away topological limits on how areas can be laid out in an Autonomous System ๐ฆ
- Authentication of routing protocol exchanges. Every time an OSPF router gets a routing protocol packet, it authenticates that packet before processing it any further ๐
- Flexible routing metric. In OSPF, metrics are assigned to outbound router interfaces ๐ธ A path's cost is the sum of its component interfaces ๐ The admin can set the routing metric to reflect any mix of network characteristics, like delay, bandwidth, dollar cost and so on ๐
- Equal-cost multipath. When multiple best-cost routes to a destination exist, OSPF finds them all, and they can then be used to load share traffic to that destination โ๏ธ
- TOS-based routing. You can calculate separate sets of routes for each IP type of service ๐ For example, low delay traffic could go one way while high bandwidth traffic goes another ๐ฅ You do this by (optionally) assigning one metric per IP TOS to each outgoing router interface ๐
- Variable-length subnet support. OSPF supports variable-length subnet masks by carrying a network mask with each advertised destination ๐ง
- Stub area support. Some routers don't have much memory, so areas can be configured as stubs ๐ฅบ External LSAs (which often make up most of the Autonomous System) are not flooded into or throughout stub areas ๐ Routing to external destinations in stub areas relies solely on a default ๐
3.0 Cost of the protocol
this section looks at how OSPF will perform and scale on the Internet ๐ We're focusing on four areas ๐
- Link bandwidth. OSPF uses a reliable flooding mechanism to keep router link state databases synchronized ๐ฅ The individual components of those databases (the LSAs) get refreshed pretty rarely, every 30 minutes, at least when nothing in the topology changes โฐ Still, as the database grows, the link bandwidth the flooding procedure uses also grows ๐
- Router memory. An OSPF link state database can get huge, especially when there are lots of external LSAs ๐ง That means routers need a good chunk of memory ๐
- CPU usage. In OSPF, this is mostly about how long the shortest path calculation (the Dijkstra procedure) takes to run ๐งฎ That time depends on how many routers are in the OSPF system ๐
- Role of the Designated Router. The Designated Router sends and receives more packets on a multi-access network than the other routers on that network do ๐ฆ Switching over to a new Designated Router after the old one fails also takes some time, especially when the Backup Designated Router and the Designated Router both fail at once ๐ญ Because of this, you might want to limit how many routers connect to a single network ๐
The rest of the section analyzes these areas and estimates how many resources OSPF will use, both now and later ๐ฎ To help with that, the next section presents some data collected from real OSPF field deployments ๐
3.1 Operational data
OSPF has been deployed in a bunch of places across the Internet ๐ For a summary of those deployments, see [1] ๐ Some stats were gathered from that real-world experience through local network management facilities ๐ ๏ธ Here's what they look like:
TABLE 1. Pertinent operational statistics
Statistic BARRNet NSI OARnet
___________________________________________________________________
Data gathering (duration) 99 hrs 277 hrs 28 hrs
Dijkstra frequency 50 min 25 min 13 min
External incremental frequency 1.2 min .98 min not gathered
Database turnover 29.7 min 30.9 min 28.2 min
LSAs per packet 3.38 3.16 2.99
Flooding retransmits 1.3% 1.4% .7%
the first row of that table shows how long stats were gathered on each of the three networks โฑ๏ธ Here's the rundown on the rest ๐
- Dijkstra frequency. In OSPF, the Dijkstra calculation only involves the routers and transit networks that belong to the AS ๐งฎ It only runs when something in the system changes, like a serial line between two routers going down โก In these operational systems the Dijkstra process runs only occasionally, and the most frequent it ever got was every 13 minutes ๐ฅฐ
- External incremental frequency. ๐ฆ Okay so, when an external route changes, only its entry in the routing table gets recalculated. These are called external incremental updates. ngl they happen way more often than the Dijkstra procedure. (In other words, incremental updates are saving quite a bit of processor time ๐ง โจ.)
- Database turnover. ๐ In OSPF, link state advertisements get refreshed at a minimum of every 30 minutes. New advertisement instances get sent out more often when some part of the topology changes. The table shows that, even with topological changes taken into account, an advertisement is on average updated close to only every 30 minutes ๐ฐ๏ธ. This statistic gets used in the link bandwidth calculations below. Note that NSI actually shows advertisements updated every 30.7 (> 30) minutes. This probably means that earlier in the measurement period, NSI had a smaller link state database than it did at the end ๐ค.
- LSAs per packet. ๐ฆ In OSPF, multiple LSAs can be included in either Link State Update or Link State Acknowledgment packets. The table shows that, on average, around 3 LSAs ride in a single packet. This stat gets used when calculating the header overhead in the link bandwidth calculation below. It was derived by dividing the number of LSAs flooded by the number of (non-hello) multicasts sent ๐งฎ.
- Flooding retransmits. ๐ This counts both retransmissions of LS Update packets and Link State Acknowledgment packets, as a percentage of the original multicast flooded packets. The table shows that flooding is working really well, so retransmits can be ignored in the link bandwidth calculation below ๐ .
3.2 Link bandwidth ๐ธ
Okay, now we're getting to the juicy part ๐. In this section we try to figure out how much link bandwidth gets eaten up by the OSPF flooding process. The amount of link bandwidth consumed goes up linearly with the number of advertisements in the OSPF database. We assume that the majority of advertisements in the database will be AS external LSAs (operationally this is true, see [1]).
From the statistics in Section 3.1, any particular advertisement gets flooded (on average) every 30 minutes. Also, three advertisements fit in a single packet. (This packet could be either a Link State Update packet or a Link State Acknowledgment packet. In this analysis we pick the Link State Update packet, since it's the larger one.) An AS external LSA is 36 bytes long. Add one third of a packet header (IP header plus OSPF Update packet) and you get 52 bytes. Sending this much data every 30 minutes gives an average rate of 23/100 bits/second ๐ฅน.
If you want to limit your routing traffic to 5% of the link's total bandwidth, these are the max database sizes you get ๐:
TABLE 2. Database size as a function of link speed (5% utilization)
Speed # external advertisements
_____________________________________
9.6 Kb 2087
56 Kb 12,174
Higher line speeds aren't included, because other factors (like router memory) will limit database size before line speed becomes a factor ๐ โโ๏ธ. Note that in the above calculation, the size of the data link header was not taken into account. Also, while the OSPF database is likely to be mostly external LSAs, other LSAs have a size too. As a ballpark estimate, router links and network links are generally three times as large as an AS external link, with summary link advertisements being the same size as external link LSAs.
๐จ quick reminder: the data link header is not in these numbers, so keep that in mind!
OSPF uses considerably less link bandwidth than RIP. This has been shown experimentally on the NSI network. See Jeffrey Burgan's "NASA Sciences Internet" report in [3] ๐.
3.3 Router memory ๐ง
Memory requirements in OSPF are dominated by the size of the link state database. Like in the last section, it's probably safe to assume most of the advertisements in the database are external LSAs. While an external LSA is 36 bytes long, an OSPF implementation generally stores it together with some support data. So a good estimate of router memory consumed by an external LSA is probably 64 bytes. That means a database with 10,000 external LSAs will eat 640K bytes of router memory. OSPF definitely requires more memory than RIP ๐.
Using the Proteon P4200 implementation as an example, the P4200 has 2Mbytes of memory. This is shared between instruction, data and packet buffer memory. The P4200 has enough memory to store 10, 000 external LSAs and still have enough packet buffer memory left to run a reasonable number of interfaces ๐ช.
Also, note that while the OSPF database is likely to be mostly external LSAs, other LSAs have a size too. As a ballpark estimate, router links and network links consume generally three times as much memory as an AS external link, with summary link advertisements being the same size as external link LSAs.
3.4 Router CPU ๐ฅ๏ธ
Assume that, as the OSPF routing domain grows, the number of interfaces per router stays bounded. Then the Dijkstra calculation is of order (n * log (n)), where n is the number of routers in the routing domain. (This is the complexity of the Dijkstra algorithm in a sparse network.) Of course, how expensive Dijkstra really is depends on the implementation ๐คทโโ๏ธ.
We have no experimental numbers for the cost of the Dijkstra calculation in a real OSPF implementation. However, Steve Deering presented results for the Dijkstra calculation in the "MOSPF meeting report" in [3]. Steve's calculation was done on a DEC 5000 (10 mips processor), using the Stanford internet as a model. His graphs are based on numbers of networks, not numbers of routers. However, if we extrapolate that the ratio of routers to networks stays the same, the time to run Dijkstra for 200 routers in Steve's implementation was around 15 milliseconds โฑ๏ธ.
This seems like a reasonable cost, especially when you notice that the Dijkstra calculation is run very infrequently in operational deployments. In the three networks presented in Section 3.1, Dijkstra was run on average only every 13 to 50 minutes. Since Dijkstra runs so rarely, it seems likely that OSPF overall consumes less CPU than RIP, because of RIP's frequent updates, which require routing table lookups ๐ซถ.
As another example, the routing algorithm in MILNET is SPF-based. MILNET's current size is 230 nodes, and its routing calculation still consumes less than 5% of the MILNET switches' processor bandwidth [4]. Because the routing algorithm in MILNET adapts to network load, it runs the Dijkstra process quite frequently (on the order of seconds, compared to OSPF's minutes). However, it should be noted that the routing algorithm in MILNET incrementally updates the SPF-tree, while OSPF rebuilds it from scratch at each Dijkstra calculation ๐ฅ.
OSPF's Area capability provides a way to reduce Dijkstra overhead, if it becomes a burden. The routing domain can be split into areas. The extent of the Dijkstra calculation (and its complexity) is limited to a single area at a time ๐งฉ.
3.5 Role of Designated Router ๐
This section looks at the number of routers that can be attached to a single network. As the number of routers attached to a network grows, so does the amount of OSPF routing traffic seen on the network. Some of this is Hello traffic, which is generally multicast by each router every 10 seconds. This burden is borne by all routers attached to the network. However, because of its special role in the flooding process, the Designated Router ends up sending more Link State Updates than the other routers on the network. Also, the Designated Router receives Link State Acknowledgments from all attached routers, while the other routers just receive them from the DR. (Although it's important to note that the rate of Link State Acknowledgments will generally be limited to one per second from each router, because acknowledgments are generally delayed.)
So, if the amount of protocol traffic on the LAN becomes a limiting factor, the limit is likely to be detected in the Designated Router first. However, such a limit is not expected to be reached in practice. The amount of routing protocol traffic generated by OSPF has been shown to be small (see Section 3.2). Also, if need be, OSPF's hello timers can be configured to reduce the amount of protocol traffic on the network. Note that more than 50 routers have been simulated attached to a single LAN (see [1]). Also, in interoperability testing, 13 routers have been attached to a single ethernet with no problems encountered ๐.
Another factor in the number of routers attached to a single network is the cutover time when the Designated Router fails. OSPF has a Backup Designated Router, so the cutover does not have to wait for the new DR to synchronize (the adjacency bring-up process mentioned earlier) with all the other routers on the LAN. As a Backup DR, it had already synchronized. However, in those rare cases when both the DR and Backup DR crash at the same time, the new DR will have to synchronize (via the adjacency bring-up process) with all other routers before becoming functional. Field experience shows that this synchronization process takes place in a timely fashion (see the OARnet report in [1]). However, this may be an issue in systems that have many routers attached to a single network ๐ซ .
In the unlikely event that the number of routers attached to a LAN becomes a problem, either due to the amount of routing protocol traffic or the cutover time, the LAN can be split into separate pieces (similar to splitting up the AS into separate areas) โ๏ธ.
3.6 Summary ๐ธ
In summary, the most likely limitation on the size of an OSPF system is available router memory. We have given 10,000 as the number of external LSAs that can be supported by the memory available in one configuration of a particular implementation (the Proteon P4200). Other implementations may vary, and nowadays routers are being built with more and more memory. Note that 10,000 routes is considerably larger than the largest field implementation (BARRNet, which at 1816 external LSAs is still very large) ๐.
Note that there may be ways to reduce database size in a routing domain. First, the domain can make use of default routing, which reduces the number of external routes that need to be imported. Second, an EGP can be used that will transport its own information through the AS, instead of relying on the IGP (OSPF in this case) to transfer the information for it (the EGP). Third, routers having insufficient memory may be able to be assigned to stub areas (whose databases are drastically smaller). Lastly, if the Internet moved away from a flat address space, the amount of external information imported into an OSPF domain could be reduced drastically ๐.
While not as likely, there could be other issues that would limit the size of an OSPF routing domain. If there are slow lines (like 9600 baud), the size of the database will be limited (see Section 3.2). Dijkstra may get expensive when there are hundreds of routers in the OSPF domain, although at that point the domain can be split into areas. Finally, when there are many routers attached to a single network, there may be undue burden imposed on the Designated Router, although at that point a LAN can be split into separate LANs ๐.
4.0 Suitable environments ๐
Suitable environments for the OSPF protocol range from large to small. OSPF is particularly suited to transit Autonomous Systems, for the following reasons. OSPF can accommodate a large number of external routes. In OSPF, importing external information is very flexible, with provisions for a forwarding address, two levels of external metrics, and the ability to tag external routes with their AS number for easy management. OSPF's ability to do partial updates when external information changes is also very useful on these networks ๐โจ.
When there are a lot of routers hanging off one single network, the Designated Router can end up with an undue burden ๐ฉ, but at that point the LAN can be split into separate LANs ๐ง. Problem solved, bestie.
4.0 Suitable environments โจ
Suitable environments for the OSPF protocol range from large to small ๐, so it's giving versatility, periodt ๐ .
OSPF is particularly suited for transit Autonomous Systems ๐ for the following reasons. First, OSPF can accommodate a large number of external routes ๐. Second, the way it imports external information is super flexible ๐: it has provisions for a forwarding address, two levels of external metrics, and the ability to tag external routes with their AS number so they're easy to manage ๐. And OSPF's ability to do partial updates when external information changes is so useful on these networks ๐ซถ. Obsessed.
OSPF is also suited for smaller Autonomous Systems, whether they stand alone or are stub Autonomous Systems ๐ฆ, because of its wide array of features: fast convergence, equal-cost-multipath, TOS routing, areas, etc. ๐
5.0 Unsuitable environments ๐
OSPF has a very limited ability to express policy ๐. Basically, its only policy mechanisms are in the establishment of a four level routing hierarchy: intra-area, inter-area, type 1 and type 2 external routes. A system wanting more sophisticated policies would have to be split up into separate ASes, running a policy-based EGP between them ๐ฅ. Not me needing a whole new AS just for policy ๐ญ.
6.0 Reference Documents ๐
The following documents have been referenced by this report:
[1] Moy, J., "Experience with the OSPF protocol", RFC 1246, July 1991.
[2] Moy, J., "OSPF Version 2", RFC 1247, July 1991.
[3] Corporation for National Research Initiatives, "Proceedings of the Eighteenth Internet Engineering Task Force", University of British Columbia, July 30-August 3, 1990.
Security Considerations ๐
Security issues are not discussed in this memo. Zero security talk here, so keep that in mind, bestie ๐.
Author's Address ๐ฆ
John Moy
Proteon Inc.
2 Technology Drive
Westborough, MA 01581
Phone: (508) 898-2800
Email: jmoy@proteon.com
๐ฆ where this page comes from
- ietf: rfc1245 1991-07
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms