Changes between Version 17 and Version 18 of GENIExperimenter/Tutorials/OpenFlowRyu/Execute
- Timestamp:
- 03/09/17 14:23:39 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/OpenFlowRyu/Execute
v17 v18 18 18 == Step 3. Execute Experiment == 19 19 20 Now that the switch is up and running we are ready to start working on the controller. For this tutorial we are going to use the [http://osrg.github.io/ryu/ Ryu controller]. The software is already installed in the controller host for running Ryu controller.20 Now that the switch is up and running we are ready to start working on the controller. For this tutorial we are going to use the [http://osrg.github.io/ryu/ Ryu controller]. The software is already installed in the controller host for running the Ryu controller. 21 21 22 22 === 3a. Login to your hosts === 23 23 24 To start our experiment we need to ssh all of our hosts.24 To start our experiment we need to ssh into all of our hosts. 25 25 26 26 To get ready for the tutorial you will need to have the following windows open: … … 90 90 You will see (1) periodic keepalive messages being exchanged by the switch and the controller, (2) messages from the switch to the controller (e.g. when there is a table miss) and an ICMP Echo message in, and (3) messages from the controller to the switch (e.g. to install new flow entries). 91 91 92 3. Kill your Ryu controller by pressing `Ctrl-C` :92 3. Kill your Ryu controller by pressing `Ctrl-C`. 93 93 94 94 4. Notice what happens to your ping on host1. … … 140 140 * packetIsReplyARP : Test if this is an ARP Reply packet 141 141 * packetArpDstIp : Test what is the destination IP in an ARP packet 142 * packetArpSrcIp : Test what is the source sIP in an ARP packet142 * packetArpSrcIp : Test what is the source IP in an ARP packet 143 143 * packetIsTCP : Test if a packet is TCP 144 144 * packetDstIp : Test the destination IP of a packet … … 212 212 iii. '''duplicate.config''' : in this file, you specify which port you want to duplicate traffic to. To figure out which port maps to which interface, use "sudo ovs-ofctl show br0". 213 213 214 3. Run your newly written controller on the <data_interface_name> that corresponds to ''OVS:if2'' (which is connected to `host3`):214 3. Run your newly written controller to duplicate traffic on the <data_interface_name> that corresponds to ''OVS:if2'' (which is connected to `host3`): 215 215 {{{ 216 216 cd /tmp/ryu … … 224 224 If your controller is working, your packets will register in both terminals running tcpdump. 225 225 226 5. Stop the Ryu controller using `Ctrl-C` :226 5. Stop the Ryu controller using `Ctrl-C`. 227 227 228 228 === 3g. Run a port forward Controller === … … 230 230 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. 231 231 232 1. Under the `/tmp/ryu/ryu/ext` directory there are two files: '''!PortForwarding.py''' and '''myPortForwarding.py''' that are similar like the previous exercise. Both of these controllerare configured by a configuration file at `ext/port_forward.config`. Use myPortForwarding.py to write your own port forwarding controller.232 1. Under the `/tmp/ryu/ryu/ext` directory there are two files: '''!PortForwarding.py''' and '''myPortForwarding.py''' that are similar to the previous exercise. Both of these controllers are configured by a configuration file at `ext/port_forward.config`. Use myPortForwarding.py to write your own port forwarding controller. 233 233 234 234 2. To test your controller we are going to use netcat. Go to the two terminals of host2. In one terminal run: … … 253 253 }}} 254 254 255 5. Type something and you should see it at the t he terminal of host2 at port 5000.255 5. Type something and you should see it at the terminal of host2 at port 5000. 256 256 257 257 6. Now, stop the simple layer 2 forwarding controller by `Ctrl-C`. … … 271 271 As our last exercise, instead of diverting the traffic to a different server running on the same host, we will divert the traffic to a server running on a different host and on a different port. 272 272 273 1. Under the `/tmp/ryu/ryu/ext/` directory there are two files: '''Proxy.py''' and '''myProxy.py''' that are similar likethe previous exercise. Both of these controllers are configured by the configuration file `proxy.config`. Use myProxy.py to write your own proxy controller.273 1. Under the `/tmp/ryu/ryu/ext/` directory there are two files: '''Proxy.py''' and '''myProxy.py''' that are similar to the previous exercise. Both of these controllers are configured by the configuration file `proxy.config`. Use myProxy.py to write your own proxy controller. 274 274 275 275 2. On the terminal of `host3` run a netcat server: … … 284 284 If you want to see the solution, it's available in file /tmp/ryu/ryu/ext/Proxy.py file. 285 285 286 4. To test your proxy controller run (if you have written your controller then use myProxy in the following command): :286 4. To test your proxy controller run (if you have written your controller then use myProxy in the following command): 287 287 {{{ 288 288 cd /tmp/ryu 289 ./bin/ryu-manager ryu/ext/ myProxy.py289 ./bin/ryu-manager ryu/ext/Proxy.py 290 290 }}} 291 291