Changes between Version 7 and Version 8 of Internal/OpenFlow/Controllers/BigSwitch
- Timestamp:
- May 16, 2011, 5:57:25 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internal/OpenFlow/Controllers/BigSwitch
v7 v8 12 12 * nameserver: 172.16.0.9 13 13 * domain: orbit-lab.org 14 15 You can see this clearly in the screenshot below, taken from an actual setup session: 16 17 [[Image(Screenshot.png)]] 14 18 15 19 once configured, you should be able to ssh to it from the outside. … … 62 66 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 `?`. 63 67 == 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 68 In addition to the CLI, a scripting-friendly REST API is available through debug mode. This is a separate process form the CLI. 65 69 66 70 Flow 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 === 68 72 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. 69 73 {{{ … … 114 118 For 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": 115 119 {{{ 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}120 bsn@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": 122 199, "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} 120 124 }}} 121 125 ==== 2.2.2 Modifying flows (HTTP PUT/DELETE) ==== 126 ==== Pushing flows ==== 122 127 HTTP PUT messages are used to modify flows. The basic syntax is as follows: 123 128 124 129 `curl -X PUT -d '{"config-params"}' http://localhost:8000/rest/parameter-to-change/` 125 130 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:131 where `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: 127 132 {{{ 128 133 bsn@kvm-big:~$ curl -X PUT -d '{"name":"testflow","active":"True","src-ip":"10.18.1.1","ether-type":"2048", … … 146 151 ... 147 152 }}} 153 ==== Removing flows ==== 148 154 Deleting the flow utilizes the DELETE message: 149 155 … … 158 164 [[BR]][[BR]] 159 165 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.^