Last active
August 29, 2015 14:14
-
-
Save jassoncasey/5208fb03c064f68d27df to your computer and use it in GitHub Desktop.
Brain storming on data plane configuration language syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################### | |
# Rough sketch of dp configuration syntax | |
########################################################### | |
# | |
# <table name> ":" [flow]* | |
# flow ::= <flow priority> "|" <match set> "->" [instruction set] | |
# match set ::= match ["," match]* | |
# | '*' | |
# match ::= <protocol> "(" field_match ["," field_match]* ")" | |
# field_match ::= <name> [= <classifier>]? | |
# classifier ::= <value> | |
# | <value> "/" <prefix mask lenght> | |
# | <value> <mask> | |
# | '*' | |
# | |
########################################################### | |
########################################################### | |
# Flattened version of the dp configuration | |
########################################################### | |
# Bridge learning table | |
learn: | |
# Pruning rules | |
10| eth(src=ff:ff:ff:ff:ff:ff) -> | |
drop; # explicit term for the empty instruction set | |
# Sample learning rule | |
5 | int(in_port=X), eth(src=X1:X2:X3:X4:X5:X6) -> | |
idle_timeout 180; | |
flow_removed; # use this event to delete pair rule in forward | |
goto forward; | |
# Default learning rule | |
0|* -> | |
apply output(CONTROLLER); | |
goto forward; | |
# Bridge forwarding table | |
forward: | |
# Sampel forwarding rule | |
5 | eth(dst=X1:X2:X3:X4:X5:X6) -> | |
write output(X); | |
# Default broadcast rule | |
0|* -> | |
write output(ALL); | |
########################################################### | |
# Flowmod sequence to establish the flattened configuration | |
########################################################### | |
forward: | |
0|* -> write output(ALL); | |
learn: | |
10| eth(src=ff:ff:ff:ff:ff:ff) -> | |
drop; | |
learn: | |
0|* -> | |
apply output(CONTROLLER); | |
goto forward; | |
learn: | |
5| int(in_port=X), eth(src=X1:X2:X3:X4:X5:X6) -> | |
idle_timeout 180; | |
flow_removed; | |
goto forward; | |
forward: | |
5 | eth(dst=X1:X2:X3:X4:X5:X6) -> | |
write output(X); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment