A Compiler and Run-1me System for Network Programming - - PowerPoint PPT Presentation

a compiler and run 1me system for network programming
SMART_READER_LITE
LIVE PREVIEW

A Compiler and Run-1me System for Network Programming - - PowerPoint PPT Presentation

A Compiler and Run-1me System for Network Programming Languages Christopher Monsanto, Princeton Nate Foster, Cornell Rob Harrison, West Point David


slide-1
SLIDE 1

A ¡Compiler ¡and ¡Run-­‑1me ¡System ¡for ¡ Network ¡Programming ¡Languages ¡

Christopher ¡Monsanto, ¡Princeton ¡ Nate ¡Foster, ¡Cornell ¡ Rob ¡Harrison, ¡West ¡Point ¡ ¡David ¡Walker, ¡Princeton ¡

¡

1 ¡

slide-2
SLIDE 2

SoFware-­‑Defined ¡Networks ¡

2 ¡

Switch ¡ Switch ¡ Controller ¡

slide-3
SLIDE 3

SoFware-­‑Defined ¡Networks ¡

3 ¡

  • Video ¡rou1ng ¡
  • Seamless ¡mobility ¡
  • Energy ¡efficiency ¡
  • DDOS ¡protec1on ¡
  • Etc… ¡

010101 ¡ 0000110 ¡ 11010011 ¡

? ¡

slide-4
SLIDE 4

SoFware ¡Defined ¡Networks: ¡Switches ¡

  • Processes ¡packets ¡

according ¡to ¡ classifier ¡

– Limited ¡paSern ¡ matching ¡ capabili1es ¡ – Ac1ons: ¡forwarding, ¡ dropping, ¡sending ¡to ¡ controller ¡

  • As ¡fast ¡as ¡it ¡gets ¡

4 ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 191.*.*.* ¡ 80 ¡ Forward ¡A ¡ 191.*.*.* ¡ * ¡ Drop ¡ 191.1.1.0 ¡ 22 ¡ Forward ¡B ¡ * ¡ * ¡ Controller ¡

slide-5
SLIDE 5

SDN: ¡Controllers ¡

  • Capable ¡of ¡arbitrary ¡

computa1on ¡

  • Orders ¡of ¡magnitude ¡

slower ¡

  • Installs ¡and ¡

uninstalls ¡rules ¡from ¡ switch ¡classifiers ¡

5 ¡

slide-6
SLIDE 6

Goals ¡

1. A ¡simple, ¡declara1ve ¡language… ¡

– That ¡is, ¡we ¡specify ¡the ¡func1onality, ¡not ¡the ¡ concrete ¡rules ¡that ¡go ¡on ¡the ¡switches, ¡or ¡the ¡ explicit ¡install ¡and ¡uninstall ¡commands ¡the ¡ controller ¡must ¡issue ¡

2. … ¡that ¡is ¡mathema1cally ¡guaranteed ¡to ¡be ¡ correct ¡and ¡efficient. ¡

slide-7
SLIDE 7

Goals ¡

??? ¡

1. A ¡simple, ¡declara1ve ¡language… ¡

– That ¡is, ¡we ¡specify ¡the ¡func1onality, ¡not ¡the ¡ concrete ¡rules ¡that ¡go ¡on ¡the ¡switches, ¡or ¡the ¡ explicit ¡install ¡and ¡uninstall ¡commands ¡the ¡ controller ¡must ¡issue ¡

2. … ¡that ¡is ¡mathema1cally ¡guaranteed ¡to ¡be ¡ correct ¡and ¡efficient. ¡

slide-8
SLIDE 8

Goals ¡

  • … ¡guaranteed ¡to ¡be ¡efficient ¡

8 ¡

slide-9
SLIDE 9

Goals ¡

  • … ¡guaranteed ¡to ¡be ¡efficient ¡

9 ¡

On ¡switches: ¡

slide-10
SLIDE 10

Goals ¡

  • … ¡guaranteed ¡to ¡be ¡efficient ¡

10 ¡

On ¡controllers: ¡ On ¡switches: ¡

slide-11
SLIDE 11

Obstacles ¡Faced ¡By ¡Programmers ¡

11 ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 191.*.*.* ¡ 80 ¡ Forward(A) ¡ 191.*.*.* ¡ * ¡ Drop ¡ * ¡ * ¡ Controller ¡ Synthesize ¡communica1on ¡protocol ¡ Differing ¡switch ¡capabili1es ¡

Low ¡level ¡interface ¡

slide-12
SLIDE 12

Our ¡Real ¡Enemy: ¡Complexity ¡

  • Managing ¡these ¡rules ¡is ¡

complicated ¡

  • Tendency ¡to ¡fall ¡back ¡to ¡

using ¡the ¡simplest ¡kind ¡

  • f ¡rule: ¡microflows ¡

(exact ¡match ¡rules) ¡

  • Very ¡inefficient: ¡many ¡

packets ¡go ¡to ¡the ¡ controller! ¡

12 ¡

slide-13
SLIDE 13

Classifier ¡ NetCore ¡policy ¡ ¡

New ¡Frene1c ¡Run-­‑1me ¡Architecture ¡

13 ¡

Compila1on ¡ Refinement ¡ 2 ¡ 3 ¡ 1 ¡ (reac1ve ¡specializa1on ¡loop) ¡

slide-14
SLIDE 14

NETCORE ¡

14 ¡

Classifier ¡ NetCore ¡policy ¡ ¡

14 ¡

Compila1on ¡ Refinement ¡ 2 ¡ 3 ¡ 1 ¡

slide-15
SLIDE 15

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

15 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡

slide-16
SLIDE 16

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

16 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡

slide-17
SLIDE 17

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

17 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡

DestIP: ¡10.*.1.* ¡

slide-18
SLIDE 18

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

18 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

slide-19
SLIDE 19

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

19 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

slide-20
SLIDE 20

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

20 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

badWebsite ¡p ¡= ¡addr ¡`elem` ¡blacklist ¡ ¡where ¡ ¡ ¡headers ¡= ¡parseHTTP ¡p ¡ ¡ ¡addr ¡= ¡headers ¡! ¡“address” ¡

slide-21
SLIDE 21

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

21 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

inspect ¡(not ¡∘ ¡badWebsite) ¡ badWebsite ¡p ¡= ¡addr ¡`elem` ¡blacklist ¡ ¡where ¡ ¡ ¡headers ¡= ¡parseHTTP ¡p ¡ ¡ ¡addr ¡= ¡headers ¡! ¡“address” ¡

slide-22
SLIDE 22

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

22 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

slide-23
SLIDE 23

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡ ¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

23 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

inspect ¡(not ¡∘ ¡badWebSite) ¡∪ ¡ DestIP: ¡10.10.50.20 ¡

slide-24
SLIDE 24

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡::= ¡ℎ ¡:𝑥 ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

24 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

slide-25
SLIDE 25

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡::= ¡ℎ ¡:𝑥 ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡

25 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

inspect ¡(not ¡∘ ¡badWebSite) ¡→ ¡{A} ¡

slide-26
SLIDE 26

NetCore ¡Grammar ¡

  • 𝑓 ¡::= ¡ℎ ¡:𝑥

¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡::= ¡ℎ ¡:𝑥 ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡primi1ve ¡match ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ¡switch ¡𝑡 ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡match ¡packets ¡at ¡switch ¡ ¡ ¡ ¡| ¡ ¡inspect ¡𝑔 ¡ ¡arbitrary ¡func1on ¡ ¡ ¡arbitrary ¡func1on ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∪​𝑓↓2 ¡ ¡ ¡set ¡union ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∖​𝑓↓2 ¡ ¡ ¡set ¡difference ¡ ¡ ¡ ¡| ¡ ¡​𝑓↓1 ∩​𝑓↓2 ¡ ¡ ¡set ¡intersec1on ¡ ¡ ¡ ¡| ¡ ¡¬𝑓 ¡ ¡ ¡set ¡nega1on ¡ ¡ ¡ ¡set ¡nega1on ¡

  • 𝜐 ¡::= ¡𝑓 ¡→{​𝑡↓1 ,…, ¡​𝑡↓𝑜 } ¡ac1on ¡

¡ ¡ ¡| ¡ ¡​𝜐↓1 ∪​𝜐↓2 ¡ ¡ ¡policy ¡union ¡ ¡ ¡ ¡| ¡ ¡… ¡ ¡

26 ¡

Predicates ¡ Policies ¡ Headers ¡ℎ, ¡wildcards ¡𝑥 ¡ ¡

slide-27
SLIDE 27

NetCore ¡Example ¡

27 ¡

DestIP: ¡*0 ¡→ ¡{A} ¡∪ ¡DestIP: ¡*1 ¡→ ¡{B} ¡

S ¡ A ¡ B ¡ C ¡

  • Load ¡balanced, ¡fast ¡path ¡
  • Slow ¡path ¡

¡

slide-28
SLIDE 28

NetCore ¡Example ¡

28 ¡

(DestIP:90.80.*.* ¡∪ ¡DestPort: ¡22) ¡∩ ¡ ¡ ¡ ¡(DestIP: ¡*0 ¡→ ¡{A} ¡∪ ¡DestIP: ¡*1 ¡→ ¡{B}) ¡

S ¡ A ¡ B ¡ C ¡

  • Load ¡balanced, ¡fast ¡path ¡
  • Internal ¡traffic ¡(90.80.*.*) ¡
  • SSH ¡traffic ¡
  • Slow ¡path ¡

¡

slide-29
SLIDE 29

NetCore ¡Example ¡

29 ¡

((DestIP:90.80.*.* ¡∪ ¡DestPort: ¡22) ¡∩ ¡ ¡ ¡ ¡(DestIP: ¡*0 ¡→ ¡{A} ¡∪ ¡DestIP: ¡*1 ¡→ ¡{B})) ¡∪ ¡ ¡ (¬DestIP:90.80.*.*) ¡→ ¡{C} ¡

S ¡ A ¡ B ¡ C ¡

  • Load ¡balanced, ¡fast ¡path ¡
  • Internal ¡traffic ¡(90.80.*.*) ¡
  • SSH ¡traffic ¡
  • Slow ¡path ¡
  • External ¡traffic ¡

¡

slide-30
SLIDE 30

COMPILATION ¡

30 ¡

Classifier ¡ NetCore ¡policy ¡ ¡

30 ¡

Compila1on ¡ Refinement ¡ 2 ¡ 3 ¡ 1 ¡

slide-31
SLIDE 31

Compila1on ¡

31 ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 90.80.*.* ¡ * ¡ Forward ¡A ¡

P1 ¡= ¡DestIP:90.80.*.* ¡→ ¡{A} ¡

Compiles ¡to: ¡

slide-32
SLIDE 32

Compila1on: ¡Approxima1ons ¡

32 ¡

P2 ¡= ¡DestIP:90.*.70.60 ¡→ ¡{B} ¡ ¡ ¡

Compiles ¡to: ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 90.*.*.* ¡ * ¡ Controller ¡

Non ¡prefix ¡match! ¡ Overapproxima1on ¡

slide-33
SLIDE 33

Compila1on ¡

33 ¡

P3 ¡= ¡P1 ¡∪ ¡P2 ¡

Compiles ¡to: ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 90.80.70.60 ¡ * ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ * ¡ Forward ¡A ¡ 90.*.*.* ¡ * ¡ Controller ¡

Run ¡programs ¡in ¡parallel: ¡

slide-34
SLIDE 34

Compila1on ¡

34 ¡

P3 ¡= ¡P1 ¡∪ ¡P2 ¡

Compiles ¡to: ¡ Run ¡programs ¡in ¡parallel: ¡

Subtle ¡interac1on: ¡where ¡did ¡B ¡come ¡from? ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 90.80.70.60 ¡ * ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ * ¡ Forward ¡A ¡ 90.*.*.* ¡ * ¡ Controller ¡

slide-35
SLIDE 35

Compila1on: ¡Exponen1al ¡Growth ¡

35 ¡

DestIP: ¡1.*.*.* ¡→ ¡{A} ¡ ¡ ¡ ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 1.*.*.* ¡ * ¡ Forward ¡A ¡

slide-36
SLIDE 36

Compila1on: ¡Exponen1al ¡Growth ¡

36 ¡

DestIP: ¡1.*.*.* ¡→ ¡{A} ¡∪ ¡ ¡ DestIP: ¡*.2.*.* ¡→ ¡{B} ¡ ¡ ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 1.2.*.* ¡ * ¡ Forward ¡A, ¡B ¡ *.2.*.* ¡ * ¡ Forward ¡B ¡ 1.*.*.* ¡ * ¡ Forward ¡A ¡

slide-37
SLIDE 37

Compila1on: ¡Exponen1al ¡Growth ¡

37 ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 1.2.3.* ¡ * ¡ Forward ¡A, ¡B, ¡C ¡ *.2.3.* ¡ * ¡ Forward ¡B, ¡C ¡ 1.*.3.* ¡ * ¡ Forward ¡A, ¡C ¡ *.*.3.* ¡ * ¡ Forward ¡C ¡ 1.2.*.* ¡ * ¡ Forward ¡A, ¡B ¡ *.2.*.* ¡ * ¡ Forward ¡B ¡ 1.*.*.* ¡ * ¡ Forward ¡A ¡

DestIP: ¡1.*.*.* ¡→ ¡{A} ¡∪ ¡ ¡ DestIP: ¡*.2.*.* ¡→ ¡{B} ¡∪ ¡ ¡ DestIP: ¡*.*.3.* ¡→ ¡{C} ¡ ¡

slide-38
SLIDE 38

Compila1on: ¡Exponen1al ¡Growth ¡

38 ¡

DestIP: ¡1.*.*.* ¡→ ¡{A} ¡∪ ¡ ¡ DestIP: ¡*.2.*.* ¡→ ¡{B} ¡∪ ¡ ¡ DestIP: ¡*.*.3.* ¡→ ¡{C} ¡∪ ¡ DestIP: ¡*.*.*.4 ¡→ ¡{D} ¡

  • Dest. ¡IP ¡
  • Dest. ¡Port ¡

Ac5on ¡ 1.2.3.4 ¡ * ¡ Forward ¡A, ¡B, ¡C, ¡D ¡ *.2.3.4 ¡ * ¡ Forward ¡B, ¡C, ¡D ¡ 1.*.3.4 ¡ * ¡ Forward ¡A, ¡C, ¡D ¡ *.*.3.4 ¡ * ¡ Forward ¡C, ¡D ¡ 1.2.*.4 ¡ * ¡ Forward ¡A, ¡B, ¡D ¡ *.2.*.4 ¡ * ¡ Forward ¡B, ¡D ¡ 1.*.*.4 ¡ * ¡ Forward ¡A, ¡D ¡ *.*.*.4 ¡ * ¡ Forward ¡D ¡ 1.2.3.* ¡ * ¡ Forward ¡A, ¡B, ¡C ¡ *.2.3.* ¡ * ¡ Forward ¡B, ¡C ¡ 1.*.3.* ¡ * ¡ Forward ¡A, ¡C ¡ *.*.3.* ¡ * ¡ Forward ¡C ¡ 1.2.*.* ¡ * ¡ Forward ¡A, ¡B ¡ *.2.*.* ¡ * ¡ Forward ¡B ¡ 1.*.*.* ¡ * ¡ Forward ¡A ¡

slide-39
SLIDE 39

Compila1on: ¡Takeaways ¡

  • Switch ¡classifiers ¡are ¡not ¡composi1onal ¡– ¡they ¡

do ¡not ¡contain ¡enough ¡informa1on ¡

– Compiler ¡uses ¡an ¡intermediate ¡form ¡which ¡makes ¡ use ¡of ¡high-­‑level ¡informa1on ¡

  • Classifiers ¡that ¡implement ¡high-­‑level ¡

specifica1ons ¡grow ¡in ¡size ¡quickly ¡

– Compiler ¡uses ¡op1mized ¡algorithms ¡and ¡classifier ¡ minimiza1on ¡techniques ¡

39 ¡

slide-40
SLIDE 40

REACTIVE ¡SPECIALIZATION ¡ ¡

40 ¡

Classifier ¡ NetCore ¡policy ¡ ¡

40 ¡

Compila1on ¡ Refinement ¡ 2 ¡ 3 ¡ 1 ¡

slide-41
SLIDE 41

Reac1ve ¡Specializa1on ¡

  • Can’t ¡compile ¡this ¡classifier ¡exactly ¡without ¡

using ¡many ¡rules ¡

– Most ¡switches ¡only ¡support ¡prefix ¡matches ¡ – Worst ¡case ¡can ¡take ¡billions ¡and ¡billions ¡of ¡rules ¡

41 ¡

DestIP: ¡90.80.*.* ¡→ ¡{A} ¡∪ ¡ ¡ DestIP: ¡90.*.70.60 ¡→ ¡{B} ¡

slide-42
SLIDE 42
  • R. ¡Specializa1on: ¡Base ¡Compila1on ¡
  • Step ¡1: ¡install ¡a ¡“base” ¡classifier ¡

– Proac1vely ¡handle ¡packets ¡on ¡switch ¡if ¡possible ¡ – Send ¡other ¡packets ¡to ¡the ¡controller ¡

42 ¡

S ¡ Policy ¡ Proac1ve ¡ ¡ Compila1on ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

slide-43
SLIDE 43
  • R. ¡Specializa1on: ¡Refinement ¡
  • Packet ¡{DestIP=90.2.60.70, ¡DestPort=80} ¡comes ¡in ¡
  • Use ¡packet ¡to ¡generate ¡seman1cally ¡equivalent, ¡but ¡

structurally ¡different ¡policy ¡

43 ¡

Incoming ¡packet ¡ DestIP: ¡90.80.*.* ¡→ ¡{A} ¡∪ ¡ ¡ DestIP: ¡90.*.70.60 ¡→ ¡{B} ¡ DestIP: ¡90.80.*.* ¡→ ¡{A} ¡∪ ¡ ¡ (DestIP: ¡90.*.70.60 ¡∪ ¡DestIP: ¡90.2.60.70) ¡→ ¡{B} ¡ Refinement ¡ S ¡

slide-44
SLIDE 44
  • R. ¡Specializa1on: ¡Recompila1on ¡
  • Compile ¡refined ¡policy ¡

– Extra ¡structural ¡informa1on ¡ handles ¡similar ¡packets ¡to ¡the ¡

  • ne ¡we ¡handled ¡

44 ¡

Refined ¡policy ¡

Recompila1on ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.2.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

slide-45
SLIDE 45
  • R. ¡Specializa1on: ¡Pruning ¡
  • Remove ¡controller ¡rules ¡and ¡rules ¡that ¡

don’t ¡match ¡packet ¡we ¡handled ¡

  • Take ¡result ¡and ¡place ¡on ¡switches ¡

45 ¡

Refined ¡policy ¡

Recompila1on ¡ Pruning ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.2.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

slide-46
SLIDE 46
  • R. ¡Specializa1on: ¡Pruning ¡
  • Remove ¡controller ¡rules ¡and ¡rules ¡that ¡

don’t ¡match ¡packet ¡we ¡handled ¡

  • Take ¡result ¡and ¡place ¡on ¡switches ¡

46 ¡

Refined ¡policy ¡

Recompila1on ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.2.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.2.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

slide-47
SLIDE 47
  • Dest. ¡IP ¡

Ac5on ¡ 90.100.70.60 ¡ Forward ¡B ¡ 90.2.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

  • R. ¡Specializa1on: ¡Second ¡Packet ¡

47 ¡

DestIP: ¡90.80.*.* ¡→ ¡{A} ¡∪ ¡ ¡ (DestIP: ¡90.*.70.60 ¡∪ ¡DestIP: ¡90.100.70.60) ¡→ ¡{B} ¡ Recompila1on ¡ Pruning ¡ Refinement ¡

  • Consider ¡handling ¡a ¡second ¡

packet, ¡{DestIP=90.100.70.60, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡DestPort=21} ¡

  • Dest. ¡IP ¡

Ac5on ¡ 90.100.70.60 ¡ Forward ¡B ¡ 90.80.70.60 ¡ Forward ¡A, ¡B ¡ 90.80.*.* ¡ Forward ¡A ¡ 90.*.*.* ¡ Controller ¡

slide-48
SLIDE 48

THEORETICAL ¡& ¡EMPIRICAL ¡ RESULTS ¡

48 ¡

slide-49
SLIDE 49

Func1onal ¡Correctness ¡

  • Define ¡idealized ¡machine ¡that ¡handles ¡all ¡

traffic ¡at ¡the ¡controller ¡ ¡ Theorem ¡(Func1onal ¡Correctness): ¡ ¡

NetCore ¡machines ¡bisimulate ¡idealized ¡machines. ¡ ¡

  • Statement ¡of ¡correctness ¡more ¡subtle ¡when ¡

considering ¡queries ¡

49 ¡

slide-50
SLIDE 50

Quiescence ¡

  • Recall: ¡Programs ¡are ¡efficient ¡if ¡they ¡handle ¡

traffic ¡on ¡the ¡switches, ¡not ¡the ¡controller. ¡ ¡ Theorem ¡(Quiescence): ¡ ¡

Under ¡reasonable ¡circumstances, ¡NetCore ¡programs ¡ eventually ¡handle ¡all ¡traffic ¡on ¡the ¡(fast) ¡switches, ¡ instead ¡of ¡on ¡the ¡(slow) ¡controller ¡

  • Special ¡case ¡of ¡cost ¡theorem: ¡iden1fy ¡packets ¡

sent ¡to ¡controller ¡

50 ¡

slide-51
SLIDE 51

Benchmarks: ¡Controller ¡Traffic ¡

51 ¡

Packets ¡ Controller ¡Traffic ¡(kB) ¡ Sta1c ¡Policy ¡ Sta1c ¡Policy ¡+ ¡ ¡ Monitoring ¡ Network ¡Auth. ¡

slide-52
SLIDE 52

Conclusion ¡

  • This ¡talk ¡was ¡short; ¡we ¡didn’t ¡talk ¡about: ¡

– Switch ¡heterogeneity ¡& ¡lauce ¡theory ¡ – Arbitrary ¡Haskell ¡func1ons ¡inside ¡policies ¡ – Queries ¡ – How ¡compila1on ¡and ¡specializa1on ¡actually ¡work ¡

  • So: ¡

– Check ¡out ¡the ¡paper! ¡ – Talk ¡to ¡Chris, ¡Dave, ¡or ¡Nate! ¡ – Check ¡out ¡the ¡compiler ¡at ¡frene1c-­‑lang.org! ¡

52 ¡