Changes between Version 143 and Version 144 of GENIExperimenter/Tutorials/OpenFlowOVS/Execute
- Timestamp:
- 11/19/15 23:12:16 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/OpenFlowOVS/Execute
v143 v144 148 148 sudo ovs-ofctl dump-flows br0 149 149 }}} 150 You should see at least two table entries: One for ICMP Echo (icmp_type=8) messages from host1 to host2 and one for ICMP Echo Reply (icmp_type=0) messages from host2 to host1. You may also see flow entries for arp packets.150 You should see at least two table entries: One for ICMP Echo (icmp_type=8) messages from host1 to host2 and one for ICMP Echo Reply (icmp_type=0) messages from host2 to host1. You may also see flow entries for arp packets. 151 151 152 152 2. To see messages go between your switch and your controller, open a new ssh window to your controller node and run tcpdump on the `eth0` interface and on the tcp port that your controller is listening on usually 6633. (You can also run `tcpdump` on the `OVS` control interface if you desire. However, when using the hardware switch, you can only do the `tcpdump` on your controller host.) … … 248 248 The power of !OpenFlow comes from the fact that you can decide to forward the packet anyway you want based on the supported !OpenFlow actions. A very simple but powerful modification you can do, is to duplicate all the traffic of the switch out a specific port. This is very useful for application and network analysis. You can imagine that at the port where you duplicate traffic you connect a device that does analysis. For this tutorial we are going to verify the duplication by doing `tcpdump` on two ports on the OVS switch. 249 249 250 1. Use the interfaces that are connected to `host2` and `host3`.250 1. '''Use the interfaces that are connected to `host2` and `host3`. ''' 251 251 * Software Switch (OVS): If you have not noted them down you can use the manifest and the MAC address of the interfaces (ovs:if1 and ovs:if2) to figure this out. But you should have noted down the interfaces in Section 2 when you were configuring the software switch. Run tcpdump on these interfaces; one in each of the two ovs terminals you opened. This will allow you to see all traffic going out the interfaces. 252 252 * Hardware Switch: Refer to this Section to figure out ports: [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowHW/DesignSetup#a2a.ConfiguretheControllerfortheHardwareSwitch:UsefulTips UsefulTips]. If you are using a hardware switch, you may not see the traffic on host3, but if you observe your controller output, you will notice that flows are being installed for forwarding to host2 and host3.[[BR]] … … 258 258 }}} 259 259 260 You should see traffic from host1 to host2 showing up in the tcpdump window for host3. As a comparison, you will notice that no traffic shows up in that window when the controller is running the learning switch.261 2. In the controller host directory `/tmp/pox/ext` you should see two files:260 You should see traffic from host1 to host2 showing up in the tcpdump window for host3. As a comparison, you will notice that no traffic shows up in that window when the controller is running the learning switch. 261 2. '''In the controller host directory `/tmp/pox/ext` you should see two files:''' 262 262 263 263 i. '''myDuplicateTraffic.py''' : This is the file that has instructions about how to complete the missing information. Go ahead and try to implement your first controller. … … 267 267 {{{ 268 268 cd /tmp/pox 269 ./pox.py --verbose myDuplicateTraffic --duplicate_port=?269 ./pox.py --verbose DuplicateTraffic --duplicate_port=? 270 270 }}} 271 271 … … 284 284 5. Stop the POX controller: 285 285 {{{ 286 DEBUG: myDuplicateTraffic:Got a packet : [02:f1:ae:bb:e3:a8>02:c7:e8:a7:40:65 IP]286 DEBUG:DuplicateTraffic:Got a packet : [02:f1:ae:bb:e3:a8>02:c7:e8:a7:40:65 IP] 287 287 DEBUG:SimpleL2Learning:installing flow for 02:f1:ae:bb:e3:a8.2 -> 02:c7:e8:a7:40:65.[1, 2] 288 288 … … 296 296 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. 297 297 298 1. Under the `/tmp/pox/ext` directory there are two files !PortForwarding.py and myPortForwarding.pythat 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.298 1. Under the `/tmp/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. 299 299 300 300 2. To test your controller we are going to use netcat. Go to the two terminals of host2. In one terminal run: … … 330 330 }}} 331 331 332 7. And start your port forwarding controller :333 {{{ 334 ./pox.py --verbose myPortForwarding332 7. And start your port forwarding controller (if you have written your controller then use myPortForwarding in the following command): 333 {{{ 334 ./pox.py --verbose PortForwarding 335 335 }}} 336 336 … … 351 351 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. 352 352 353 1. Under the `/tmp/pox/ext/` directory there are two files Proxy.py and myProxy.pythat are similar like the previous exercise. Both of these controllers are configured by the configuration file `proxy.config`. Use myProxy.py to write your own proxy controller.353 1. Under the `/tmp/pox/ext/` directory there are two files: '''Proxy.py''' and '''myProxy.py''' that are similar like the previous exercise. Both of these controllers are configured by the configuration file `proxy.config`. Use myProxy.py to write your own proxy controller. 354 354 355 355 2. On the terminal of `host3` run a netcat server: … … 364 364 If you want to see the solution, it's available in file /tmp/pox/ext/Proxy.py file. 365 365 366 4. To test your proxy controller run :366 4. To test your proxy controller run (if you have written your controller then use myProxy in the following command):: 367 367 {{{ 368 368 cd /tmp/pox 369 ./pox.py --verbose myProxy369 ./pox.py --verbose Proxy 370 370 }}} 371 371