--- title: "Is OSPF Unpredictable or Just Unexpected?" url: https://blog.ipspace.net/2018/04/is-ospf-unpredictable-or-just-unexpected/ date: 2018-04-26 lastmod: 2018-04-26 author: "Ivan Pepelnjak" tags: ["OSPF","SDN","intent-based networking"] --- # Is OSPF Unpredictable or Just Unexpected? I was listening to a very interesting [Future of Networking with Fred Baker](http://packetpushers.net/podcast/podcasts/show-354-future-networking-fred-baker/) a long while ago and enjoyed Fred's perspectives and historical insight until Greg Ferro couldn't possibly resist the usual bashing of traditional routing protocols and praising of intent-based (or [flow-based](https://blog.ipspace.net/2015/11/packet-and-flow-based-forwarding/) or SDN or...) whatever. Here's what I understood he said around 35:17 > The problem with the dynamic or distributed algorithms is that they quite often do unexpected things. You might think it was a Freudian slip-of-tongue, but it seems to be a persistent mantra. Recently it [became](http://etherealmind.com/networking-complex-hard/) "*a fallacy that a network will ever be reliable or predictable*." Well, I totally believe that routing algorithms like OSPF would surprise Greg [or myself](https://blog.ipspace.net/2017/01/ospf-forwarding-address-yet-another/) (as I often admit during my [network automation workshops](http://www.ipspace.net/Hands-On_Network_Automation)), but that only means that with all the nerd knobs we added they became too complex for mere mortals to intuitively grasp their behavior. > **Note:** > > On a side note, I would love to see how [*expected*](https://www.youtube.com/watch?v=ARJ8cAGm6JE) the results of complex intent-based systems will be. Anyway, let's move from subjective *unexpected* to objective *unpredictable* or *non-deterministic*. Interestingly, with the clear split between information distribution (LSA flooding) and route computation (SPF algorithm), link-state routing protocols are one of the most predictable distributed algorithms out there, and can in the worst-case scenario result in temporary forwarding loops due to eventual consistency of topology database. > **Warning:** > > Seemingly simpler hop-by-hop protocols like distance- or path vector routing protocols are much worse and can result in [permanent forwarding loops](https://blog.ipspace.net/2013/10/can-bgp-route-reflectors-really/) or [persistent oscillations](https://rule11.tech/bgp-persistent-oscillation/). Assuming you have infinite patience, it's quite easy to predict what an OSPF network will look like: - Take topology database; - Follow all the intricate rules in various OSPF-related RFCs; - Get the final forwarding table. > **Note:** > > Speaking about the intricate rules: many of them seem like Rube Goldberg fixes introduced to correct unexpected OSPF behavior, probably proving my "*lack of intuitive grasp*" hypothesis. Nobody in his right mind would do something like that, but once the steps to a solution are well-defined, it's trivial (from the perspective of a mathematical proof, not the actual implementation) to carry them out... and there are tools like Cariden's MATE that do exactly that. However, because it's easier to not spend money on something that would prevent an event with uncertain probability (network going down due to misconfigured OSPF, or losing customer data due to an intrusion), vendors like Cariden have relatively few customers, resulting in expensive tools. Of course, there's another way of dealing with the "unexpectedness" of OSPF: [stop being a MacGyver](https://blog.ipspace.net/2013/08/temper-your-macgyver-streak/), forget the [nerd knobs](https://blog.ipspace.net/2015/08/musing-on-nerd-knobs/), keep your network design [as simple as possible](https://blog.ipspace.net/2011/05/complexity-belongs-to-network-edge/), and use the absolute minimum subset of features you need to get the job done. Unfortunately, it seems like only a small minority of engineers or architects want to follow this particular advice. It's so much easier to [believe](https://blog.ipspace.net/2016/01/the-sad-state-of-enterprise-networking/) in [yet another technology wonder](https://blog.ipspace.net/2017/09/intent-based-hype/).