Reasoning about Software Defined Networks Mooly Sagiv 03-640-7606 Tel Aviv University Thursday 16-18 (Physics 105) Monday 14-16 Schrieber.

Slides:



Advertisements
Similar presentations
SDN Applications Jennifer Rexford Princeton University.
Advertisements

Frenetic: A High-Level Language for OpenFlow Networks Nate Foster, Rob Harrison, Matthew L. Meola, Michael J. Freedman, Jennifer Rexford, David Walker.
1 Chapter 22 Network layer Delivery, Forwarding and Routing.
Composing Software-Defined Networks Princeton*Cornell^ Chris Monsanto*, Joshua Reich* Nate Foster^, Jen Rexford*, David Walker*
Connecting LANs: Section Figure 15.1 Five categories of connecting devices.
1 Semester 2 Module 4 Learning about Other Devices Yuda college of business James Chen
VeriCon: Towards Verifying Controller Programs in SDNs (PLDI 2014) Thomas Ball, Nikolaj Bjorner, Aaron Gember, Shachar Itzhaky, Aleksandr Karbyshev, Mooly.
Towards a Logic for Wide-Area Internet Routing Nick Feamster and Hari Balakrishnan M.I.T. Computer Science and Artificial Intelligence Laboratory Kunal.
Internetworking Different networks –Different bit rates –Frame lengths –Protocols.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
David Walker Princeton University Joint work with Nate Foster, Michael J. Freedman, Rob Harrison, Christopher Monsanto, Mark Reitblatt, Jennifer Rexford,
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
RD-CSY /09 Distance Vector Routing Protocols.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Routing and Routing Protocols
Delivery, Forwarding, and Routing
MULTICASTING Network Security.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 21 Introduction to Computer Networks.
Chapter 9 Classification And Forwarding. Outline.
Languages for Software-Defined Networks Nate Foster, Arjun Guha, Mark Reitblatt, and Alec Story, Cornell University Michael J. Freedman, Naga Praveen Katta,
Enabling Innovation Inside the Network Jennifer Rexford Princeton University
Connecting LANs, Backbone Networks, and Virtual LANs
Formal checkings in networks James Hongyi Zeng with Peyman Kazemian, George Varghese, Nick McKeown.
Introduction to IT and Communications Technology Justin Champion C208 – 3292 Ethernet Switching CE
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 8: Bridging Slides used with permissions.
1 Internet Protocol: Forwarding IP Datagrams Chapter 7.
Towards a Logic for Wide- Area Internet Routing Nick Feamster Hari Balakrishnan.
Unicast Routing Protocols  A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes.
Frenetic: A Programming Language for Software Defined Networks Jennifer Rexford Princeton University Joint work with Nate.
1 Introducing Routing 1. Dynamic routing - information is learned from other routers, and routing protocols adjust routes automatically. 2. Static routing.
VeriFlow: Verifying Network-Wide Invariants in Real Time
Languages for Software-Defined Networks Nate Foster, Michael J. Freedman, Arjun Guha, Rob Harrison, Naga Praveen Katta, Christopher Monsanto, Joshua Reich,
Professor Yashar Ganjali Department of Computer Science University of Toronto Some slides courtesy.
Reasoning about Software Defined Networks Mooly Sagiv Tel Aviv University Thursday (Physics 105) Monday Schrieber.
Frenetic: Programming Software Defined Networks Jennifer Rexford Princeton University Joint with Nate Foster, David Walker,
VeriCon: Towards Verifying Controller Programs in SDNs Thomas Ball, Nikolaj Bjorner, Aaron Gember, Shachar Itzhaky, Aleksandr Karbyshev, Mooly Sagiv, Michael.
4: Network Layer4-1 Schedule Today: r Finish Ch3 r Collect 1 st Project r See projects run r Start Ch4 Soon: r HW5 due Monday r Last chance for Qs r First.
Packet switching network Data is divided into packets. Transfer of information as payload in data packets Packets undergo random delays & possible loss.
Programming Languages for Software Defined Networks Jennifer Rexford and David Walker Princeton University Joint work with the.
Routing and Routing Protocols
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
Reasoning about Software Defined Networks Shachar Itzhaky & Mooly Sagiv Tel Aviv University Thursday (Physics 105) Monday.
Jennifer Rexford Princeton University MW 11:00am-12:20pm SDN Programming Languages COS 597E: Software Defined Networking.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Data-Plane Verification COS 597E: Software Defined Networking.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Testing and Debugging COS 597E: Software Defined Networking.
Programming Abstractions & Languages for SDN: Frenetic & Pyretic.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
The Concept of Universal Service
Network Layer COMPUTER NETWORKS Networking Standards (Network LAYER)
Programming SDN 1 Problems with programming with POX.
SDN challenges Deployment challenges
Multi Node Label Routing – A layer 2.5 routing protocol
SDN Network Updates Minimum updates within a single switch
Programming SDN Newer proposals Frenetic (ICFP’11) Maple (SIGCOMM’13)
Martin Casado, Nate Foster, and Arjun Guha CACM, October 2014
Network Layer Goals: Overview:
COMP 3270 Computer Networks
Chapter 4 Data Link Layer Switching
Srinivas Narayana MIT CSAIL October 7, 2016
Delivery, Forwarding, and Routing
Languages for Software-Defined Networks
Programming Languages for Programmable Networks
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Programmable Networks
Lecture 10, Computer Networks (198:552)
Frenetic: Programming Software Defined Networks
Control-Data Plane Separation
Presentation transcript:

Reasoning about Software Defined Networks Mooly Sagiv Tel Aviv University Thursday (Physics 105) Monday Schrieber 317 Adviser: Michael Shapira Hebrew University

Content Challenges in SDNs Programming Language Abstractions Programming Language Principles Program Language Tools Other useful tools Beyond SDNs

Challenges in SDN Programming complexity Modularity Composing operations Handling Updates Reliability Performance Testing Productivity Non-expert programmers

How hard is it to program networks Routers with 20+ million lines of code Cascading failures, vulnerabilities, etc Low level programming No abstractions – Virtual memory – Operating Systems – Resource Allocations – Libraries – Types

Modularity: Simple Repeater def repeater(switch): # Repeat Port 1 to Port 2 pat1 = {in_port:1} act1 = [forward(2)] install(switch, pat1, DEFAULT, act1) # Repeat Port 2 to Port 1 pat2 = {in_port:2} act2 = [forward(1)] install(switch, pat2, DEFAULT, act2) def repeater(switch): # Repeat Port 1 to Port 2 pat1 = {in_port:1} act1 = [forward(2)] install(switch, pat1, DEFAULT, act1) # Repeat Port 2 to Port 1 pat2 = {in_port:2} act2 = [forward(1)] install(switch, pat2, DEFAULT, act2) Simple Repeater 12 Controller When a switch joins the network, install two forwarding rules.

Composition: Web Traffic Monitor def web_monitor(switch)): # Web traffic from Internet pat = {inport:2,tp_src:80} install(switch, pat, DEFAULT, []) query_stats(switch, pat) def stats_in(switch, pat, bytes, …) print bytes sleep(30) query_stats(switch, pat) def web_monitor(switch)): # Web traffic from Internet pat = {inport:2,tp_src:80} install(switch, pat, DEFAULT, []) query_stats(switch, pat) def stats_in(switch, pat, bytes, …) print bytes sleep(30) query_stats(switch, pat) Monitor Web (“port 80”) traffic 12 Web traffic When a switch joins the network, install one monitoring rule.

Composition: Repeater + Monitor def switch_join(switch): pat1 = {inport:1} pat2 = {inport:2} pat2web = {in_port:2, tp_src:80} install(switch, pat1, DEFAULT, None, [forward(2)]) install(switch, pat2web, HIGH, None, [forward(1)]) install(switch, pat2, DEFAULT, None, [forward(1)]) query_stats(switch, pat2web) def stats_in(switch, xid, pattern, packets, bytes): print bytes sleep(30) query_stats(switch, pattern) def switch_join(switch): pat1 = {inport:1} pat2 = {inport:2} pat2web = {in_port:2, tp_src:80} install(switch, pat1, DEFAULT, None, [forward(2)]) install(switch, pat2web, HIGH, None, [forward(1)]) install(switch, pat2, DEFAULT, None, [forward(1)]) query_stats(switch, pat2web) def stats_in(switch, xid, pattern, packets, bytes): print bytes sleep(30) query_stats(switch, pattern) Repeater + Monitor Must think about both tasks at the same time.

Concurrency: Switch-Controller Delays Common programming idiom – First packet goes to the controller – Controller installs rules 8 packets

Concurrency: Switch-Controller Delays More packets arrive before rules installed? – Multiple packets reach the controller packets

Concurrency: Switch-Controller Delays Rules along a path installed out of order? – Packets reach a switch before the rules do Must think about all possible packet and event orderings. packets

Debugging is hard[Kazemian’NSDI’13] Distributed switch tables Varied delays Cascading effects on switch tables Multiple protocols Human interaction …

SDN Performance Given an SDN controller code Estimate the cost of routing per packet – Length of the path – Weight of the path – Number of controller interventions

Programming Language Abstractions Hide the implementation Interpreter/Compiler guarantees performance Benefits – Portability – Ease of use – Reliability – Compositionality – Productivity

Language Abstractions Procedures Abstract data types Objects Resources – Memory management – Garbage collection Control abstractions – Exceptions – Iterators – Tree Pattern Matching – Higher order functions – Continuation – Lazy evaluation – Monads Libraries Domain specific languages Declarative programming

Programming Language Principles Rigorously define the meaning of programs Supports abstraction Prove compiler correctness Prove that two SDN programs are observationally equivalent – The same packet transmissions

A Simple Example Numeric Expressions – ::= + | * | number The semantic of expressions is a number E  :  int Inductively defined – E  n  = n – E  e 1 + e 2  = E  e 1  + E  e 2  – E  e 1 * e 2  = E  e 1  * E  e 2  Compositional Fully abstract e 1  e 2 iff E  e 1  = E  e 2  

A Simple Example + Var Numeric Expressions – ::= + | * | number | id Need to introduce states Var  Int Examples – [x  2, y  3] x = – [x  2, y  3] z = 2 – [x  2, y  3][z  5] = [x  2, y  3,z  5] – [x  2, y  3][x  5] = [x  5, y  3] – [x  2, y  3][x  5]x = 5 – [x  2, y  3][x  5]y = 2

A Simple Example + Var Numeric Expressions – ::= + | * | number | id The semantic of expressions is a function from states to numbers E  : exp  (Var  Int)  Int Inductively defined – E  n   = n – E  e 1 + e 2   = E  e 1   + E  e 2   – E  e 1 * e 2   = E  e 1   * E  e 2   – E  id   =  id – E  x+2  [x  5] = E  x  [x  5] + E  2  [x  5] = [x  5]x + 2 = =7 – x + x  2 * x

Benefits of formal semantics Can be done for arbitrary languages Automatically generate interpreters Rational language design Formal proofs of language properties – Observational equivalence – Type safety Correctness of tools – Interpreter – Compiler – Static Analyzer – Model Checker

A Simple Controller Language No packet changes No priorities No statistics Simple updates – Per-flow installation

A Simple Controller Language ::= * ::= rel ( *) // auxiliary relations ::= packetIn (sid, pid, )  * ::= port(int) ::= send( ) | install (sid, pid,, ) // update flow table | id.insert( *) // update auxiliary relations | if rid( *) then * else * | if rid( *) then * | ; ::= |none // drop the package ::= id | id (exp) |

Learning Switch with 3 ports rel connected (Sw, Pr, Ho) PacketIn(s, p, port(1)) -> connected.insert (s, port(1), p.src) if connected(s, port(2), p.dst) then { send (s, p, port(2)) install(s, p, port(1), port(2)) } else if connected(s, port(3), p.dst) then { send (port(3)) install(s, p, port(1), port(3)) } else { // flood send (port(2)) send (port(3)) } PacketIn(s, p, port(2)) -> … PacketIn(s, p, port(3)) -> …

The semantics of the controller What is the meaning of package sent by a given host? – A set of paths Example: Learning Switch a   

The semantics of the controller What is the meaning of package sent by a given host? – A set of paths Dynamically changed – Even for fixed topology Unbounded length But can it be defined?

The State of a switch The switch table is a relation on ports FT = Sw  P(Pk  Pr  Pr  {none}) Updated by the controller Actual nodes depend on the topology graph input portoutput port

The Semantics of Expressions ::= id | id (exp) | Val = Int  Pr  {P(T  t 1   … T  t k  | t 1, …, t k are valid types} Controller State  such that  : Var  Val E  id   =  id E  id (e)   = F  id  (E  e   ) E  port(n)   = n

The Meaning of Commands ::= send( ) | install (, ) | id.insert( *) | if RID( *) then * else * | if RID( *) then * | ; ::= |none C  :  (Sw  Pk  Pr)  (   FT)  (   FT  P(Pr  {none}) event input-stateoutput

Atomic Commands C  send(pr)   sw, pk, ip  , ft  = , ft, {E  pr  }  C  install(s, p, pr in,pr out )   sw, pk, ip  , ft  =  , ft  {  pk, E  pr in , E  pr out   },   C  r.insert(e)   sw, pk, ip  , ft  =   [ r   r  {  E  e   } ], ft,  

Conditional Commands C  if r(e) then c 1 else c 2  ev , ft  = C  c 1  ev , ft  C  c 2  ev , ft  If  E  e     r If  E  e     r

Sequential Composition C  c 1 ; c 2  ev , ft  = let  ’, ft’, prs 1  = C  c 1  ev , ft   ”, ft”, prs 2  = C  c 2  ev  ’, ft’  in  ”, ft”, prs 1  prs 2 

Semantics of Events G  :  (Sw  Pk  Pr)  P((   FT)  (   FT  P(Pr  {none})) G  packetIn(s, p, i)  c   sw, pk, ip  = R where , ft  R  ’, ft’, ports  iff ip = E  i   (  op : Pr.  pk, ip, op   ft)  C  c   sw, pk, ip   [s  sw, p  pk], ft  =  ’, ft’, sp 

System State Comprises of: – Single state of the controller – Flow-table for each switch FTS = Sw  FT

Packet Histories Packets can influence the routing of other packets Histories can be seen as sequences of packet transmissions HST= ( SW  PR  PK  (PR  {none}) ) *

Small-step semantics (Controller)  ctrl : (   FTS  HST)  (   FTS  HST) , fts, h   ctrl  ’, fts’, h’  iff  sw : Sw, pk : Pk, ip : Pr, sp : P(Pr), ft’ : FT. , fts sw  ( G  evnt   sw, pk, ip  )  ’, ft’, sp   fts’ = fts[sw  ft’]  h’ = h   sw, ip, pk, j  j  sp or (sp =  and j=none)

Small-step Semantics (Switch)  sw : (   FTS  HST)  (   FTS  HST) , fts, h   sw  ’, fts’, h’  iff  =  ’  fts=fts’   sw : Sw, pk : Pk, ip : Pr, op : Pr  {none}.  pk, ip, op   fts sw  h’ = h   sw, ip, pk, op 

Executions Combined step semantics: –  =  ctrl   sw A sequence of event processing steps has the from – a 1  a 2  …  a n

Feasible Histories Given a topology graph G over V = Ho  (Sw  Pr) A history h is feasible iff for any packet pk  Pk, any two consecutive entries for p in h: –  sw 1, ip 1, pk, op 1  and  sw 2, ip 2, pk, op 2  – there exists an edge between  sw 1, op 1  and  sw 2, ip 2 

InPktOut Example a   Port inPacketPort out PortHost connected =

InPktOut Example a    Port inPacketPort out  PortHost 2  connected =

InPktOut 3  2 Example a    Port inPacketPort out   PortHost 2  3  connected =

InPktOut 3  2 Example a    Port inPacketPort out   PortHost 2  3  connected =

Useful Programming Language Tools Interpreter Compiler Parser Type Checker Static Program Analysis Verification Tool Dynamic Program Analysis – Model checker

Interesting Network Properties PropertyMeaning ConnectivityEvery packet eventually reaches its destination No forwarding loops No black holes No dropping Access controlNo paths between certain hosts of certain packets