|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "You can't verify what you can't specify" |
| 4 | +authors: [lvanbever] |
| 5 | +categories: [overview, research, network, verification] |
| 6 | +image: assets/images/smt.png |
| 7 | +tags: [] |
| 8 | +--- |
| 9 | + |
| 10 | + |
| 11 | +Back when I was studying for my master degree, [Prof. Axel van Lamsweerde](https://www.info.ucl.ac.be/~avl/) was |
| 12 | +teaching us formal logic. Axel is world-famous for his works on requirements |
| 13 | +engineering, that is, the process of defining and maintaining the prerequisites |
| 14 | +that must be met by software systems. |
| 15 | + |
| 16 | +During that time, I remember reading one of Axel's seminal paper entitled |
| 17 | +["Formal Specification: a Roadmap"](https://dl.acm.org/doi/10.1145/336512.336546) which describes the |
| 18 | +strengths and weaknesses of formal specification technologies. I re-discovered Axel's paper as we started to work on making network verification technologies more usable (more on this later) and found its lessons to be invaluable. |
| 19 | + |
| 20 | +In this post, I'd like to quickly summarize Axel's views on why writing good |
| 21 | +specifications is challenging; why I believe these challenges apply almost |
| 22 | +verbatim to network verification; and what we can do to address them. I'll also mention some of our [recent work](https://nsg.ee.ethz.ch/fileadmin/user_upload/publications/config2spec-final.pdf) on automatically mining network specifications. |
| 23 | + |
| 24 | + |
| 25 | +## The problem with formal specifications |
| 26 | + |
| 27 | +As Axel puts it, a formal specification is "the expression, in some formal |
| 28 | +language and at some level of abstraction, of a collection of properties some |
| 29 | +system should satisfy". Of course, not all formal specifications are useful. |
| 30 | +Axel goes therefore a bit further in defining "good" specifications as those |
| 31 | +satisfying a set of key properties: (i) they adequately capture the problem at |
| 32 | +hand; (ii) they are consistent and unambiguous; (iii) they are complete; and |
| 33 | +yet, at the same time, (iv) they are minimal. |
| 34 | + |
| 35 | +Writing good specifications is difficult, perhaps as difficult as writing a correct program in the first place. Axel lists many reasons behind this complexity. Let me describe the ones that resonated with me the most. |
| 36 | + |
| 37 | +To start with, one needs to figure out what the properties to specify actually |
| 38 | +are. Specifications are indeed never formal in the first place: one must figure |
| 39 | +them out. Doing so requires people with different background, mental models, and |
| 40 | +languages to come together (e.g., customers, domain experts, architects, programmers). Finding a common ground is hard and often leads to inconsistencies. |
| 41 | + |
| 42 | +Once the properties of interest are known, they need to be expressed in some |
| 43 | +kind of formal language. Doing so is again hard as most users lack the relevant |
| 44 | +expertise in formal languages (e.g., mathematical logic). Specification |
| 45 | +languages also provide little guidance to the user on how to elaborate a good |
| 46 | +specification (e.g., constructive methods). Besides, they tend to focus on capturing functional properties (what the system is expected |
| 47 | +to do), leaving out important non-functional properties. |
| 48 | + |
| 49 | +Despite being two decades old, I believe the problems Axel pointed at are still largely relevant. This recent [tweet](https://twitter.com/heidykhlaaf/status/1206289442484473856) from Heidy Khlaaf ([@HeidyKhlaaf](https://twitter.com/heidykhlaaf/)) illustrates this particularly well: |
| 50 | + |
| 51 | +<div class="center"> |
| 52 | +<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the past three years of working on large safety critical systems, I've learned that verification isn't the real problem, but it's writing specifications. Don't @ me. <a href="https://t.co/k4zi1j5QkX">https://t.co/k4zi1j5QkX</a></p>— Dr Heidy Khlaaf (هايدي خلاف) (@HeidyKhlaaf) <a href="https://twitter.com/HeidyKhlaaf/status/1206289442484473856?ref_src=twsrc%5Etfw">December 15, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
| 53 | +</div> |
| 54 | + |
| 55 | + |
| 56 | +## Back to the network |
| 57 | + |
| 58 | +At this point, you're probably thinking _"what does all this have to do with the network anyway?"_ Well, when it comes to network verification, pretty much |
| 59 | +everything. Both network verification and synthesis require a formal |
| 60 | +specification of the _intended_ network behavior, and writing this |
| 61 | +specification manually is difficult, if not downright impossible in some cases. |
| 62 | + |
| 63 | +As an exercise, put yourself in the shoes of a network operator working for, |
| 64 | +say, a large Internet Service Provider (ISP). Tired of human-induced downtimes, |
| 65 | +your boss asks you, from now on, to verify the network configurations before |
| 66 | +pushing changes into production. Before using a verification tool though, you |
| 67 | +need to specify what it is that you want the network to do... |
| 68 | + |
| 69 | +A few generic requirements come to mind: surely you want the network to "ensure |
| 70 | +reachability", even if there are failures. Who wants forwarding loops or blackholes anyway? Those obvious requirements out of the way, you start to realize |
| 71 | +that your network does _way_ more than just ensuring reachability... Among |
| 72 | +others, it load-balances traffic, routes it so as to minimize transit |
| 73 | +costs, isolates important customer traffic on disjoint links, and reroute parts |
| 74 | +of it via predefined waypoints. Thinking even further, non-functional |
| 75 | +requirements start to come to mind such as the need to converge rapidly upon |
| 76 | +failures or to maintain the number of routes below a reasonable threshold. |
| 77 | +Figuring out the entire specification quickly becomes daunting, especially as |
| 78 | +most of it has been homegrown over years by an entire team of network engineers |
| 79 | +(some of whom most likely do not even work there anymore). |
| 80 | + |
| 81 | +Writing the specification is daunting too. Since most (existing) network |
| 82 | +specification languages focus on capturing low-level forwarding and routing |
| 83 | +properties, the specification ends up being gigantic. As an illustration, the |
| 84 | +formal specification for Internet2 (the US research network, a network composed |
| 85 | +of around 10 routers) contains up to _thousands_ of predicates. Imagine writing |
| 86 | +this by hand, without making any mistake. Besides, important non-functional |
| 87 | +properties (like fast convergence) cannot be specified and, therefore, cannot |
| 88 | +be verified. |
| 89 | + |
| 90 | + |
| 91 | +## Looking forward |
| 92 | + |
| 93 | +So what do we do? Again, Axel's |
| 94 | +[paper](https://dl.acm.org/doi/10.1145/336512.336546) describes many |
| 95 | +interesting avenues for future research... in networking. Like Axel, one of the |
| 96 | +main avenue I see pertains to designing higher-level specification languages, a |
| 97 | +little bit like [Frenetic](http://www.frenetic-lang.org/) did for OpenFlow. Ideally, these |
| 98 | +languages should be multiparadigm, to cope with the diversity of the users, and modular, to build large-scale specification from smaller |
| 99 | +components. Finally, these languages should also support non-functional properties such as convergence time, memory requirements, or maintainability. |
| 100 | + |
| 101 | +Another promising avenue, and one which we started to explore in a recent |
| 102 | +[paper](https://nsg.ee.ethz.ch/fileadmin/user_upload/publications/config2spec-fi |
| 103 | +nal.pdf), is to partially automate the task of writing the specifications. In |
| 104 | +[Config2Spec](https://nsg.ee.ethz.ch/fileadmin/user_upload/publications/config2spec-final.pdf), we propose to do this by extracting the |
| 105 | +specification from a network configuration. Once the full specification is |
| 106 | +extracted, the operator can then focus her attention on formalizing the deltas with respect to an existing network behavior. |
| 107 | + |
| 108 | +Further techniques are required besides languages and mining techniques though. |
| 109 | +In particular, like Axel, I believe network analysis tools should enable |
| 110 | +reasoning _in spite of errors_, based on partial and possibly bogus |
| 111 | +specifications (e.g., conflicting ones). Here, I could imagine systems in which |
| 112 | +the specification is incrementally refined and debunked with the help of a |
| 113 | +human. All this is probably for another post though... Stay tuned! |
| 114 | + |
| 115 | + |
| 116 | +#### Our group is recruiting! |
| 117 | + |
| 118 | +If you are interested in network verification and synthesis, our |
| 119 | +[group](https://nsg.ee.ethz.ch/) has open PhD and post-doc positions in the area! Please [reach out](https://nsg.ee.ethz.ch/people/laurent-vanbever/)! |
0 commit comments