Another Excursion Trail Ridge Road provides spectacular view of the - - PowerPoint PPT Presentation

another excursion
SMART_READER_LITE
LIVE PREVIEW

Another Excursion Trail Ridge Road provides spectacular view of the - - PowerPoint PPT Presentation

Another Excursion Trail Ridge Road provides spectacular view of the majestic scenery of RMNP. It is the highest continuous motorway in the United States, with more than eight miles lying above 11,000' and a maximum elevation of 12,183


slide-1
SLIDE 1

Another Excursion

Cost: $40-$55 Hours: 8am-9pm Grade Bike Rental Route & Pace
 All negotiable :-)

“Trail Ridge Road provides spectacular view of the majestic scenery of RMNP. It is the highest continuous motorway in the United States, with more than eight miles lying above 11,000' and a maximum elevation of 12,183’ ”

slide-2
SLIDE 2

Deciding NetKAT Equivalence using Derivatives

Nate Foster (Cornell) Dexter Kozen (Cornell) Matthew Milano (Cornell) Alexandra Silva (Raboud) Laure Thompson (Cornell)

slide-3
SLIDE 3

Network Programming Languages

There’s been a lot of recent interest in programmable networks (“software-defjned networking”)… …my group been designing high-level languages for programming and reasoning about networks

slide-4
SLIDE 4

NetKAT Review

slide-5
SLIDE 5

NetKAT Predicates

f ::= switch | port | ethsrc | ethdst | ... pk ::= { switch = n; port = n; ethsrc = n; ethdst = n; … }

Structures

slide-6
SLIDE 6

NetKAT Predicates

f ::= switch | port | ethsrc | ethdst | ... pk ::= { switch = n; port = n; ethsrc = n; ethdst = n; … } a,b,c ::= true (* false *) | false (* true *) | f = n (* test *) | a1 || a2 (* disjunction *) | a1 && a2 (* conjunction *) | ! a (* negation *)

Syntax Structures

slide-7
SLIDE 7

NetKAT Predicates

f ::= switch | port | ethsrc | ethdst | ... pk ::= { switch = n; port = n; ethsrc = n; ethdst = n; … } ⟦a⟧ ∈ Packet Set ⟦true⟧ = Packet ⟦false⟧ = {} ⟦f = n⟧ = { pk | pk.f = n } ⟦a1 || a2⟧ = ⟦a1⟧ ∪ ⟦a2⟧ ⟦a1 && a2⟧ = ⟦a1⟧ ∩ ⟦a2⟧ ⟦! a⟧ = Packet \ ⟦a⟧ a,b,c ::= true (* false *) | false (* true *) | f = n (* test *) | a1 || a2 (* disjunction *) | a1 && a2 (* conjunction *) | ! a (* negation *)

Semantics Syntax Structures

slide-8
SLIDE 8

NetKAT Policies

h ::=〈pk〉| pk :: h

Structures

slide-9
SLIDE 9

NetKAT Policies

p,q,r ::= fjlter a (* fjlter *) | f := n (* modifjcation *) | p1 + p2 (* union *) | p1; p2 (* sequence *) | p* (* iteration *) | dup (* duplication *) h ::=〈pk〉| pk :: h

Syntax Structures

slide-10
SLIDE 10

NetKAT Policies

⟦p⟧ ∈ History → History Set ⟦fjlter a⟧ pk :: h = { pk :: h } if pk ∈〚a〛 {}

  • therwise

⟦f := n⟧ pk :: h= { pk[f:=n] :: h } ⟦p1 + p2⟧ h = ⟦p1⟧ h ∪ ⟦p2⟧ h ⟦p1 • p2⟧ h = (⟦p1⟧ • ⟦p2⟧) h ⟦p*⟧ h = ( ∪i ⟦p⟧i ) h ⟦dup⟧ pk :: h = { pk :: pk :: h } p,q,r ::= fjlter a (* fjlter *) | f := n (* modifjcation *) | p1 + p2 (* union *) | p1; p2 (* sequence *) | p* (* iteration *) | dup (* duplication *) h ::=〈pk〉| pk :: h

{

Semantics Syntax Structures

slide-11
SLIDE 11

NetKAT Policies

⟦p⟧ ∈ History → History Set ⟦fjlter a⟧ pk :: h = { pk :: h } if pk ∈〚a〛 {}

  • therwise

⟦f := n⟧ pk :: h= { pk[f:=n] :: h } ⟦p1 + p2⟧ h = ⟦p1⟧ h ∪ ⟦p2⟧ h ⟦p1 • p2⟧ h = (⟦p1⟧ • ⟦p2⟧) h ⟦p*⟧ h = ( ∪i ⟦p⟧i ) h ⟦dup⟧ pk :: h = { pk :: pk :: h } p,q,r ::= fjlter a (* fjlter *) | f := n (* modifjcation *) | p1 + p2 (* union *) | p1; p2 (* sequence *) | p* (* iteration *) | dup (* duplication *) h ::=〈pk〉| pk :: h

{

Semantics Syntax Structures

`

drop ≜ fjlter false id ≜ fjlter true if a then p1 else p2 ≜ (fjlter a • p1) + (fjlter !a • p2)

slide-12
SLIDE 12

Reasoning in NetKAT

slide-13
SLIDE 13

Encoding Tables

The forwarding tables maintained by switches can be encoded using conditional policies

slide-14
SLIDE 14

Encoding Tables

The forwarding tables maintained by switches can be encoded using conditional policies

Pattern Actions

dstport=22 Drop srcip=10.0.0.0/8 Forward ¡1 * Forward ¡2

slide-15
SLIDE 15

Encoding Tables

Table Normal Form

fwd ::= f1:= n1 •… • fk:=nk + fwd | drop pat ::= f = n • pat | true tbl ::= if pat then fwd else tbl | fwd

The forwarding tables maintained by switches can be encoded using conditional policies

Pattern Actions

dstport=22 Drop srcip=10.0.0.0/8 Forward ¡1 * Forward ¡2

slide-16
SLIDE 16

Encoding Tables

Table Normal Form

fwd ::= f1:= n1 •… • fk:=nk + fwd | drop pat ::= f = n • pat | true tbl ::= if pat then fwd else tbl | fwd

The forwarding tables maintained by switches can be encoded using conditional policies

Pattern Actions

dstport=22 Drop srcip=10.0.0.0/8 Forward ¡1 * Forward ¡2

if dstport=22 then drop else if srcip=10.0.0.0/8 then port := 1 else port := 2

slide-17
SLIDE 17

Encoding Topologies

topo

Links can be modeled as policies that forward packets from one end to the other, and topologies as unions of links

slide-18
SLIDE 18

Encoding Topologies

topo Topology Normal Form

lpred ::= switch=n • port=n lpol ::= switch:=n • port:=n link ::= lpred • lpol topo ::= link + topo | drop

Links can be modeled as policies that forward packets from one end to the other, and topologies as unions of links

slide-19
SLIDE 19

Encoding Topologies

topo Topology Normal Form

lpred ::= switch=n • port=n lpol ::= switch:=n • port:=n link ::= lpred • lpol topo ::= link + topo | drop

Links can be modeled as policies that forward packets from one end to the other, and topologies as unions of links

2 1 2 1

A B C switch=A•port=1•switch:=B•port:=2 + switch=B•port=2•switch:=A•port:=1 + switch=B•port=1•switch:=C•port:=2 + switch=C•port=2•switch:=B•port:=1 + drop

slide-20
SLIDE 20

Encoding Networks

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-21
SLIDE 21

Encoding Networks

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-22
SLIDE 22

Encoding Networks

policy

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-23
SLIDE 23

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-24
SLIDE 24

id

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-25
SLIDE 25

id + (policy•topo)

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-26
SLIDE 26

id + (policy•topo) + (policy•topo•policy•topo)

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-27
SLIDE 27

id + (policy•topo) + (policy•topo•policy•topo) + (policy•topo•policy•topo•policy•topo)

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-28
SLIDE 28

id + (policy•topo) + (policy•topo•policy•topo) + (policy•topo•policy•topo•policy•topo) … ¡ + (policy•topo)*

Encoding Networks

policy topo

An entire network can be encoded by interleaving policy and topology processing steps arbitrarily many number of times

slide-29
SLIDE 29

Checking Reachability

s1 s0 s17 s13 s3 s10 s2 s7 s12 s9 s11 s8 s6 s5 s4 s19 s18 s16 s15 s14 s20 s21

Given:

  • Ingress predicate: switch = s1
  • Egress predicate: switch = s21
  • Topology: t
  • Switch program: p

Check:

  • switch = s1 • switch := s21 + (p • t)* ~ (p • t)*
  • switch=s1 • (p • t )* • switch = s21 ~ drop
slide-30
SLIDE 30

NetKAT Equational Axioms

Boolean Algebra Axioms

a || (b && c) ~ (a || b) && (a || c) a || true ~ true a || ! a ~ true a && b ~ b && a a && !a ~ false a && a ~ a

Packet Axioms

f := n • f’ := n’ ~ f’ := n’ • f := n if f ≠ f’ f := n • f’ = n’ ~ f’ = n’ • f := n if f ≠ f’ f := n • f = n ~ f := n f = n • f := n ~ f = n f := n • f := n’ ~ f := n’ f = n • f = n’ ~ drop if n ≠ n’ dup • f = n ~ f = n • dup

Kleene Algebra Axioms

p + (q + r) ~ (p + q) + r p + q ~ q + p p + drop ~ p p + p ~ p p• (q• r) ~ (p• q)• r p• (q + r) ~ p • q + p• r (p + q)• r ~ p• r + q• r id• p ~ p p ~ p • id drop • p ~ drop p • drop ~ drop id + p • p* ~ p* id + p* • p ~ p* p + q • r + r ~ r ⇒ p* • q + r ~ r p + q • r + q ~ q ⇒ p • r* + q ~q

slide-31
SLIDE 31

Soundness: If ⊢ p ~ q, then ⟦p⟧ = ⟦q⟧ Completeness: If ⟦p⟧ = ⟦q⟧, then ⊢ p ~ q

Metatheory

slide-32
SLIDE 32

Soundness: If ⊢ p ~ q, then ⟦p⟧ = ⟦q⟧ Completeness: If ⟦p⟧ = ⟦q⟧, then ⊢ p ~ q

Metatheory

NetKAT equivalence is also decidable! ☺ …But our earlier algorithm was based on determining a non-deterministic algorithm using Savitch’s theorem, so it was PSPACE in the best case and the worst case ☹

slide-33
SLIDE 33

Soundness: If ⊢ p ~ q, then ⟦p⟧ = ⟦q⟧ Completeness: If ⟦p⟧ = ⟦q⟧, then ⊢ p ~ q

Metatheory

NetKAT equivalence is also decidable! ☺ …But our earlier algorithm was based on determining a non-deterministic algorithm using Savitch’s theorem, so it was PSPACE in the best case and the worst case ☹ Roadmap: starting from a language model of NetKAT…

  • Develop coalgebraic structure of NetKAT
  • Check equivalence using bisimulation
  • Deploy a host of cunning tricks to make it fast
slide-34
SLIDE 34

Regular Expression
 Derivatives Review

slide-35
SLIDE 35

Regular Expressions

R ::= 0 (* empty *) | c (* character *) | R1 + R2 (* union *) | R1 • R2 (* concatenation *) | R* (* Kleene star *) ⟦R⟧ ∈ Σ* ⟦0⟧ = {} ⟦c⟧ = {c} ⟦R1 + R2⟧ = ⟦R1⟧ ∪ ⟦R2⟧ ⟦R1 • R2⟧ = ⟦R1⟧ • ⟦R2⟧ ⟦R*⟧ = ( ∪i ⟦R⟧i )

Semantics Syntax

slide-36
SLIDE 36

Language Derivatives

∂ c R = { w | c · w ∈ ⟦R⟧ } Semantic

slide-37
SLIDE 37

Language Derivatives

∂ c R = { w | c · w ∈ ⟦R⟧ }

Continuation map Dc(0) = 0 Dc(b) = c if c = b 0 otherwise Dc(R1 + R2) = Dc(R1) + Dc(R2) Dc(R1 • R2) = Dc(R1) • R2 + E(R1) • Dc(R2) Dc(R*) = Dc(R) • R*

{

Semantic Syntactic

slide-38
SLIDE 38

Language Derivatives

∂ c R = { w | c · w ∈ ⟦R⟧ }

Continuation map Dc(0) = 0 Dc(b) = c if c = b 0 otherwise Dc(R1 + R2) = Dc(R1) + Dc(R2) Dc(R1 • R2) = Dc(R1) • R2 + E(R1) • Dc(R2) Dc(R*) = Dc(R) • R*

{

Observation map E(0) = E(c) = 0 E(R1 + R2) = E(R1) || E(R2) E(R1 • R2) = E(R1) && E(R2) E(R*) = 1

Semantic Syntactic

slide-39
SLIDE 39

Language Derivatives

∂ c R = { w | c · w ∈ ⟦R⟧ }

Continuation map Dc(0) = 0 Dc(b) = c if c = b 0 otherwise Dc(R1 + R2) = Dc(R1) + Dc(R2) Dc(R1 • R2) = Dc(R1) • R2 + E(R1) • Dc(R2) Dc(R*) = Dc(R) • R*

{

Observation map E(0) = E(c) = 0 E(R1 + R2) = E(R1) || E(R2) E(R1 • R2) = E(R1) && E(R2) E(R*) = 1

Semantic Syntactic

`

Theorem [Brzozowski ’64]: every regular expression has a fjnite number of derivatives (modulo ACI equivalence)

slide-40
SLIDE 40

Building Automata using Derivatives

R Da(R) Db(R) Dc(R)

Automaton:

  • Label initial state by R
  • Transition from Ri to Ri’ on c if Dc(Ri) = Ri’
  • Label state Ri as fjnal if E(Ri) = 1
  • Only generate new state for expressions

not seen previously, modulo ACI

a b c

Advantages:

  • Extremely simple
  • Easy to make lazy
  • Easy to extend with negative operators
  • Easy to optimize by recognizing coarser

equivalences (language equivalence leads to minimal automaton)

slide-41
SLIDE 41

Building Automata using Derivatives

R Da(R) Db(R) Dc(R)

Automaton:

  • Label initial state by R
  • Transition from Ri to Ri’ on c if Dc(Ri) = Ri’
  • Label state Ri as fjnal if E(Ri) = 1
  • Only generate new state for expressions

not seen previously, modulo ACI

a b c

Advantages:

  • Extremely simple
  • Easy to make lazy
  • Easy to extend with negative operators
  • Easy to optimize by recognizing coarser

equivalences (language equivalence leads to minimal automaton)

`

Can also build NFAs using a variant called the Antimirov derivative

slide-42
SLIDE 42

NetKAT Derivatives

slide-43
SLIDE 43

Complete tests α ::= switch = n • port = n Complete assignments β ::= switch := n • port := n Reduced terms p,q::= α (* complete test *) | β (* complete assignment *) | p + q (* union *) | p • q (* sequence *) | p* (* Kleene star *) | dup (* Duplication *)

Reduced NetKAT

slide-44
SLIDE 44

Complete tests α ::= switch = n • port = n Complete assignments β ::= switch := n • port := n Reduced terms p,q::= α (* complete test *) | β (* complete assignment *) | p + q (* union *) | p • q (* sequence *) | p* (* Kleene star *) | dup (* Duplication *)

Reduced NetKAT

For simplicity, only consider two fjelds

slide-45
SLIDE 45

Complete tests α ::= switch = n • port = n Complete assignments β ::= switch := n • port := n Reduced terms p,q::= α (* complete test *) | β (* complete assignment *) | p + q (* union *) | p • q (* sequence *) | p* (* Kleene star *) | dup (* Duplication *)

Lemma: For every NetKAT term p, there is a reduced NetKAT term p’ such that ⊢ p ~ p’

Reduced NetKAT

For simplicity, only consider two fjelds

slide-46
SLIDE 46

Can interpret reduced terms as regular languages over an “alphabet” of complete tests, complete assignments, and dup:

Regular Interpretation

slide-47
SLIDE 47

Can interpret reduced terms as regular languages over an “alphabet” of complete tests, complete assignments, and dup: Regular Interpretation: R(p) ⊆ (A ∪ B ∪ {dup})* R(α) = {α} R(β) = {β} R(p + q) = R(p) U R(q) R(p • q) = R(p) • R(q) R(p*) = R(p)* R(dup) = {dup}

Regular Interpretation

slide-48
SLIDE 48

Can interpret reduced terms as regular languages over an “alphabet” of complete tests, complete assignments, and dup: Regular Interpretation: R(p) ⊆ (A ∪ B ∪ {dup})* R(α) = {α} R(β) = {β} R(p + q) = R(p) U R(q) R(p • q) = R(p) • R(q) R(p*) = R(p)* R(dup) = {dup} Unfortunately ⟦p⟧ = ⟦q⟧ does not imply R(p) = R(q)

Regular Interpretation

slide-49
SLIDE 49

Can interpret reduced terms as regular languages over an “alphabet” of complete tests, complete assignments, and dup: Regular Interpretation: R(p) ⊆ (A ∪ B ∪ {dup})* R(α) = {α} R(β) = {β} R(p + q) = R(p) U R(q) R(p • q) = R(p) • R(q) R(p*) = R(p)* R(dup) = {dup} Unfortunately ⟦p⟧ = ⟦q⟧ does not imply R(p) = R(q) Counterexample:

switch=1・port=1・switch=1・port=2 ~ switch=1・port=1・switch=2・port=1

Regular Interpretation

slide-50
SLIDE 50

Language Model

slide-51
SLIDE 51

Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

slide-52
SLIDE 52

Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

Guarded strings

slide-53
SLIDE 53

Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

Guarded strings Guarded concatenation

slide-54
SLIDE 54

Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

Guarded strings Guarded concatenation

Example: α1 • β2 • dup • β3 • dup • … • dup • βn

slide-55
SLIDE 55

Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

Intuition: models trajectories through the network

Guarded strings Guarded concatenation

Example: α1 • β2 • dup • β3 • dup • … • dup • βn

slide-56
SLIDE 56

Theorem: ⟦p⟧ = ⟦q⟧ if and only if G(p) = G(q) Language Interpretation: G(p) ⊆ A • (B • {dup})* • B G(α) = {α • πα} G(β) = {α • β | α ∈ A } G(p + q) = G(p) ∪ G(q) G(p • q) = G(p) ◇ G(q) G(p*) = G(p)* G(dup) = {α • βα • dup • βα | α ∈ A }

Language Model

Intuition: models trajectories through the network

Guarded strings Guarded concatenation

Example: α1 • β2 • dup • β3 • dup • … • dup • βn

slide-57
SLIDE 57

NetKAT Derivatives

Goal: match all of the guarded strings of the form A • (B • {dup})* • B in the set denoted by a given NetKAT term p Continuation map Dαβ(p):

  • Attempts to match α • β • dup at the start of string
  • Returns the residual NetKAT term, if successful or drop if not
  • Note that we elide dup to streamline the notation

Observation map Eαβ(p):

  • Tries to match the fjnal α • β at the end of the string
  • Returns a term equivalent to true if successful or false if not
slide-58
SLIDE 58

NetKAT Derivatives

slide-59
SLIDE 59

NetKAT Derivatives

Continuation Map: Dαβ(f = n) = Dαβ(f:=n) = drop Dαβ(dup) = α •[α=β] Dαβ(p + q) = Dαβ(p) + Dαβ(q) Dαβ(p • q) = Dαβ(p) • q + Σγ Eαγ(p) • Dγβ(q) Dαβ(p*) =Dαβ(p) • p* + Σγ Eαγ(p) • Dγβ(p*)

slide-60
SLIDE 60

NetKAT Derivatives

Continuation Map: Dαβ(f = n) = Dαβ(f:=n) = drop Dαβ(dup) = α •[α=β] Dαβ(p + q) = Dαβ(p) + Dαβ(q) Dαβ(p • q) = Dαβ(p) • q + Σγ Eαγ(p) • Dγβ(q) Dαβ(p*) =Dαβ(p) • p* + Σγ Eαγ(p) • Dγβ(p*) Observation Map: Eαβ(f = n) = [α=β ≤ f=n] Eαβ(dup) = drop Eαβ(f:=n) = [f:=n = pβ] Eαβ(p + q) = Eαβ(p) + Eαβ(q) Eαβ(p • q) = Σγ Eαγ(p) • Eγβ(q) Eαβ(p*) = [α=β] + Σγ Eαγ(p) • Eγβ(p*)

slide-61
SLIDE 61

NetKAT Derivatives

Continuation Map: Dαβ(f = n) = Dαβ(f:=n) = drop Dαβ(dup) = α •[α=β] Dαβ(p + q) = Dαβ(p) + Dαβ(q) Dαβ(p • q) = Dαβ(p) • q + Σγ Eαγ(p) • Dγβ(q) Dαβ(p*) =Dαβ(p) • p* + Σγ Eαγ(p) • Dγβ(p*) Observation Map: Eαβ(f = n) = [α=β ≤ f=n] Eαβ(dup) = drop Eαβ(f:=n) = [f:=n = pβ] Eαβ(p + q) = Eαβ(p) + Eαβ(q) Eαβ(p • q) = Σγ Eαγ(p) • Eγβ(q) Eαβ(p*) = [α=β] + Σγ Eαγ(p) • Eγβ(p*)

`

Lemma [Foster et al. ’14]: every NetKAT term has a fjnite number

  • f derivatives (modulo ACI equivalence)
slide-62
SLIDE 62

Matrix Representation

Observation: can streamline defjnitions using matrices

slide-63
SLIDE 63

Matrix Representation

Continuation Map: D(f = n) = D(f:=n) = drop D(dup) = J D(p + q) = D(p) + D(q) D(p • q) = D(p) • I(q) + E(p) • D(q) D(p*) = E(p*) • D(p) • I(p*)

Observation: can streamline defjnitions using matrices

slide-64
SLIDE 64

Matrix Representation

Continuation Map: D(f = n) = D(f:=n) = drop D(dup) = J D(p + q) = D(p) + D(q) D(p • q) = D(p) • I(q) + E(p) • D(q) D(p*) = E(p*) • D(p) • I(p*) Matrix with αs

  • n diagonal and 0s

everywhere else

Observation: can streamline defjnitions using matrices

slide-65
SLIDE 65

Matrix Representation

Continuation Map: D(f = n) = D(f:=n) = drop D(dup) = J D(p + q) = D(p) + D(q) D(p • q) = D(p) • I(q) + E(p) • D(q) D(p*) = E(p*) • D(p) • I(p*) Observation Map: E(f = n) = … E(dup) = false E(f:=n) = … E(p + q) = E(p) + E(q) E(p • q) = E(p) • E(q) E(p*) = E(p)* Matrix with αs

  • n diagonal and 0s

everywhere else

Observation: can streamline defjnitions using matrices

slide-66
SLIDE 66

Implementation and Experiments

slide-67
SLIDE 67

Implementation Highlights

Representations:

  • Bases encode sets of complete tests and assignments
  • “Spines” encode sets of terms
  • Sparse matrix library

Algorithmic optimizations:

  • Smart constructors
  • Hash consing
  • Memoization
  • Base set compaction
  • Fast multiplication
  • Fast fjxpoints
  • Union-fjnd in bisimulation
slide-68
SLIDE 68

Experiments

Networks:

  • Topology Zoo
  • FatTree
  • Stanford Backbone

Policies:

  • Shortest-path forwarding
  • Stanford production policy

Questions:

  • Point-to-point reachability
  • All-Pairs connectivity
  • Loop freedom
  • Translation validation
coza_rtr bbrb_rtr bbra_rtr cozb_rtr goza_rtr gozb_rtr boza_rtr bozb_rtr sozb_rtr soza_rtr yozb_rtr poza_rtr yoza_rtr roza_rtr rozb_rtr pozb_rtr h8 s8 s9 s3 s5 s13 h9 s2 s22 s16 h2 s0 s6 s21 s17 s15 s20 h3 h0 s1 s7 h1 h6 h7 s4 h4 h5 s14 h23 s23 s24 h22 h21 s18 s11 s12 h13 s10 h16 s19 h17 h15 h20 h14 h19 h18 h11 h12 h10 h24 h8 s3 h9 h7 s9 s8 s7 s1 s2 s4 s5 s6 h2 h3 h1 h6 h4 h5 h11 h10 h12 h15 h13 h14 h18 h16 h17
slide-69
SLIDE 69

Results

Connectivity Loop Freedom Translation Validation

Topology Zoo FatTree

Relative Performance Scalability

Stanford Backbone

Point-to-point reachability in 0.67s (vs 13s for HSA)

Policy Size Policy Size Policy Size Time (s) Time (s) Time (s) Time (s) Policy Size Fanout

slide-70
SLIDE 70

Conclusion

  • Still (!) lots of great PL problems in networking
  • SDN is an enabling technology for this kind of research
  • NetKAT is a new framework for programming and reasoning

about network behavior

  • Brzozowski derivatives are an elegant technique for building

automata that has borne fruit for 40 years and counting…

  • Ongoing work
  • Proof carrying code
  • Probabilistic NetKAT
  • Network-wide optimizations using matrices
slide-71
SLIDE 71

Thank you!

Collaborators

  • Dexter Kozen (Cornell)
  • Matthew Milano (Cornell)
  • Alexandra Silva (Nijmegen)
  • Laure Thompson (Cornell)

Papers, code, etc. http://frenetic-­‑lang.org/