ssomayyajula / equiv

Equivalence in NetKAT modulo specifications
0 stars 0 forks source link

equiv

This repository contains a very limited prototype implementation of the decision procedure described in this report (this elaborates more on the algorithm).

Here's a short summary: while we already have a decision procedure for the equivalence of NetKAT expressions, this project aims to decide whether a NetKAT term behaves like another NetKAT term when only certain behaviors are observed. That is, only require certain fields of packets to be preserved or be ignored altogether. Such specifications are given as regular expressions of selectors that select certain fields of packets. Then, the regularity of NetKAT terms and specifications is exploited to decide whether they are equivalent.

To build, clone the repository and run make (OASIS should do most of the work). To run, do ./main.byte. The main program runs a satisfaction check on three sample specifications and associated NetKAT programs. Here's a breakdown of the modules:

Taken from the netkat-automata (the coalgebraic decision procedure) repository:

Adapted from Steffen's (@smolkaj) ProbNetKAT modules for marshalling packets as strictly positive integers:

Here are my original contributions:

Nomenclature: a false positive is when the program says a NetKAT term t2 is equivalent to t1 up-to specification s when in fact they aren't, and vice versa for false negatives.

TODO

There's a lot to be done! Currently, satisfaction up-to arbitrary predicates has been disabled since we do not know how to translate those semantics into functions over sets of packets.

Unfortunately, the labelling scheme and simulation check is incredibly naive and performs a brute-force calculation of the finite (but prohibitively large for nontrivial programs) alphabets of NetKAT automata. As a result, running this procedure on anything more than a trivial example will crash it. Steffen and I have been discussing two possible ways to symbolically represent sets of packets:

Furthermore, the explicit conversion between derivatives and finite automata is expensive, so perhaps it would be better if we reformulated this procedure to act on derivatives directly.

Also, please let me know about any bugs (false positives/negatives) as well as nontermination, as that has been a problem.