Changes between Version 9 and Version 10 of Internal/OpenFlow/Controllers/BigSwitch


Ignore:
Timestamp:
07/06/11 21:38:54 (9 years ago)
Author:
akoshibe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/Controllers/BigSwitch

    v9 v10  
    11= The Big Switch Controller =
    22This page describes the controller by Big Switch Networks. The controller uses a REST API that leverages HTTP control messages to let an admin manipulate flows.
    3 == !Installation/Setup ==
     3== !Contents ==
     4 * !Installation/Setup
     5 * BigOS CLI
     6 * REST API
     7== I !Installation/Setup ==
    48The controller may be reached from ofc, accessible as user `native`, password `native101` from orbit-lab.org.
    59The controller is a KVM guest currently named bigswitchcontroller-110405. You can confirm this through `virsh` or `virt-manager`. The latter is a GUI, and more straight forward.
     
    1923once configured, you should be able to ssh to it from the outside.
    2024
    21 == I BigOS CLI ==
     25== II BigOS CLI ==
    2226This is the main interface to the Big Switch controller. From here, you can query for / set various !OpenFlow-related parameters such as controller state and the switches connected to it.
    23 === 1.1 Logging in ===
     27=== 2.1 Logging in ===
    2428From gw.orbit-lab.org, ssh to `kvm-big` as user `admin`, password ''native101''. You should see something like below:
    2529{{{
     
    3135172.16.0.14>
    3236}}}
    33 === 1.2 Information Lookup ===
     37=== 2.2 Information Lookup ===
    3438The caret is the prompt for the CLI, which follows syntax similar to Cisco IOS. To see available commands, just type "?" or hit tab. As with regular switch CLIs, the controller understands command completion. For example, to see the list of !OpenFlow switches connected to the controller, type `show switch`:
    3539{{{
     
    5357Here, we have switched to the context of a switch whose DPID is 00:00:00:10:10:22:32:32, in order to look up general information about it.
    5458
    55 === 1.3 Monitoring VSIs ===
     59=== 2.3 Monitoring VSI !OpenFlow Stats ===
    5660 * `show switch [dpid] flow` shows you the current active flows on a switch of DPID [dpid].
    5761 * `show switch [dpid] trace [opt]` shows you the !OpenFlow control messages associated with that switch. Optional parameters may be added to the command.   
    5862
    59 === 1.4 Configuration ===
     63=== 2.4 Context switching ===
    6064Configuration of the controller-managed !OpenFlow network is done from the configuration prompt. To enter the prompt, first enter enabled mode (via command `enable`) and then enter configuration mode via `configure`.
    6165{{{
     
    6973kvm-big(config-switch)#
    7074}}}
    71 Where the colon-and-hex value is the switch's DPID. Issuing a config command for a nonexistent element (e.g. switch DPID or a flow) would create a new !OpenFlow element. Also, unlike in the case of IOS, regular mode commands may be run from here unmodified ^1^. All available parameters for a certain context can, again, be found by hitting tab or with `?`.
    72 == II The REST API ==
     75Where the colon-and-hex value is the switch's DPID. Issuing a config command for a nonexistent element (e.g. switch DPID or a flow) would create a new !OpenFlow element. `exit` leaves a context without saving any of the changes made; you may make configurations persistent with `write memory`.
     76
     77Also, unlike in the case of IOS, regular mode commands (e.g. `show`) can be run from the config prompt unmodified ^1^. All available parameters for a certain context can, again, be found by hitting tab or with `?`. 
     78
     79=== 2.5 !Adding/Removing static flow entries ===
     80Flows for switches may be manually added by entering the `flow-entry [flowname]` context from the context of a switch you want to push flows to. A new `[flowname]` parameter will create and enter a new context for a flow named `[flowname]`. Some important things to note about flow-entries are:
     81 
     82 * By default they are disabled (active False). Enable a flow entry from its context with `active True` (note that 'True' and 'False' must be capitalized)
     83 * `ether-type` must be specified in decimal (e.g. 2048, not 0x0800 for IP) 
     84 * `src-ip` may be a single IP address or an IP block (e.g. 192.168.1.0/24).
     85 * `protocol` refers to the IP header protocol field (e.g. 1 for ICMP)
     86
     87=== 2.5.1. declaring actions ===       
     88the `actions` parameter of a flow-entry loosely follow the dpctl syntax; notably, the `output` option takes parameters with an equals (=) sign, not a colon. Several things to note are:
     89
     90 * `output=` may only be followed by one value. If more than one port is to be specified, the declaration will be:
     91{{{
     92kvm-big(config-flow-entry)# actions output=x,output=y,... 
     93}}}
     94 * If an action does not seem to work (e.g. `flood`), it may need to be perpended with `output=`.
     95 
     96== III The REST API ==
    7397In addition to the CLI, a scripting-friendly REST API is available through debug mode. This is a separate process form the CLI.
    7498
    7599Flow manipulation from the API is done by issuing HTTP control messages (e.g. PUT, GET, DELETE) using `curl`. The API will respond with JSON format data. Here we'll describe how to use the REST API through an example based on the REST documents (linked at the bottom of the page) and e-mail exchanges.
    76 === 2.1 Logging in, some prep work ===
     100=== 3.1 Logging in and initial setup ===
    77101 1. ''Enter debug mode''. In order to use the REST API, you must be at the Linux shell. Type "debug bash" to switch out of the CLI.
    78102{{{
     
    85109}}}
    86110 2. ''open port 8000''. Allow connections to port 8000 with the command `sudo ufw allow 8000`. You'll be using this port to talk to the controller using `curl`.   
    87 === 2.2 Using `curl` ===
     111=== 3.2 Using `curl` ===
    88112`curl` is a data transfer tool supporting a menagerie of protocols including HTTP. FTP, SCP, and the likes. It allows both pushing and pulling of data to/from a server. In our case, `curl` allows us to manipulate the controller through HTTP without worrying about the details of the protocol.
    89 ==== 2.2.1 HTTP queries ==== 
     113==== 3.2.1 Getting information (HTTP GET) ==== 
    90114Underneath, HTTP GET messages are used to query the controller. Superficially, the syntax is:
    91115 
     
    128152"2011-05-15 18:10:25.886000", "active": true, "buffers": 256}
    129153}}}
    130 ==== 2.2.2 Modifying flows (HTTP PUT/DELETE) ====
     154==== 3.2.2 Modifying flows (HTTP PUT/DELETE) ====
    131155==== Pushing flows ====
    132156HTTP PUT messages are used to modify flows. The basic syntax is as follows: