Compiling Path Queries

Slides:



Advertisements
Similar presentations
Incremental Update for a Compositional SDN Hypervisor Xin Jin Jennifer Rexford, David Walker.
Advertisements

Compiling Path Queries in Software-Defined Networks Srinivas Narayana Jennifer Rexford and David Walker Princeton University.
SIMPLE-fying Middlebox Policy Enforcement Using SDN
SDN Applications Jennifer Rexford Princeton University.
VCRIB: Virtual Cloud Rule Information Base Masoud Moshref, Minlan Yu, Abhishek Sharma, Ramesh Govindan HotCloud 2012.
Composing Software Defined Networks
Composing Software-Defined Networks Princeton*Cornell^ Chris Monsanto*, Joshua Reich* Nate Foster^, Jen Rexford*, David Walker*
Nanxi Kang Princeton University
Jennifer Rexford Princeton University
OpenSketch Slides courtesy of Minlan Yu 1. Management = Measurement + Control Traffic engineering – Identify large traffic aggregates, traffic changes.
Incremental Consistent Updates Naga Praveen Katta Jennifer Rexford, David Walker Princeton University.
Header Space Analysis: Static Checking For Networks Peyman Kazemian, Nick McKeown (Stanford University) and George Varghese (UCSD and Yahoo Labs). Presented.
OpenFlow-Based Server Load Balancing GoneWild
Programming Abstractions for Software-Defined Networks Jennifer Rexford Princeton University.
Scalable Flow-Based Networking with DIFANE 1 Minlan Yu Princeton University Joint work with Mike Freedman, Jennifer Rexford and Jia Wang.
Trajectory Sampling for Direct Traffic Observation Matthias Grossglauser joint work with Nick Duffield AT&T Labs – Research.
Measurement and Monitoring Nick Feamster Georgia Tech.
Software-Defined Networking
Data Plane Verification. Background: What are network policies Alice can talk to Bob Skype traffic must go through a VoIP transcoder All traffic must.
Languages for Software-Defined Networks Nate Foster, Arjun Guha, Mark Reitblatt, and Alec Story, Cornell University Michael J. Freedman, Naga Praveen Katta,
OpenFlow Switch Limitations. Background: Current Applications Traffic Engineering application (performance) – Fine grained rules and short time scales.
SIMPLE-fying Middlebox Policy Enforcement Using SDN Zafar Ayyub Qazi Cheng-Chun Tu Luis Chiang Vyas Sekar Rui Miao Minlan Yu.
Cellular Core Network Architecture
Composing Software Defined Networks Jennifer Rexford Princeton University With Joshua Reich, Chris Monsanto, Nate Foster, and.
Software-Defined Networks Jennifer Rexford Princeton University.
SIGCOMM 2002 New Directions in Traffic Measurement and Accounting Focusing on the Elephants, Ignoring the Mice Cristian Estan and George Varghese University.
Higher-Level Abstractions for Software-Defined Networks Jennifer Rexford Princeton University.
Languages for Software-Defined Networks Nate Foster, Michael J. Freedman, Arjun Guha, Rob Harrison, Naga Praveen Katta, Christopher Monsanto, Joshua Reich,
Copyright 2013 Open Networking User Group. All Rights Reserved Confidential Not For Distribution Programming Abstractions for Software-Defined Networks.
1 Countering DoS Through Filtering Omar Bashir Communications Enabling Technologies
Jennifer Rexford Princeton University MW 11:00am-12:20pm Measurement COS 597E: Software Defined Networking.
Programming Languages for Software Defined Networks Jennifer Rexford and David Walker Princeton University Joint work with the.
TCAM –BASED REGULAR EXPRESSION MATCHING SOLUTION IN NETWORK Phase-I Review Supervised By, Presented By, MRS. SHARMILA,M.E., M.ARULMOZHI, AP/CSE.
SIMPLE-fying Middlebox Policy Enforcement Using SDN
Jennifer Rexford Princeton University MW 11:00am-12:20pm SDN Programming Languages COS 597E: Software Defined Networking.
Measurement Query Languages for Software-Defined Networks Jennifer Rexford Princeton University Joint work with Srinivas.
Compiling Network Path Queries Srinivas Narayana Princeton University.
Software Defined Networking BY RAVI NAMBOORI. Overview  Origins of SDN.  What is SDN ?  Original Definition of SDN.  What = Why We need SDN ?  Conclusion.
Declarative Network Path Queries Srinivas Narayana May 13, 2016 Advisor: Prof. Jennifer Rexford.
InterVLAN Routing 1. InterVLAN Routing 2. Multilayer Switching.
P4: Programming Protocol-Independent Packet Processors
Ready-to-Deploy Service Function Chaining for Mobile Networks
Xin Li, Chen Qian University of Kentucky
SDN challenges Deployment challenges
SDN Network Updates Minimum updates within a single switch
Jennifer Rexford Princeton University
Martin Casado, Nate Foster, and Arjun Guha CACM, October 2014
Praveen Tammana† Rachit Agarwal‡ Myungjin Lee†
NOX: Towards an Operating System for Networks
of Dynamic NFV-Policies
Srinivas Narayana MIT CSAIL October 7, 2016
SONATA: Query-Driven Network Telemetry
Programming the Networks of the Future
Programmable Networks
Sonata Query-driven Streaming Network Telemetry
Composing Software-Defined Networks
Software Defined Networking (SDN)
Software Defined Networking
Sonata: Query-Driven Streaming Network Telemetry
Programmable Networks
Memento: Making Sliding Windows Efficient for Heavy Hitters
1 Multi-Protocol Label Switching (MPLS). 2 MPLS Overview A forwarding scheme designed to speed up IP packet forwarding (RFC 3031) Idea: use a fixed length.
Project proposal: Questions to answer
Programmable Software Switches
Lecture 10, Computer Networks (198:552)
Sofia Pediaditaki and Mahesh Marina University of Edinburgh
Toward Self-Driving Networks
Toward Self-Driving Networks
Control-Data Plane Separation
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

Compiling Path Queries Princeton University Srinivas Narayana Mina Tahmasbi Jen Rexford David Walker How to simplify network management using a declarative system 1

Management = Measure + Control Network Controller Measure Control Software-Defined Networking (SDN) Knowing what’s going on is harder than knowing what to do about it

Enabling Easier Measurement Matters Networks are asked to do a lot! Partition-aggregate applications Growth in traffic demands Stringent performance requirements Avoid expensive outages Difficult to know where things go wrong! Humans are slow in troubleshooting Human time is expensive Can we build programmatic tools to help?

Example: Where’s the Packet Loss? Suspect: Faulty network device(s) along the way. A B 1000 pkts 850 pkts 

Example: Where’s the Packet Loss? Idea: “Follow” the path of packets through the network. Packet rewrite ip.src==a & ip.dst==b ip.src==a & ip.dst==b’ A B 1000 pkts 850 pkts  HSA/VeriFlow  can we talk about that? Switch ACL counters NetFlow Sampling Inaccuracy ip.src==a & ip.dst==b  count ip.dst==b  fwd port 2

Example: Where’s the Packet Loss? Complex & Inaccurate Join with multiple datasets: traffic, forwarding, topology High Overhead of collecting (unnecessary) data to answer a given question

Example: Where’s the Packet Loss? Complex & Inaccurate Join with multiple datasets: traffic, forwarding, topology High Overhead of collecting (unnecessary) data to answer a given question

Pattern: Combining Traffic & Forwarding Traffic matrix Uneven load balancing DDoS source identification Port-level traffic matrix Congested link diagnosis Slice isolation Loop detection Middlebox traversal order Incorrect NAT rewrite Firewall evasion ... Resource management Policy enforcement Problem diagnosis Yet, challenging: Accuracy: Hard to infer trajectories in data plane Efficiency: bandwidth, packet bits, rules Composition: measurements with forwarding

Our Approach Path Query System Path Query Language Declarative Query Specification Mention the term match-action here? Query-Driven Measurement Independent of Forwarding Independent of Other Measurements Independent of Hardware Details Accurate Answers Pay Exactly For What You Query Commodity (“Match-Action”) Hardware Path Query Language Query Run-Time System

Our Approach 1. Path Query Language Query Expressions Forwarding Statistics 2. Query Run-Time System SDN controller Payloads Statistics

How to design general measurement primitives … that are efficiently implemented in the network?

What are the common patterns? Measurement Use Cases Traffic matrix Uneven load balancing DDoS source identification Port-level traffic matrix Congested link diagnosis Slice isolation Loop detection Middlebox traversal order Incorrect NAT rewrite Firewall evasion ... What are the common patterns? “We looked at a wide variety of measurement use cases, and we came up with the following abstractions” Yet, challenging: Accuracy: Hard to infer trajectories in data plane Efficiency: bandwidth, packet bits, rules Composition: measurements with forwarding

(I) Path Query Language Test predicates on packets at single locations: srcip=10.0.0.1 port=3 & dstip=10.0.1.10 Combine tests with regular expression operators! sw=1 ^ sw=4 srcip=A ^ true* ^ sw=3 ingress() ^ ~(sw=firewall)* ^ egress() -- Remove before or after ingress egress ingress egress ingress egress

(I) Path Query Language Aggregate results with SQL-like grouping operators in_group(ingress(), [sw]) ^ true* ^ out_group(egress(), [sw]) Return packets, counters, or samples (NetFlow/sFlow) ingress() switch #pkts S1 1000 S2 500 S5 700 ... (ingress(), egress()) switch pairs #pkts (S1, S2) 800 (S1, S5) 200 (S2, S5) 300 ...

Language: More examples in paper...

path queries efficiently? How do we implement path queries efficiently? In general, switches don’t know prior or future packet paths. Yet, challenging: Accuracy: Hard to infer trajectories in data plane Efficiency: bandwidth, packet bits, rules Composition: measurements with forwarding

How to observe packet paths? Analyze packet paths in the data plane itself Write path information into packets! Pros: accurate trajectory information  Cons: too much per-packet information  [{sw: S1 port: 1 srcmac: ... srcip: ... ...}] [{sw: S1, ...}, {sw: S2 port: 3 srcmac: ... ...}] [{sw: S1, ...}, {sw: S2, ...}, {sw: S3 port: 2 ...}]

Reducing Path Information 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 Running a distributed DFA on the network

Reducing Path Information on Packets Record only DFA state on packets (1-2 bytes) Use existing “tag” fields! (e.g., VLAN)

(II) Query Run-Time System (sw=1 & srcip=A) ^ (sw=4 & dstip=B) sw=1 & srcip=A sw=4 & dstip=B Q0 Q1 Q2 At the end, ”in other words, if you only collect packets accepted by queries, you pay for what you query” Don’t say ”AND” for concatenation!! Use two switch figures and bubbles instead!! Switch 1: state=Q0 & srcip=A  state=Q1 Switch 4: state=Q1 & dstip=B  state=Q2 AND count!

(II) Query Run-Time System Each packet carries its own DFA state Query DFA transitions distributed to switches … as match-action rules! Packet satisfies query iff it reaches accepting states “Pay for what you query” Nuance: cost in the data plane itself… refer to paper? Packet collection is only one measure of cost. “in the paper we also look at the number of forwarding rules”

(II) Run-Time: Juicy details in paper… Packet forwarding shouldn't be affected by DFA rules No unnecessary duplicate traffic should be created Handle query overlap Predicates can also overlap Handle groupby aggregation Capture upstream or downstream of queried path Test predicates before or after forwarding on switch Optimizations: to make the system practical srcip=A ^ dstip=B sw=1 ^ true* ^ sw=4 Maybe add netflow support?

Evaluation Prototype on Pyretic + NetKAT + OpenVSwitch Publicly available: http://frenetic-lang.org/pyretic/ Queries: traffic matrix, DDoS detection, per-hop packet loss, firewall evasion, slice isolation, congested link Results on Stanford backbone (all queries together): Compile time: 5 seconds (from > 2 hours) # Rules: ~ 650 # State bytes: 2 bytes

Evaluation: Scaling Interactive problem solving (~ 15s) Number of data plane rules – mention that you say in the paper Don’t dwell too much on citation Miller, “Response time in man-computer conversational transactions”

https://youtu.be/VxOaN9iGPWc Summary We need good abstractions to measure networks Abstractions must be efficiently implementable We implemented declarative queries on packet paths: Packet state akin to a deterministic automaton Path queries can simplify network management! Queries?  http://www.cs.princeton.edu/~narayana/pathqueries https://youtu.be/VxOaN9iGPWc

(I) Language: Related Work Primitive Description Prior Work Our Extensions Atomic Predicates Boolean tests on located packets [Foster11] [Monsanto13] Switch input and output differentiation Packet Trajectories Regular expressions on atomic predicates [Tarjan79], [Handigol14] Additional regex operators (&, ~) Result Aggregation Group results by location or header fields SQL groupby, Group anywhere along a path Capture Location Get packets before or after queried path -- N/A Capture Result Actions on packets satisfying queries Sampling (sFlow) Fast algorithms for solving path problems. Robert Tarjan. Stanford technical report, 1979. http://infolab.stanford.edu/pub/cstr/reports/cs/tr/79/734/CS-TR-79-734.pdf

Packet flow on query path (I) Capture locations Capture upstream, downstream or midstream Upstream Midstream Downstream Packet flow on query path

(II) Run-Time: Data Plane Rule Layout “In” table >> Forwarding >> “Out” table state=Q_i & pred: state  Q_j AND in_capture state=Q_i’ & pred: state  Q_j’ AND out_capture forwarding Table: DFA  match-action rules; state on packets; …. Query independence  how? Forwarding independence  how?

(II) Query Compilation DFA-Transitioning >> Forwarding ) + DFA-Accepting All acting on the same data plane packets! Why does this composed policy make sense? Explain. Use policy composition operators and compiler Composing software-defined networks. Monsanto et al., 2013

(II) Query Compilation DFA-Transitioning >> Forwarding ) + DFA-Accepting dstip=10.0.0.1  fwd(1) dstip=10.0.0.2  fwd(2) dstip=10.0.0.3  fwd(3) ... state=Q0 & switch=S1 & srcip=10.0.0.1  stateQ1 state=Q1 & switch=S2 & dstip=10.0.0.3  stateQ2 >> Why does this composed policy make sense? Explain. state=Q0 & switch=S1 & srcip=10.0.0.1 & dstip=10.0.0.2  stateQ1, fwd(2) Composing software-defined networks. Monsanto et al., 2013

(II) Query Compilation (DFA-Ingress-Transitioning >> Forwarding >> DFA-Egress-Transitioning) + (DFA-Ingress-Accepting) + (DFA-Ingress-Transitioning >> Forwarding >> DFA-Egress-Accepting)

(II) Detecting Query Overlaps Predicate overlaps: q1: srcip=10.0.0.1; q2: dstip=10.0.0.2 Automaton can only have one state! Query overlaps: q1: sw=1 ^ sw=2 q2: srcip=10.0.0.1 ^ dstip=10.0.0.2 q1: in_atom(srcip=10.0.0.1) q2: out_atom(srcip=10.0.0.1) Automaton states must distinguish all possibilities!

(II) Detecting Query Overlaps Predicate overlaps: Generate orthogonal predicates! q1: srcip=10.0.0.1; q2: dstip=10.0.0.2 Generated predicates: srcip=10.0.0.1 & dstip=10.0.0.2 srcip=10.0.0.1 & ~dstip=10.0.0.2 ~srcip=10.0.0.1 & dstip=10.0.0.2

(II) Detecting Query Overlaps Convert in_ and out_ atoms to in_out_atoms: in_atom(srcip=10.0.0.1)  in_out_atom( srcip=10.0.0.1, true) out_atom(dstip=10.0.0.1)  in_out_atom(true, dstip=10.0.0.1)

(II) Detecting Query Overlaps Build one DFA for many expressions together in_atom(srcip=H1 & sw=1) ^ out_atom(sw=2 & dstip=H2) in_atom(sw=1) ^ in_out_atom(true, sw=2) [ceg] [adf] c a Q1 Q2 Q3 Q5 e Q0 [ceg] [adf] [ce] d Q6 Q7 Q8 Q4

Optimizations: Summary # Rules? Time? # States? Separate query & forwarding actions into separate stages Optimize conditional policy compilation Integrate tagging and capture policies Pre-partition predicates by flow space Cache predicate overlap decisions Decompose query predicates into multiple stages Detect predicate overlaps with Forwarding Decision Diagrams // table of optimizations + intended metrics that should be reduced

Benefit of Optimizations (Stanford) Cumulative Optimization Time (s) # Rules # State Bits None > 7900 DNF Separate query & forwarding actions into separate stages > 4920 Optimize conditional policy compilation > 4080 Integrate tagging and capture policies 2991 2596 10 Pre-partition predicates by flow space 56.19 1846 Cache predicate overlap decisions 35.13 Decompose query predicates into multiple stages 5.467 260 16 Rule space estimation for DNF cases. Stanford forwarding policy has 3840 rules overall – that’s 240 per device on average. Almost all rules match on destination ip address, which almost none of the queries actually match on. This means the best-case reduction applies: ~240 times or two orders of magnitude reduction of rule count going from single-stage to multi-stage tables. Then there’s at least a factor of 6.6 from the instances that _do_ terminate. Together, that’s 7 * 240 = 1680, or three orders of magnitude reduction in rule space from the unoptimized case.

Demo: Where’s the Packet Loss? B 1000 pkts 850 pkts 

Demo: Where’s the Packet Loss? https://youtu.be/VxOaN9iGPWc

Downstream Query Compilation (3/3) DFA-Transitioning >> Forwarding ) + DFA-Accepting All acting on the same data plane packets! Why does this composed policy make sense? Explain. Use policy composition operators and compiler Composing software-defined networks. Monsanto et al., 2013

Downstream Query Compilation (3/3) DFA-Transitioning >> Forwarding ) + DFA-Accepting dstip=10.0.0.1  fwd(1) dstip=10.0.0.2  fwd(2) dstip=10.0.0.3  fwd(3) ... state=Q0 & switch=S1 & srcip=10.0.0.1  stateQ1 state=Q1 & switch=S2 & dstip=10.0.0.3  stateQ2 >> Why does this composed policy make sense? Explain. state=Q0 & switch=S1 & srcip=10.0.0.1 & dstip=10.0.0.2  stateQ1, fwd(2) Composing software-defined networks. Monsanto et al., 2013

Downstream Query Compilation (3/3) (DFA-Ingress-Transitioning >> Forwarding >> DFA-Egress-Transitioning) + (DFA-Ingress-Accepting) + (DFA-Ingress-Transitioning >> Forwarding >> DFA-Egress-Accepting)

II. Rule Count Switch TCAM capacity: 2K-4K rules

III. Packet State Bits MPLS VLAN