A General Framework For Compositional Network Modeling
A General Framework For Compositional Network Modeling
Time (ms)
Batfish
1500
1000 provably correct (modulo compiler bugs).
750
1000
500
500 250
9 RELATED WORK
0 0 Zen builds on two prior threads of research:
0 5000 10000 15000 20 40 60 80 100
Number of ACL lines Number of route map lines Network verification. There has been a long line of research
on network verification. These works differ in terms of verifi-
Figure 10: Zen microbenchmarks for random ACLs and
cation algorithms used as well as the network functionality tar-
route maps with line tracking and different solvers.
geted: stateless dataplanes [19, 21–23, 29, 40, 41], stateful dataplanes
(e.g., middleboxes) [32, 43], programmable dataplanes (e.g., Click,
route maps of different sizes randomly, and we ran both BDD and P4) [9, 28, 35], distributed routing protocols (e.g., BGP, OSPF) [3–
SMT backends. For the ACL analysis, we also ran Batfish, which 5, 10–12], and centralized control planes [6, 15]. While different
performs the same analysis using a hand-optimized, BDD-based domains come with their own challenges, they commonly employ
encoding. Batfish currently does not support verification of route translations to standard verification technologies. Zen aims to ab-
maps. All experiments were performed on a 8-core Intel i7 machine stract away this translation. Even tools that use non-standard or
with 16GB of RAM, and each data point in the graphs is the mean domain-optimized solvers (e.g., HSA [22]) can incorporate such
value across 100 runs. solvers as new backends in Zen, allowing for many models to reap
Figure 10 shows the results. For the ACL analysis, we see that their benefits. Beyond simplifying tool development, Zen also al-
Zen’s BDD backend is more efficient than the SMT backend. We also lows for easy composition of network models which is challenging
see that this backend performs comparably to the hand-optimized or impossible when different tools are implemented using disparate
Batfish implementation despite having its encoding generated au- technologies and APIs.
tomatically. Thus, general solvers have the potential to match the Intermediate verification languages. Zen draws on prior work
performance of custom ones. on IVLs [24, 27, 34, 37] that aim to simplify verification tasks. It
For the route map analysis, unlike ACL analysis, we see that the shares many common technologies with these languages. For exam-
SMT backend performs better than the BDD backend. In general, ple, its bounded model checker uses a type-aware merging strategy
we have found the SMT backend better for reasoning about data pioneered by Rosette [37]. However, as shown in Table 1, prior IVLs
structures such as lists. These results show the value of having cannot express many common network analyses. To address this
access to multiple backends, so users can pick the one that is best limitation, Zen introduces a new state set abstraction that allows
for their domain and network. This goal would be almost impossible for directly manipulating sets of values in user code.
to achieve with custom encodings as one would have to develop Zen shares the linguistic modeling approach of NV [13]. While
multiple different backends for each functionality. NV provides high level abstractions for encoding certain network
functionalities (e.g., distributed routing) and analyses, Zen’s abstrac-
8 BEYOND MODEL ANALYSIS tions are lower-level and more general. Consequently, it can be used
While our initial focus with Zen is analyzing network models, it has to model a wide range of network functionalities and analyses.
other important use cases. We briefly discuss two such use cases
which we have already prototyped. 10 CONCLUSION
Testing implementations. Zen models can become the basis for Verification tools today are implemented as monoliths, mixing to-
testing the implementations that they model. Given a Zen function gether domain semantics, analysis engines and solver technologies.
f, f.GenerateInputs() produces test inputs with a high-degree of We argue for a compositional approach to network modeling and
coverage based on symbolic execution [14]. We can test that these analysis based on a common intermediate language for expressing
inputs are handled by the implementation as expected. For instance, domain functionality. This approach can enable rapid construction,
if we have a model for an ACL, we can generate test packets that composition, and verification of domain-specific models for new
match on every single rule in the ACL, and then validate that the network functionality and pave the way for fully-verified networks.
REFERENCES [22] P. Kazemian, G. Varghese, and N. McKeown. Header space analysis: Static
[1] A. Aziz, S. Taşiran, and R. K. Brayton. Bdd variable ordering for interacting finite checking for networks. In Proceedings of the 9th USENIX Conference on Networked
state machines. In Proceedings of the 31st Annual Design Automation Conference, Systems Design and Implementation, NSDI’12, pages 9–9, Berkeley, CA, USA, 2012.
DAC ’94, page 283–288, New York, NY, USA, 1994. Association for Computing USENIX Association.
Machinery. [23] A. Khurshid, X. Zou, W. Zhou, M. Caesar, and P. B. Godfrey. Veriflow: Verifying
[2] J. Backes, S. Bayless, B. Cook, C. Dodge, A. Gacek, A. J. Hu, T. Kahsai, B. Ko- network-wide invariants in real time. In Presented as part of the 10th USENIX
cik, E. Kotelnikov, J. Kukovec, S. McLaughlin, J. Reed, N. Rungta, J. Sizemore, Symposium on Networked Systems Design and Implementation (NSDI 13), pages
M. Stalzer, P. Srinivasan, P. Subotić, C. Varming, and B. Whaley. Reachability 15–27, Lombard, IL, 2013. USENIX.
analysis for aws-based networks. In I. Dillig and S. Tasiran, editors, Computer [24] A. S. Köksal, V. Kuncak, and P. Suter. Constraints as control. In Proceedings of the
Aided Verification, pages 231–241, Cham, 2019. Springer International Publishing. 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming
[3] R. Beckett, A. Gupta, R. Mahajan, and D. Walker. A general approach to network Languages, POPL ’12, page 151–164, New York, NY, USA, 2012. Association for
configuration verification. In Proceedings of the Conference of the ACM Special Computing Machinery.
Interest Group on Data Communication, SIGCOMM ’17, pages 155–168, New York, [25] C. Lattner and V. Adve. Llvm: A compilation framework for lifelong program
NY, USA, 2017. ACM. analysis and transformation. In Proceedings of the International Symposium on
[4] R. Beckett, A. Gupta, R. Mahajan, and D. Walker. Control plane compression. In Code Generation and Optimization: Feedback-Directed and Runtime Optimization,
Proceedings of the 2018 Conference of the ACM Special Interest Group on Data Com- CGO ’04, page 75, USA, 2004. IEEE Computer Society.
munication, SIGCOMM ’18, page 476–489, New York, NY, USA, 2018. Association [26] K. R. M. Leino. Dafny: An automatic program verifier for functional correctness.
for Computing Machinery. In Proceedings of the 16th International Conference on Logic for Programming,
[5] R. Beckett, A. Gupta, R. Mahajan, and D. Walker. Abstract interpretation of dis- Artificial Intelligence, and Reasoning, LPAR’10, page 348–370, Berlin, Heidelberg,
tributed network control planes. Proc. ACM Program. Lang., 4(POPL), December 2010. Springer-Verlag.
2019. [27] K. R. M. Leino and P. Rümmer. A polymorphic intermediate verification language:
[6] M. Canini, D. Venzano, P. Perešíni, D. Kostić, and J. Rexford. A NICE way to Design and logical encoding. In J. Esparza and R. Majumdar, editors, Tools and
test openflow applications. In Presented as part of the 9th USENIX Symposium Algorithms for the Construction and Analysis of Systems, pages 312–327, Berlin,
on Networked Systems Design and Implementation (NSDI 12), pages 127–140, San Heidelberg, 2010. Springer Berlin Heidelberg.
Jose, CA, 2012. USENIX. [28] J. Liu, W. Hallahan, C. Schlesinger, M. Sharif, J. Lee, R. Soulé, H. Wang, C. Caşcaval,
[7] E. M. Clarke, T. A. Henzinger, H. Veith, and R. Bloem. Handbook of Model Checking. N. McKeown, and N. Foster. P4v: Practical verification for programmable data
Springer Publishing Company, Incorporated, 1st edition, 2018. planes. In Proceedings of the 2018 Conference of the ACM Special Interest Group on
[8] L. De Moura and N. Bjørner. Z3: An efficient smt solver. In Proceedings of Data Communication, SIGCOMM ’18, pages 490–503, New York, NY, USA, 2018.
the Theory and Practice of Software, 14th International Conference on Tools and ACM.
Algorithms for the Construction and Analysis of Systems, TACAS’08/ETAPS’08, [29] H. Mai, A. Khurshid, R. Agarwal, M. Caesar, P. B. Godfrey, and S. T. King. De-
page 337–340, Berlin, Heidelberg, 2008. Springer-Verlag. bugging the data plane with anteater. In Proceedings of the ACM SIGCOMM 2011
[9] M. Dobrescu and K. Argyraki. Software dataplane verification. In 11th USENIX Conference, SIGCOMM ’11, pages 290–301, New York, NY, USA, 2011. ACM.
Symposium on Networked Systems Design and Implementation (NSDI 14), pages [30] K. L. McMillan and L. D. Zuck. Formal specification and testing of quic. In Proceed-
101–114, Seattle, WA, 2014. USENIX Association. ings of the ACM Special Interest Group on Data Communication, SIGCOMM ’19,
[10] S. K. Fayaz, T. Sharma, A. Fogel, R. Mahajan, T. Millstein, V. Sekar, and G. Varghese. page 227–240, New York, NY, USA, 2019. Association for Computing Machinery.
Efficient network reachability analysis using a succinct control plane representa- [31] T. Nelson, C. Barratt, D. J. Dougherty, K. Fisler, and S. Krishnamurthi. The
tion. In 12th USENIX Symposium on Operating Systems Design and Implementation margrave tool for firewall analysis. In Proceedings of the 24th International
(OSDI 16), pages 217–232, Savannah, GA, November 2016. USENIX Association. Conference on Large Installation System Administration, LISA’10, page 1–8, USA,
[11] A. Fogel, S. Fung, L. Pedrosa, M. Walraed-Sullivan, R. Govindan, R. Mahajan, 2010. USENIX Association.
and T. Millstein. A general approach to network configuration analysis. In 12th [32] A. Panda, O. Lahav, K. Argyraki, M. Sagiv, and S. Shenker. Verifying reachability in
USENIX Symposium on Networked Systems Design and Implementation (NSDI 15), networks with mutable datapaths. In Proceedings of the 14th USENIX Conference on
pages 469–483, Oakland, CA, May 2015. USENIX Association. Networked Systems Design and Implementation, NSDI’17, pages 699–718, Berkeley,
[12] A. Gember-Jacobson, R. Viswanathan, A. Akella, and R. Mahajan. Fast control CA, USA, 2017. USENIX Association.
plane analysis using an abstract representation. In Proceedings of the 2016 ACM [33] R. Rudell. Dynamic variable ordering for ordered binary decision diagrams. In
SIGCOMM Conference, SIGCOMM ’16, pages 300–313, New York, NY, USA, 2016. Proceedings of the 1993 IEEE/ACM International Conference on Computer-Aided
ACM. Design, ICCAD ’93, page 42–47, Washington, DC, USA, 1993. IEEE Computer
[13] N. Giannarakis, D. Loehr, R. Beckett, and D. Walker. Nv: An intermediate language Society Press.
for verification of network control planes. In Proceedings of the 41st ACM SIGPLAN [34] S. F. Siegel, M. Zheng, Z. Luo, T. K. Zirkel, A. V. Marianiello, J. G. Edenhofner,
Conference on Programming Language Design and Implementation, PLDI 2020, M. B. Dwyer, and M. S. Rogers. Civl: the concurrency intermediate verifica-
page 958–973, New York, NY, USA, 2020. Association for Computing Machinery. tion language. In SC ’15: Proceedings of the International Conference for High
[14] P. Godefroid, N. Klarlund, and K. Sen. Dart: Directed automated random testing. Performance Computing, Networking, Storage and Analysis, pages 1–12, 2015.
PLDI ’05, page 213–223, New York, NY, USA, 2005. Association for Computing [35] R. Stoenescu, D. Dumitrescu, M. Popovici, L. Negreanu, and C. Raiciu. Debugging
Machinery. p4 programs with vera. In Proceedings of the 2018 Conference of the ACM Special
[15] A. B. M. Gomes, F. A. M. Alves, R. S. Ferreira, and J. A. M. Nacif. Vericonn: a tool Interest Group on Data Communication, SIGCOMM ’18, pages 518–532, New York,
to generate efficient interconnection networks for post-silicon debug. In 2015 NY, USA, 2018. ACM.
16th Latin-American Test Symposium (LATS), pages 1–6, March 2015. [36] B. Tian, X. Zhang, E. Zhai, H. H. Liu, Q. Ye, C. Wang, X. Wu, Z. Ji, Y. Sang,
[16] L. Hadarean, K. Bansal, D. Jovanović, C. Barrett, and C. Tinelli. A tale of two M. Zhang, D. Yu, C. Tian, H. Zheng, and B. Y. Zhao. Safely and automatically
solvers: Eager and lazy approaches to bit-vectors. pages 680–695, 07 2014. updating in-network acl configurations with intent language. In Proceedings of
[17] S. Hanks, T. Li, D. Farinacci, and P. Traina. Generic Routing Encapsulation over the ACM Special Interest Group on Data Communication, SIGCOMM ’19, page
IPv4 networks, 1994 (accessed June, 2020). 214–226, New York, NY, USA, 2019. Association for Computing Machinery.
[18] C. Hawblitzel, J. Howell, M. Kapritsos, J. R. Lorch, B. Parno, M. L. Roberts, S. Setty, [37] E. Torlak and R. Bodik. Growing solver-aided languages with rosette. In Proceed-
and B. Zill. Ironfleet: Proving practical distributed systems correct. In Proceedings ings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and
of the 25th Symposium on Operating Systems Principles, SOSP ’15, page 1–17, New Reflections on Programming & Software, Onward! 2013, page 135–152, New York,
York, NY, USA, 2015. Association for Computing Machinery. NY, USA, 2013. Association for Computing Machinery.
[19] A. Horn, A. Kheradmand, and M. Prasad. Delta-net: Real-time network verifi- [38] E. Torlak and R. Bodik. A lightweight symbolic virtual machine for solver-
cation using atoms. In 14th USENIX Symposium on Networked Systems Design aided host languages. In Proceedings of the 35th ACM SIGPLAN Conference on
and Implementation (NSDI 17), pages 735–749, Boston, MA, March 2017. USENIX Programming Language Design and Implementation, PLDI ’14, page 530–541, New
Association. York, NY, USA, 2014. Association for Computing Machinery.
[20] K. Jayaraman, N. Bjørner, J. Padhye, A. Agrawal, A. Bhargava, P.-A. C. Bisson- [39] M. Utting and B. Legeard. Practical Model-Based Testing: A Tools Approach. Morgan
nette, S. Foster, A. Helwer, M. Kasten, I. Lee, A. Namdhari, H. Niaz, A. Parkhi, Kaufmann Publishers Inc., San Francisco, CA, USA, 2006.
H. Pinnamraju, A. Power, N. M. Raje, and P. Sharma. Validating datacenters [40] G. G. Xie, Jibin Zhan, D. A. Maltz, Hui Zhang, A. Greenberg, G. Hjalmtysson, and
at scale. In Proceedings of the ACM Special Interest Group on Data Communica- J. Rexford. On static reachability analysis of ip networks. In Proceedings IEEE
tion, SIGCOMM ’19, page 200–213, New York, NY, USA, 2019. Association for 24th Annual Joint Conference of the IEEE Computer and Communications Societies.,
Computing Machinery. volume 3, pages 2170–2183 vol. 3, March 2005.
[21] P. Kazemian, M. Chang, H. Zeng, G. Varghese, N. McKeown, and S. Whyte. Real [41] H. Yang and S. S. Lam. Real-time verification of network properties using atomic
time network policy checking using header space analysis. In Presented as part predicates. IEEE/ACM Trans. Netw., 24(2):887–900, April 2016.
of the 10th USENIX Symposium on Networked Systems Design and Implementation [42] H. Yang and S. S. Lam. Scalable verification of networks with packet transformers
(NSDI 13), pages 99–111, Lombard, IL, 2013. USENIX. using atomic predicates. IEEE/ACM Transactions on Networking, 25(5):2900–2915,
2017. Networked Systems Design and Implementation (NSDI 20), pages 181–200, Santa
[43] Y. Yuan, S.-J. Moon, S. Uppal, L. Jia, and V. Sekar. Netsmc: A custom symbolic Clara, CA, February 2020. USENIX Association.
model checker for stateful network verification. In 17th USENIX Symposium on