Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Language Basics

Joshua Reich edited this page Jul 29, 2013 · 21 revisions
Policy Syntax Semantics E.G.
match match(f=v) returns set containing packet if packet's field f matches value, empty set otherwise v match(dstmac=MAC('00:00:00:00:00:01'))
drop drop returns empty set drop
identity identity returns set containing copy of packet identity
modify modify(f=v) returns set containing copy of packet where field f is set to v modify(srcmac=MAC('00:00:00:00:00:01'))
forward fwd(a) returns set containing copy of packet where outport field is set to a fwd(1)
flood flood() returns set containing one copy of packet for each port on the spanning tree flood()
parallel composition A + B returns the union of A's output and B's output fwd(1) + fwd(2)
sequential composition A >> B returns B's output where A's output is B's input modify(dstip=IP(10.0.0.2)) >> fwd(2) match(switch=1) >> flood()
negation ~A returns logical negation of filter* policies ~match(switch=1)
* Filter policies are policies that don't change the packet - either a set containing just the packet is returned or the empty set is returned. match, drop, and identity are filters. The negation (~), conjunction (&), and disjunction (|) are only defined on filter policies - you will get a type error if you attempt to write something like "match(switch=1) & fwd(1)" or "~flood()". Negation is defined above. Conjunction (&) and disjunction (|) evaluate in exactly the same way as the sequential (>>) and parallel (+) composition operators, respectively.
Clone this wiki locally