Changes between Version 7 and Version 8 of Internal/OpenFlow/Controllers/BigSwitch


Ignore:
Timestamp:
May 16, 2011, 5:57:25 PM (13 years ago)
Author:
akoshibe
Comment:

Legend:

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

    v7 v8  
    1212 * nameserver: 172.16.0.9
    1313 * domain: orbit-lab.org
     14
     15You can see this clearly in the screenshot below, taken from an actual setup session:
     16
     17[[Image(Screenshot.png)]]
    1418
    1519once configured, you should be able to ssh to it from the outside.
     
    6266Where 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 `?`.
    6367== II The REST API ==
    64 In addition to the CLI, a scripting-friendly REST API is available through debug mode. This is a separate process form the CLI
     68In addition to the CLI, a scripting-friendly REST API is available through debug mode. This is a separate process form the CLI.
    6569
    6670Flow 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.
    67 === 2.1 Logging on, some prep work ===
     71=== 2.1 Logging in, some prep work ===
    6872 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.
    6973{{{
     
    114118For such cases, information about each element is separated by curly braces. To pull information about just one switch, for example, you can query for something "one directory down":
    115119{{{
    116 bsn@kvm-big:~$ curl http://localhost:8000/rest/switch/00:00:00:10:10:25:32:35/ {"tables": 2, "socket-
    117 address": "/172.16.0.253:62302", "dpid": "00:00:00:10:10:25:32:35", "capabilities": 199, "controller":
    118 "172.16.0.14:6633", "actions": 4095, "ip-address": "172.16.0.253", "connected-since": "2011-05-15 18:10
    119 :25.886000", "active": true, "buffers": 256}
     120bsn@kvm-big:~$ curl http://localhost:8000/rest/switch/00:00:00:10:10:25:32:35/
     121{"tables": 2, "socket-address": "/172.16.0.253:62302", "dpid": "00:00:00:10:10:25:32:35", "capabilities":
     122199, "controller": "172.16.0.14:6633", "actions": 4095, "ip-address": "172.16.0.253", "connected-since":
     123"2011-05-15 18:10:25.886000", "active": true, "buffers": 256}
    120124}}}
    121125==== 2.2.2 Modifying flows (HTTP PUT/DELETE) ====
     126==== Pushing flows ====
    122127HTTP PUT messages are used to modify flows. The basic syntax is as follows:
    123128
    124129 `curl -X PUT -d '{"config-params"}' http://localhost:8000/rest/parameter-to-change/`
    125130
    126 where `config-params` is in JSON format and the options based on `dpctl` parameters. For example, to create a flow named "testflow" which redirects pings from address 10.18.1.1 to port 0/29 on switch of DPID 00:00:00:10:10:25:32:35: 
     131where `config-params` is in JSON format and the options based on `dpctl` parameters ^2^. For example, to create a flow named "testflow" which redirects pings from address 10.18.1.1 to port 0/29 on switch of DPID 00:00:00:10:10:25:32:35: 
    127132{{{
    128133bsn@kvm-big:~$ curl -X PUT -d '{"name":"testflow","active":"True","src-ip":"10.18.1.1","ether-type":"2048",
     
    146151...
    147152}}}
     153==== Removing flows ====
    148154Deleting the flow utilizes the DELETE message:
    149155
     
    158164[[BR]][[BR]]
    159165
    160 ^1 Last time I played with IOS I remember you can do `run <full command>` in order to run out-of-context commands. But, I'm not a CCNA so I might be lying.^   
     166^1 Last time I played with IOS I remember you can do `run <full command>` in order to run out-of-context commands. But, I'm not a CCNA so I might be lying.^  [[BR]]
     167^2 `man dpctl` on a machine running a controller should give you the man pages describing the syntax. will possibly add links to an on-line man page here in the future.^