Probabilistic NetKAT

  • Nate FosterEmail author
  • Dexter Kozen
  • Konstantinos Mamouras
  • Mark Reitblatt
  • Alexandra Silva
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9632)


This paper presents a new language for network programming based on a probabilistic semantics. We extend the NetKATlanguage with new primitives for expressing probabilistic behaviors and enrich the semantics from one based on deterministic functions to one based on measurable functions on sets of packet histories. We establish fundamental properties of the semantics, prove that it is a conservative extension of the deterministic semantics, show that it satisfies a number of natural equations, and develop a notion of approximation. We present case studies that show how the language can be used to model a diverse collection of scenarios drawn from real-world networks.


Parallel Composition Head Packet Denotational Semantic Markov Kernel Network Calculus 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



The authors wish to thank the members of the Cornell PLDG and DIKU COPLAS group for insightful discussions and helpful comments. Our work is supported by the National Security Agency; the National Science Foundation under grants CNS-1111698, CNS-1413972, CCF-1422046, CCF-1253165, and CCF-1535952; the Office of Naval Research under grant N00014-15-1-2177; the Dutch Research Foundation (NWO) under project numbers 639.021.334 and 612.001.113; and gifts from Cisco, Facebook, Google, and Fujitsu.


  1. 1.
    Anderson, C., Foster, N., Guha, A., Jeannin, J., Kozen, D., Schlesinger, C., Walker, D.: NetKAT: semantic foundations for networks. In: POPL 2014, ACM (2014)Google Scholar
  2. 2.
    Borgström, J., Gordon, A.D., Greenberg, M., Margetson, J., Van Gael, J.: Measure transformer semantics for Bayesian machine learning. In: Barthe, G. (ed.) ESOP 2011. LNCS, vol. 6602, pp. 77–96. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  3. 3.
    Bosshart, P., Daly, D., et al.: P4: programming protocol-independent packet processors. ACM SIGCOMM Comput. Commun. Rev. 44(3), 87–95 (2014)CrossRefGoogle Scholar
  4. 4.
    Cattani, S., Segala, R.: Decision algorithms for probabilistic bisimulation. In: Brim, L., Jančar, P., Křetínský, M., Kučera, A. (eds.) CONCUR 2002. LNCS, vol. 2421, pp. 371–385. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  5. 5.
    Chung, K.L.: A Course in Probability Theory, 2nd edn. Academic Press, New York (1974)zbMATHGoogle Scholar
  6. 6.
    Cruz, R.: A calculus for network delay, parts I and II. IEEE Trans. Inf. Theor. 37(1), 114–141 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Demers, A., Gealy, M., Greene, D., Hauser, C., Irish, W., Larson, J., Manning, S., Shenker, S., Sturgis, H., Swinehart, D., Terry, D., Woods, D.: Epidemic algorithms for replicated database maintenance. In: PODC 1987, ACM (1987)Google Scholar
  8. 8.
    Desharnais, J., Edalat, A., Panangaden, P.: Bisimulation for labelled Markov processes. Inf. Comput. 179(2), 163–193 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Desharnais, J., Gupta, V., Jagadeesan, R., Panangaden, P.: A metric for labelled Markov processes. Theor. Comput. Sci. 318(3), 323–354 (2004)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Doberkat, E.: Stochastic Relations: Foundations for Markov Transition Systems. Studies in Informatics. Chapman Hall, New York (2007)CrossRefzbMATHGoogle Scholar
  11. 11.
    Foster, N., Harrison, R., Freedman, M., Monsanto, C., Rexford, J., Story, A., Walker, D.: Frenetic: a network programming language. In: ICFP 2011, ACM (2011)Google Scholar
  12. 12.
    Foster, N., Kozen, D., Milano, M., Silva, A., Thompson, L.: A coalgebraic decision procedure for NetKAT. In: POPL 2015, ACM (2015)Google Scholar
  13. 13.
    Foster, N., Kozen, D., Mamouras, K., Reitblatt, M., Silva, A.: Probabilistic NetKAT (full version).
  14. 14.
    Gill, P., Jain, N., Nagappan, N.: Understanding network failures in data centers: measurement, analysis, and implications. In: SIGCOMM 2011, ACM (2011)Google Scholar
  15. 15.
    Gordon, A., Henzinger, T., Nori, A., Rajamani, S.: Probabilistic programming. In: ICSE 2014, IEEE (2014)Google Scholar
  16. 16.
    Gretz, F., Jansen, N., Kaminski, B., Katoen, J., McIver, A., Olmedo, F.: Conditioning in probabilistic programming. MFPS 2015 Electron. Notes Theor. Comput. Sci. 319, 199–216 (2015)MathSciNetGoogle Scholar
  17. 17.
    Halmos, P.R.: Measure Theory. Van Nostrand, New York (1950)CrossRefzbMATHGoogle Scholar
  18. 18.
    Jiang, Y.: A basic stochastic network calculus. In: SIGCOMM 2006, ACM (2006)Google Scholar
  19. 19.
    Jones, C.: Probabilistic nondeterminism. Ph.D. thesis, Edinburgh University (1990)Google Scholar
  20. 20.
    Jonsson, B., Larsen, K.G.: Specification and refinement of probabilistic processes. In: LICS 1991, IEEE (1991)Google Scholar
  21. 21.
    Kazemian, P., Varghese, G., McKeown, N.: Header space analysis: static checking for networks. In: NSDI 2012, USENIX (2012)Google Scholar
  22. 22.
    Khurshid, A., Zou, X., Zhou, W., Caesar, M., Godfrey, P.: VeriFlow: verifying network-wide invariants in real time. In: NSDI 2013, USENIX (2013)Google Scholar
  23. 23.
    Kozen, D.: Semantics of probabilistic programs. JCSS 22, 328–350 (1981)MathSciNetzbMATHGoogle Scholar
  24. 24.
    Kozen, D.: A probabilistic PDL. JCSS 30(2), 162–178 (1985)MathSciNetzbMATHGoogle Scholar
  25. 25.
    Kozen, D.: Kleene algebra with tests. TOPLAS 19(3), 427–443 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Kozen, D., Mardare, R., Panangaden, P.: Strong completeness for Markovian logics. In: Chatterjee, K., Sgall, J. (eds.) MFCS 2013. LNCS, vol. 8087, pp. 655–666. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  27. 27.
    Kwiatkowska, M., Norman, G., et al.: Symbolic model checking for probabilistic timed automata. Inf. Comput. 205(7), 1027–1077 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    Larsen, K.G., Mardare, R., Panangaden, P.: Taking It to the limit: approximate reasoning for Markov processes. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS, vol. 7464, pp. 681–692. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  29. 29.
    Larsen, K., Skou, A.: Bisimulation through probabilistic testing. Inf. Comput. 94, 456–471 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  30. 30.
    Le Boudec, J., Thiran, P.: Network Calculus: A Theory of Deterministic Queuing Systems for the Internet. Springer-Verlag, Heidelberg (2001)CrossRefzbMATHGoogle Scholar
  31. 31.
    McIver, A., Cohen, E., Morgan, C., Gonzalia, C.: Using probabilistic Kleene algebra pKA for protocol verification. JLAP 76(1), 90–111 (2008)MathSciNetzbMATHGoogle Scholar
  32. 32.
    McIver, A., Morgan, C.: Abstraction, Refinement and Proof for Probabilistic Systems. Springer, New York (2005)zbMATHGoogle Scholar
  33. 33.
    McKeown, N., Anderson, T., et al.: Openflow: enabling innovation in campus networks. SIGCOMM CCR 38(2), 69–74 (2008)CrossRefGoogle Scholar
  34. 34.
    Medina, A., Taft, N., Salamatian, K., Bhattacharyya, S., Diot, C.: Traffic matrix estimation: existing techniques and new directions. In: SIGCOMM 2002, ACM (2002)Google Scholar
  35. 35.
    Monsanto, C., Reich, J., Foster, N., Rexford, J., Walker, D.: Composing software defined networks. In NSDI 2013, USENIX (2013)Google Scholar
  36. 36.
    Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. TOPLAS 18(3), 325–353 (1996)CrossRefGoogle Scholar
  37. 37.
    Nelson, T., Ferguson, A., Scheer, M., Krishnamurthi, S.: Tierless programming and reasoning for software-defined networks. In: NSDI 2014, USENIX (2014)Google Scholar
  38. 38.
    Panangaden, P.: Probabilistic relations. In: School of Computer Science, McGill University, Montreal, pp. 59–74 (1998)Google Scholar
  39. 39.
    Panangaden, P.: Labelled Markov Processes. Imperial College Press, London (2009)CrossRefzbMATHGoogle Scholar
  40. 40.
    Paz, A.: Introduction to Probabilistic Automata. Academic Press, Orlando (1971)zbMATHGoogle Scholar
  41. 41.
    Ramshaw, L.H.: Formalizing the analysis of algorithms. Ph.D. thesis, Stanford University (1979)Google Scholar
  42. 42.
    Rao, M.M.: Measure Theory and Integration. Wiley-Interscience, New York (1987)zbMATHGoogle Scholar
  43. 43.
    Roy, D.: Computability, inference and modeling in probabilistic programming. Ph.D. thesis, Massachusetts Institute of Technology (2011)Google Scholar
  44. 44.
    Saheb-Djahromi, N.: Probabilistic LCF. In: Winkowski, J. (ed.) Mathematical Foundations of Computer Science 1978. Lecture Notes in Computer Science, vol. 64, pp. 442–451. Springer, Heidelberg (1978)CrossRefGoogle Scholar
  45. 45.
    Segala, R.: Probability and nondeterminism in operational models of concurrency. In: Baier, C., Hermanns, H. (eds.) CONCUR 2006. LNCS, vol. 4137, pp. 64–78. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  46. 46.
    Segala, R., Lynch, N.A.: Probabilistic simulations for probabilistic processes. NJC 2, 250–273 (1995)MathSciNetzbMATHGoogle Scholar
  47. 47.
    Smolka, S., Eliopoulos, S., Foster, N., Guha, A.: A fast compiler for NetKAT. In: ICFP 2015, ACM (2015)Google Scholar
  48. 48.
    Tix, R., Keimel, K., Plotkin, G.: Semantic domains for combining probability and nondeterminism. ENTCS 222, 3–99 (2009)MathSciNetzbMATHGoogle Scholar
  49. 49.
    Valiant, L.: A scheme for fast parallel communication. SIAM J. Comput. 11(2), 350–361 (1982)MathSciNetCrossRefzbMATHGoogle Scholar
  50. 50.
    Varacca, D., Winskel, G.: Distributing probability over non-determinism. Math. Struct. Comput. Sci. 16(1), 87–113 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  51. 51.
    Voellmy, A., Wang, J., Yang, Y., Ford, B., Hudak, P.: Maple: simplifying SDN programming using algorithmic policies. In: SIGCOMM (2013)Google Scholar
  52. 52.
    Zeng, H., Zhang, S., et al.: Libra: divide and conquer to verify forwarding tables in huge networks. In: NSDI (2014)Google Scholar
  53. 53.
    Rui, Z.-S., McKeown, N.: Designing a predictable internet backbone with valiant load-balancing. In: de Meer, H., Bhatti, N. (eds.) IWQoS 2005. LNCS, vol. 3552, pp. 178–192. Springer, Heidelberg (2005)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2016

Authors and Affiliations

  • Nate Foster
    • 1
    Email author
  • Dexter Kozen
    • 1
  • Konstantinos Mamouras
    • 2
  • Mark Reitblatt
    • 1
  • Alexandra Silva
    • 3
  1. 1.Cornell UniversityNew YorkUSA
  2. 2.University of PennsylvaniaPhiladelphiaUSA
  3. 3.University College LondonLondonUK

Personalised recommendations