30 Sep 2015

Modular SDN Programming with Pyretic

;login: version

… Pyretic’s policies-as-abstract-functions approach … helps support modular programming … Pyretic programmers must discard the rule-based mental programming model and adopt the functional one. … raises the level of abstraction and enables the creation of modular software.

in Frenetic project, we are designing simple, reusable, high-level abstractions for programming SDNs; and efficient runtime system that automatically generate and install the corresponding low-level rules on switches. our abstractions cover the main facets of managing network specifying packet-forwarding policy, monitoring network conditions, and dynamically updating policy to respond to network events.

OpenFlow controllers

offer an API that is a thin “wrapper” around these operations

network policy as functions

policies-as-abstract-functions — from input located packets (i.e., packet and its location) to an output set of located packets. … in traditional OpenFlow programming, the programmer cannot write application modules independently without worrying that they might interfere with one another.

syntax summary
modify (f=v) returns packet with field f set to v
fwd (a) 'modify (port=a)

route a packet with destination IP 1 across switch A and B:

(match(switch=A) & (match(dstip='1'))>>fwd(6)) +
(match(switch=B) & (match(dstip='1'))>>fwd(7)) 

use predicate policies (match, &) to disambiguate between packets based on their location in the network as well as their contents; use modification policies (fwd) to change the header content or location of packets.