Skip to content
Craig Riecke edited this page Jun 13, 2016 · 1 revision

Frenetic Command Line

You invoke frenetic with one of the following subcommands:

  • http-controller starts a web server which accepts REST commands (Northbound) and talks to OpenFlow switches (Southbound). You use this subcommand when executing network applications written in Python or REST/JSON.
  • dump accepts NetKAT Surface Syntax files, compiles them into OpenFlow flow tables, and outputs the result.
  • compile-server accepts NetKAT surface syntax files via REST and outputs the JSON-formatted flow tables. It is like http-controller but it doesn't talk to actual OpenFlow switches.
  • shell starts a REPL for Frenetic.
  • help displays command help

Common Options for All Subcommands

  • --verbosity log-level, where log-level can be debug, info, or error. Defaults to info.
  • --log path, where path is the directory to write logs to, or the special paths stdout and stderr.
    Defaults to stderr.

http-controller

frenetic http-controller [ --http-port=9000 ] [ --openflow-port=6633 ]
  • http-port=port is the HTTP port for the northbound web server.
  • openflow-port=port is the TCP port for the southbound openflow switches. This defaults to 6633, which is the default OpenFlow 1.0 port.

dump

The commmand line compiler accepts Raw NetKAT files and compiles them into OpenFlow flow tables. The command line options vary depending on the type of compiler used:

dump local

frenetic dump local FILE [--dump-fdd] [--json] [--no-tables] [--print-fdd] [--switches n]
  • --dump-fdd dumps a dot file encoding of the intermediate representation (FDD) generated by the local compiler
  • --json parses input file as JSON.
  • --no-tables suppresses table printing.
  • --print-fdd prints an ASCII encoding of the intermediate representation (FDD) generated by the local compiler
  • --switches n specifies number of switches to dump flow tables for (assuming switch-numbering 1,2,...,n)

dump global

frenetic dump global FILE [--dump-auto] [--dump-fdd] [--json] [--no-tables] [--print-auto] [--print-fdd]
  • --dump-auto dumps a dot file encoding of the intermediate representation generated by the global compiler (symbolic NetKAT automaton)
  • --dump-fdd dumps a dot file encoding of the intermediate representation (FDD) generated by the local compiler
  • --json parses input file as JSON.
  • --no-tables suppresses table printing.
  • --print-auto prints an ASCI encoding of the intermediate representation generated by the global compiler (symbolic NetKAT automaton)
  • --print-fdd prints an ASCII encoding of the intermediate representation (FDD) generated by the local compiler

dump virtual

frenetic dump virtual FILE [--dump-fdd] [--peg file] [--ping file] [--print-fdd] [--print-global-pol]
    [--veg file] [--ving file] [--ving-pol file] [--vrel file] [--vtopo file]
  • --dump-fdd dumps a dot file encoding of the intermediate representation (FDD) generated by the local compiler
  • --peg file Physical egress predicate. If not specified, defaults to peg.kat
  • --ping file Physical ingress predicate. If not specified, defaults to ping.kat
  • --print-fdd prints an ASCII encoding of the intermediate representation (FDD) generated by the local compiler
  • --print-global-pol prints global NetKAT policy generated by the virtual compiler
  • --ptopo file Physical topology. If not specified, defaults to ptopo.kat
  • --veg file Virtual egress predicate. If not specified, defaults to veg.kat
  • --ving file Virtual ingress predicate. If not specified, defaults to ving.kat
  • --ving-pol file Virtual ingress policy. If not specified, defaults to ving_pol.kat
  • --vrel file Virtual-physical relation. If not specified, defaults to vrel.kat
  • --vtopo file Virtual topology. If not specified, defaults to vtopo.kat

compile-server

frenetic compile-server [ --http-port=9000 ] 
  • http-port=port is the HTTP port for the northbound web server.

The compile server is an HTTP server, but it only compiles NetKAT policies into OpenFlow Flow Tables and outputs the response. It does not connect to any OpenFlow switch or pass back OpenFlow events.

The REST commands that the compile-server responds are listed in the NetKAT REST Reference

shell

frenetic shell 

The Shell is a REPL for Frenetic. Like the HTTP server, it connects via OpenFlow to switches.
It can load Raw NetKAT policies, compile them to the server, and print out current flow-tables.
It does not respond to OpenFlow events, however, like the HTTP server does. It's a good tool for debugging.

To see shell commands, start up Frenetic shell and type help.