Changes between Version 26 and Version 27 of GENIExperimenter/Tutorials/OpenFlowOVS/Execute
- Timestamp:
- 09/20/13 14:29:10 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/OpenFlowOVS/Execute
v26 v27 63 63 64 64 === 2c. Point your switch to a controller === 65 65 66 An !OpenFlow switch will not forward any packet, unless instructed by a controller. Basically the forwarding table is empty, until an external controller inserts forwarding rules. The !OpenFlow controller communicates with the switch over the control network and it can be anywhere in the! Internet as long as it is reachable by the OVS host. For the purpose of this tutorial and in order to minimize the resources we have reserved we are going to run OpenFlow controller at the same host as the OVS switch. This is '''merely''' for convenience reasons, the controller could have been anywhere on the Internet. 66 67 … … 118 119 119 120 DEBUG:forwarding.l2_learning:installing flow for 02:c7:e8:a7:40:65.1 -> 02:f1:ae:bb:e3:a8.2 120 ^C121 ^C 121 122 INFO:core:Going down... 122 123 INFO:openflow.of_01:[3a-51-a1-ab-c3-43 1] disconnected … … 201 202 202 203 === 3d. Run a port forward Controller === 204 203 205 Now let's do a slightly more complicated controller. OpenFlow gives you the power to overwrite fields of your packets at the switch, for example the TCP source or destination port and do port forwarding. You can have clients trying to contact a server at port 5000, and the OpenFlow switch can redirect your traffic to a service listening on port 6000. 204 206 205 207 Under the `/loca/pox/ext` directory there are two files !PortForwarding.py and myPortForwarding.py that are similar like the previous exercise. Both of these controller are configured by a configuration file at `ext/port_forward.config`. Use myPortForwarding.py to write your own port forwarding controller. 206 208 207 To run the controller do (while at /local/pox directory)208 {{{209 ./pox.py --verbose myPortForwarding210 }}}211 212 209 To test your controller we are going to use netcat. Go to the two terminals of host2. In one terminal run: 213 210 {{{ … … 220 217 }}} 221 218 222 Now first start the simple layer 2 forwarding controller:219 Now, first start the simple layer 2 forwarding controller: 223 220 {{{ 224 221 ./pox.py --verbose forwarding.l2_learning … … 232 229 Type something and you should see it at the the terminal of host2 at port 5000. 233 230 234 Start your controller and do the same, now your text should appear on the other terminal of host2. 231 Now stop the simple layer 2 forwarding controller: 232 {{{ 233 DEBUG:forwarding.l2_learning:installing flow for 02:d4:15:ed:07:4e.3 -> 02:ff:be:1d:19:ea.2 234 ^C 235 INFO:core:Going down... 236 INFO:openflow.of_01:[36-63-8b-d7-16-4b 1] disconnected 237 INFO:core:Down. 238 ovs:/local/pox% 239 }}} 240 241 Now start your port forwarding controller: 242 {{{ 243 ./pox.py --verbose myPortForwarding 244 }}} 245 246 Repeat the netcat scenario described above. Now, your text should appear on the other terminal of host2. 247 248 249 Stop your port forwarding controller: 250 {{{ 251 DEBUG:myPortForwarding:Got a packet : [02:aa:a3:e8:6c:db>33:33:ff:e8:6c:db IPV6] 252 ^C 253 INFO:core:Going down... 254 INFO:openflow.of_01:[36-63-8b-d7-16-4b 1] disconnected 255 INFO:core:Down. 256 ovs:/local/pox% 257 }}} 235 258 236 259 === 3e. Run a server proxy Controller === 260 237 261 As our last exercise, instead of diverging the traffic to a different server running on the same host, we will diverge the traffic to a server running on a different host and on a different port. 238 262 … … 251 275 ./pox.py --verbose myProxy 252 276 }}} 253 6. Go back to the terminal of `host1` and try to connect to `host2` port 5000277 4. Go back to the terminal of `host1` and try to connect to `host2` port 5000 254 278 {{{ 255 279 nc 10.10.1.2 5000