compiling path queries in software-defined networks

28
Compiling Path Queries in Software-Defined Networks Srinivas Narayana Jennifer Rexford and David Walker Princeton University

Upload: ivria

Post on 06-Jan-2016

39 views

Category:

Documents


0 download

DESCRIPTION

Compiling Path Queries in Software-Defined Networks. Srinivas Narayana Jennifer Rexford and David Walker Princeton University. Where’s the packet loss?. Faulty network device(s) along the way. But where?. A. B. 100 pkts. 25 pkts . Where’s the packet loss?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Compiling Path Queries in Software-Defined Networks

Compiling Path Queries inSoftware-Defined Networks

Srinivas Narayana

Jennifer Rexford and David Walker

Princeton University

Page 2: Compiling Path Queries in Software-Defined Networks

Where’s the packet loss?

A B

Faulty network device(s) along the way. But where?

2

100 pkts 25 pkts

Page 3: Compiling Path Queries in Software-Defined Networks

A B

Solution idea: Check how far packets get from A to B before being dropped somewhere.

Where’s the packet loss?

Fine-grained packet counters + ForwardingComplex policies

3

100 pkts 25 pkts

Page 4: Compiling Path Queries in Software-Defined Networks

A B

Instead: nice to get A B packet counts each step along paths where A B traffic flows

Where’s the packet loss?

4

100 pkts 25 pkts

50

100

50

25 25

25

25

50

0

Page 5: Compiling Path Queries in Software-Defined Networks

Wouldn’t it be nice to ask questions about packet paths in a network?

Problem: we only observe a given packet independently at different switches.

5

Page 6: Compiling Path Queries in Software-Defined Networks

We’ve designed a path query systemthat analyzes packet paths directly in the data plane.

6

Page 7: Compiling Path Queries in Software-Defined Networks

Problem statement

7

1. Operator/application specifies network path queries

2. Translate into efficient and direct switch measurements(i.e., data plane rules)

Page 8: Compiling Path Queries in Software-Defined Networks

Problem statement

8

Independent specifications

Compiled into data plane rules

QueryQuery Forwarding

Page 9: Compiling Path Queries in Software-Defined Networks

Solution architecture

9

1. Path query language

Query expressions Statistics

2. Query compiler and runtime

SDN controller

Regular expressions of packet location & headers

Payloads

Statistics

Page 10: Compiling Path Queries in Software-Defined Networks

Path Query Language

10

Page 11: Compiling Path Queries in Software-Defined Networks

• Count packets reaching switch S1, then S2 with an internal source IP address (10.0/16)

switch=S1

^

switch=S2, srcip=10.0/16

A hop on the wire

11

Let’s write some queries! (1/3)

Page 12: Compiling Path Queries in Software-Defined Networks

12

Let’s write some queries! (2/3)

0 or more repetitions

• Capture packets evading a firewall in the network

ingress()^(switch != FW)*^egress()

ingress egress

ingress

ingress egress

egress

Page 13: Compiling Path Queries in Software-Defined Networks

Let’s write some queries! (3/3)

• Switch-level traffic matrix:

13

E1 E2 ...

I1 250 100 ...

I2 120 95 ...

... ... ... ...

Page 14: Compiling Path Queries in Software-Defined Networks

Let’s write some queries! (3/3)

• Switch-level traffic matrix:

ingress()

^

(true)*

^

egress()

14

Count all packets, going from any ingress to any egress.

Flow #pkts

* 1000

Page 15: Compiling Path Queries in Software-Defined Networks

Let’s write some queries! (3/3)

• Switch-level traffic matrix:

groupby(ingress(), [switch])^

(true)*

^

groupby(egress(), [switch]) 15

Group counts by packet’s ingress and egress switch!

Traffic matrix!

Flow #pkts

sw=I1, sw=E1 250

sw=I1, sw=E2 100

... ...

Page 16: Compiling Path Queries in Software-Defined Networks

Let’s write some queries!

• More example queries in the paper

16

Page 17: Compiling Path Queries in Software-Defined Networks

The Runtime System

17

Page 18: Compiling Path Queries in Software-Defined Networks

How to analyze packet pathsin the data plane?

18

Page 19: Compiling Path Queries in Software-Defined Networks

Packet paths on data plane

• Main idea: Record path information in packets

• As such, too much state!

19

[{sw: S1 port: 1 srcmac: ... srcip: ... ...}]

[{sw: S1, ...}, {sw: S2 port: 3 srcmac: ... ...}]

[{sw: S1, ...}, {sw: S2, ...}, {sw: S3 port: 2 ...}]

Page 20: Compiling Path Queries in Software-Defined Networks

Reducing path state on packets

• Observation 1: Queries already tell us what’s needed!• Only record path state needed by queries

• Observation 2: Queries are regular expressions• Regular expressions Finite automaton (DFA)• Distinguish only paths corresponding to DFA states

20

Page 21: Compiling Path Queries in Software-Defined Networks

Reducing path state on packets

• Observation 1: Queries already tell us what’s needed!• Only record path state needed by queries

• Observation 2: Queries are regular expressions• Regular expressions Finite automaton (DFA)• Distinguish only paths corresponding to DFA states

21

Record only DFA state on packets (1-2 bytes)

Use existing “tag” fields (e.g., VLAN)

Page 22: Compiling Path Queries in Software-Defined Networks

Example: Query Compilation (1/3)

Query: (switch=S1, srcip=10.0.0.1)^ (switch=S2, dstip=10.0.0.3)

22

Q0

Q1

Q2

switch=S1, srcip=10.0.0.1

switch=S2, dstip=10.0.0.3

S1 S2

Page 23: Compiling Path Queries in Software-Defined Networks

Example: Query Compilation (2/3)

23

Q0

Q1

Q2

switch=S1, srcip=10.0.0.1

switch=S2, dstip=10.0.0.3

Switch Match Action

S1 state=Q0, srcip=10.0.0.1 state=Q1

S2 state=Q1, dstip=10.0.0.3 state=Q2

S2 state=Q1, dstip=10.0.0.3 count

DFA transition

DFA accept

Page 24: Compiling Path Queries in Software-Defined Networks

Example: Query Compilation (3/3)

24

All acting on the same data plane packets!

Frenetic composition operators (details in paper)

DFA-Transitioning

Forwarding DFA-Accepting

Page 25: Compiling Path Queries in Software-Defined Networks

Implementation

• Prototype on the Pyretic (NSDI’13) SDN controller

• Implementation publicly available online• http://frenetic-lang.org/pyretic/

• Evaluation: • Payload collection bandwidth• Rule space• See paper.

25

Page 26: Compiling Path Queries in Software-Defined Networks

Summary

DFA state can be used to track packet paths directly on the data plane.

Measurement and forwarding can be specified independently.

26

Page 27: Compiling Path Queries in Software-Defined Networks

Happy to answer queries ;)

[email protected]

27

Page 28: Compiling Path Queries in Software-Defined Networks

28