43
Programming Network Policies by Examples: Platform, Abstraction and User Studies Boon Thau Loo University of Pennsylvania NetPL workshop @ SIGCOMM 2017 Joint work with Yifei Yuan, Dong Lin, Siri Anil, Harsh Verma, Anirudh Chelluri, Rajeev Alur, Boon Thau Loo

Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Programming Network Policies by Examples: Platform, Abstraction and User Studies

Boon Thau Loo University of Pennsylvania NetPL workshop @ SIGCOMM 2017

Joint work with Yifei Yuan, Dong Lin, Siri Anil, Harsh Verma, Anirudh Chelluri, Rajeev Alur, Boon Thau Loo

Page 2: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Programming Abstractions in SDN

n  Declarative Networking [CACM’09]

n  Frenetic [ICFP’11] n  NetCore [POPL’12] n  Pyretic [NSDI’13] n  NetKAT [POPL’14] n  …

2

•  C/C++ (NOX) •  Python (POX) •  Java (Floodlight) •  …

General-purpose Programming Languages

Domain Specific Languages (DSL)

Missing: SDN programming for non-programmers

Page 3: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NSF I-Corps Program

n  Interviewed 101 network operators/architects, software engineers and router vendors q  Need for programming skills among network

operators q  Frequent network configuration changes that

should be automated q  (Lack of) programming expertise an impediment

towards SDN usage.

3

Page 4: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Need for Programming Capabilities

60.81% 21.62%

17.57%

Needs for programming skills among network operators

Strong need Good to have

4

Page 5: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Outline

n  NetEgg overview n  Controlled user study

Page 6: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NetEgg Overview

Example behaviors

Controller

Action Instructions / Rule installation

Network events

Synthesizer

Interpreter

Policy

Bad behaviors

conflicts

6

Page 7: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NetEgg Overview

Example behaviors

Controller

Action Instructions / Rule installation

Network events

Synthesizer

Interpreter

Policy

Bad behaviors

conflicts

7

Page 8: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

A First Example

Learning switch: 1. Learn the mapping between hosts and ports 2. Forward packets according to the learnt

mapping

3A2

1 B

flood <p1, hA, hB    >

fwd(p1) <p2, hC, hA    >

<p3, hB, hC    > fwd(p2)

8

C

<port, src, dst    >

Page 9: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

A Stateful Policy Model

n  Intuition: states + cases (policies) n  Learning switch:

q  States: Mapping between hosts and ports q  Case 1. Flood packets if the destination is

unknown; store the port for the source q  Case 2. Forward packets otherwise; store port for

source in packets

9

Page 10: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

10

Match Test Action Update

* ST(p.dst).state=0 flood ST(p.src):= (1,port)

* ST(p.dst).state=1 fwd(ST(p.dst).value) ST(p.src):= (1,port)

MAC State Value A 1 1 MAC State Value A 1 1 C 1 3

Controller

3A2

1 C

B

State Table Policy Table

Execution Model

Page 11: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Why This Model?

n  Simple: q  Fast execution q  Deployment on dataplane (FAST [HotSDN’14],

openState SIGCOMM CCR’14) n  Expressive:

q  Dynamic policies (Kinetic [NSDI’2015])

11

Page 12: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Synthesizer

Synthesizer

.

.

.

Match Test Action Update * ST(dstmac).s

tate=0 flood ST(srcmac

):=(1,port)

* ST(dstmac).state=1

fwd(ST(dstmac).value)

ST(srcmac):=(1,port)

12

Page 13: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Synthesis Algorithm

n  Goal: consistent, minimal

13

Page 14: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Synthesis Algorithm

n  Goal: consistent, minimal n  Greedy search

14

Match Test Action Update

* ST(dst).state=0

Match Test Action Update

* ST(dst).state=0

* ST(dst).state=1

Page 15: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Synthesis Algorithm

n  Goal: consistent, minimal n  Greedy search

n  Backtrack with pruning

15

Match Test Action Update

* ST(dst).state=0

Match Test Action Update

* ST(dst).state=0

* ST(dst).state=1

Page 16: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Runtime Rule Installation

n  Idea: Keep rules not updating state tables on the switch

16

MAC State Value A 1 2 B 1 3

Match Test Action Update * ST(dstmac)

.state=0 flood ST(srcmac):

=(1,port)

* ST(dstmac) .state=1

fwd(ST(dstmac).value)

ST(srcmac):=(1,port)

Match Action

inport=3, srcmac=B, dstmac=A fwd(2)

… …

<inport=3, srcmac=B, dstmac=A>

Page 17: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Evaluation

n  Is scenario-based programming feasible? q  Expressiveness q  Intuitiveness q  Conciseness q  Efficiency

n  Is the performance of synthesized implementations comparable to hand-crafted implementation? q  Controller response latency q  End-to-end performance

17

Page 18: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Breadth and Synthesis Effort/Time

18

Page 19: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Comparison in Code Size

NetEgg Pyretic POX Mac learner 3 17 29 Stateful firewall

3 21 58

TCP firewall 9 24 68

19

Page 20: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Response Time

0

0.5

1

1.5

2

2.5

mac learner

stateful firewall

tcp firewall

Res

pons

e tim

e (m

s)

netegg pox

20

Page 21: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

End-to-end Performance

n  Topology: fattree, 20 switches, 16 hosts n  Policy: learning switch n  Setup:

q  1 host as HTTP server q  other hosts send HTTP requests to the server q  benchmark connection time (i.e. time between a

request is issued and it is finished.)

21

Page 22: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

End-to-end Performance

200

400

800

1600

3200

0 10 20

HTT

P co

nnec

tion

time

(ms)

Connection rate (req/s)

netegg pox

22

Page 23: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NetEgg Toolkit

23

Page 24: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Outline

n  NetEgg overview n  Controlled user study

Page 25: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Controlled User Studies (2016/17)

n  Hypothesis: q  “Programmers are more productive in programming language X

compared programming language Y for solving problems type Z”

n  Keep all factors as constant as possible: q  Academic/industry backgrounds, …. q  Solve the same problem Z once q  In a controlled setting under our watch q  Software environment is heavily instrumented

n  Vary only one factor: programming language X vs Y

Controlled NetEgg user study (IRB approval was needed)

Page 26: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

The Case for User Studies in PL Design

n  Goal: identify early on the mental model of target audience and programming abstractions:

n  Complementary Approaches q  Release as open-source and measure adoption q  Projects in large classes (>100 students) : Declarative

networking (SIGCOMM’11 Education workshop), Kinetic (NSDI’15)

26

Page 27: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

User Study

n  Q1: Can NetEgg reduce the error rate of programming SDN policies?

n  Q2: Can NetEgg improve user’s productivity?

n  Q3: How the users interact with NetEgg?

27

Page 28: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

User Study Design

n  Object: NetEgg VS. POX n  Users: masters/PhD students from the

Engineering School of Penn q  With Networking/Distributed System background q  No SDN programming background

n  15 users in NetEgg, 9 users in POX q  All users in the POX group are required to be

proficient in Python programming q  No requirement for NetEgg group

n  More than 21 users in early pilot test 28

Page 29: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Programming Assignment: Firewall++

29

Requirment: 1.  Allow all non-IP. 2.  Block all UDP traffic from the Internet. 3.  Allow all UDP traffic from the CS department. 4.  Allow all TCP traffic from the CS department. 5.  Block all SSH traffic from the Internet. 6.  TCP traffic from any host A in the Internet at TCP port P to any

host B in the CS at TCP port Q is blocked, unless B sends TCP traffic using TCP port Q to A at TCP port P before.

Page 30: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Q1: Error Rate

30

67% 33%

POX

Correct Incorrect

100%

NetEgg

Correct Incorrect

3 users 6 users

15 users

Page 31: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Q2: Programming Time

31

NetEgg POX

Avg. 73 mins

Avg. 146 mins

NetEgg achieves 50% reduction in programming time compared with POX.

Page 32: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Q3: User Interaction Pattern

n  Monitored the number of (unique) scenarios at each call to the synthesizer

n  Identified three interaction patterns: q  Smooth interaction q  Back-and-forth interaction q  Stuck interaction

32

Page 33: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Smooth Interaction Pattern

33

# of Scenarios

Time (minute)

Gradually adding scenarios to describe new behaviors until NetEgg converges

Page 34: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Back-and-forth Interaction Pattern

34

# of Scenarios

Time (minute)

Delete a scenario

Page 35: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Stuck Interaction Pattern

35

# of Scenarios

Time (minute)

Keep modifying the scenario

Page 36: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Statistics across Patterns

9 2

4

# Users

Smooth Interaction

Stuck

Back-and-forth

36

0

20

40

60

80

100

120

Programming Time

Smooth Back-and-forth Stuck

Page 37: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

User Feedback

“the tool has a small learning curve and is quite intuitive . . . it is probably easier to use than a programming language.”

37

“I am very clear about what I am doing when I use the interface, and know exactly how the packets are handled under what situations.”

“(I) may get confused about how to define variables.”

Page 38: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Some Takeaways on User Study

n  Effective way to evaluate programming abstractions from the user point of view q  Participants found the tool intuitive to use q  Interesting observations: variables confusion and

tendency to want to tweak compiled policy tables n  Finite pool of participants à need to get the

design of the study correct to maximize participants’ time

n  Missing element: longitudinal analysis

38

Page 39: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Summary n  Scenario-based programming for SDN policies:

q  Expressive to program a range of policies by examples q  Target non-programmers who manage networks q  Comparable performance to hand-crafted implementations q  User study shows evidence of improved productivity

n  Other similar opportunities in networking? q  Measurements, data-plane processing, security attack

patterns ….

39

Page 40: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Thank You!

n  netdb.cis.upenn.edu/netegg

Page 41: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NSF Expeditions in Computer Augmented Program Engineering excape.cis.upenn.edu

q  Designer expresses “what”, using multiple input formats q  Synthesizer discovers new artifacts via integration q  Synthesizer solves computationally demanding problems using

advanced analysis tools q  Interactive iterative design q  Integrated formal verification

41

Page 42: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

Software-Defined Networking (SDN)

42

Controller

App App

Dst

NextHop

A 2

… … Match Action

Src=A drop

… …

Openflow

e.g. POX, NOX, Floodlight, etc.

APIs distributed protocols

Control plane

Data plane

Page 43: Programming Network Policies by Examples: Platform ... · NSF I-Corps Program ! Interviewed 101 network operators/architects, software engineers and router vendors " Need for programming

NetEgg Scenarios: Stateful firewall

43