Automatically Discovering Abstractions for Network Verification
Devon Loehr
1
Automatically Discovering Abstractions for Network Verification - - PowerPoint PPT Presentation
Automatically Discovering Abstractions for Network Verification Devon Loehr 1 Networks are buggy, and that doesnt surprise you 2 Networks are buggy, and that doesnt surprise you 3 Networks are buggy, and that doesnt surprise you 4
1
2
3
4
5
○ Anteater (SIGCOMM ‘11) ○ NetPlumber (NSDI ‘13)
○ rcc (NSDI ’05) ○ Batfish (NSDI ‘15) ○ ARC (SIGGCOMM ‘16) ○ NV (PLDI ‘20)
6
7
0n 1n 2n
8
0n 1n 2n
9
(0, 0n) (99, 1n) (99, 2n)
(0, 0n) (99, 1n) (99, 2n)
0n 1n 2n
10
(1, 0n) (100, 1n) T r a n s T r a n s
(0, 0n) (99, 1n) (99, 2n)
0n 1n 2n
11
(1, 0n) (100, 1n)
(0, 0n) (1, 0n) (99, 2n)
0n 1n 2n
12
(100, 1n)
0n 1n 2n
13
(0, 0n) (1, 0n) (99, 2n)
0n 1n 2n
14
(0, 0n) (1, 0n) (99, 2n) (2, 0n) T r a n s
0n 1n 2n
15
(0, 0n) (1, 0n) (2, 0n)
0n 1n 2n
16
(0, 0n) (1, 0n) (2, 0n) true true true
0n 1n 2n 3n (0, 0n) (99, 1n) (99, 2n) (?, 3n)
17
0n 1n 2n 3n (0, 0n) (1, 0n) (??, ??) (?, 3n)
18
Might hijack traffic between node 2 and node 0!
true true ??? true
neighbors’ attributes to its own
NV Transformation Pipeline SMT Solver Verified
Counter- example
User spec
19
User Program Type Inference Record Unrolling Inlining Map Unrolling Edge Unboxing Option Unboxing Tuple Flattening Slicing (optional) Unit Unboxing Z3 SMT Encoding BLUE boxes are compositional NV-to-NV transformations
Most blue boxes use a centralized mechanism for specifying transformations
20
User Program Type Inference Record Unrolling Inlining Map Unrolling Edge Unboxing Option Unboxing Tuple Flattening Slicing (optional) Unit Unboxing Z3 SMT Encoding
Map Unrolling has been particularly challenging
21
22
23
SMT Encoding
24
SMT Encoding SMT Solver
Unknown
○ E.g. Routers originate a fixed, known set of destinations ○ We see expression like m[3] , never m[...complicated computation…]_
25
○ E.g. Routers originate a fixed, known set of destinations ○ We see expression like m[3] , never m[...complicated computation…]_
scanning the program!
26
Only keys used are 3, 4, 7!
that is used
27
networks
into SMT constraints
28
29
protocol
we’re verifying
○ E.g. checking the existence of a path may not require any information about that path’s length
network
30
variables (for us, this is roughly equal to the number of constraints)
network, and are rarely UNSAT. Only a few represent the assertion.
31
32
33
Hidden Program Full Program
34
Hidden Program Full Program
SAT: y1 = true, y2 = false
35
Hidden Program Full Program
SAT: y1 = true, y2 = false
36
Hidden Program Full Program
SAT: y1 = true, y2 = false UNSAT (Need info on: y1, y2)
37
Hidden Program Full Program
38
Hidden Program Full Program
SAT: y0 = true, y1 = true, y2 = false x0 = true, x1 = false
39
Hidden Program Full Program
SAT: y0 = true, y1 = true, y2 = false x0 = true, x1 = false
40
Hidden Program Full Program
SAT: y0 = true, y1 = true, y2 = false x0 = true, x1 = false UNSAT (Need info on: x0, x1)
41
Hidden Program Full Program
42
Hidden Program Full Program
UNSAT
43
Hidden Program Full Program
UNSAT Must also be UNSAT!
1. Create two copies of the SMT program -- one full, one with some constraints hidden 2. Check satisfiability for the hidden program
a. If it’s UNSAT, then so is the full program, so return. b. If it’s SAT, test the model on the full program
3. If the model extends to the full program, then it is also SAT, so return the full model 4. Otherwise, refine the hidden program by unhiding some constraints
a. Add constraints for all variables that appear in the UNSAT core
5. Go to step 2
44
1. Create two copies of the SMT program -- one full, one with some constraints hidden 2. Check satisfiability for the hidden program
a. If it’s UNSAT, then so is the full program, so return. b. If it’s SAT, test the model on the full program
3. If the model extends to the full program, then it is also SAT, so return the full model 4. Otherwise, refine the hidden program by unhiding some constraints
a. Add constraints for all variables that appear in the UNSAT core
5. Go to step 2
45
Guaranteed to terminate after a finite number of iterations, with the same result as the full program!
46
47
48
49
50
○ Maintains relationships between variable using a variable dependency graph ○ It was also inspiration for the the original CEGAR paper in 2000
hiding with predicate abstraction
inlining a few functions, then adding more as needed.
51
○ Generates possibly-spurious counterexamples, then refines its abstraction
○ Can only use relationships that exist in the original constraints ○ Can’t replace data structures or relationships with more abstract versions ○ Could be combined with such techniques, however
52
verification
removing irrelevant information
takes too long to do so
53
54