Skip to content
This repository has been 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

match(f=v): match packets whose field f has value v

builtin fields are:

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'))
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)
drop drop returns empty set drop
identity identity returns set containing copy of packet identity
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()
e.g., match(srcip=IP("1.1.1.2")) match(srcmac=MAC("00:00:00:00:00:01"))
Clone this wiki locally