Changes between Version 70 and Version 71 of GENIExperimenter/Tutorials/OpenFlowOVS/Execute

07/22/14 10:26:31 (5 years ago)



  • GENIExperimenter/Tutorials/OpenFlowOVS/Execute

    v70 v71  
    210210  * createArpReply : Create an Arp Reply for  a different source IP
    212 === 3c. Run a traffic duplication controller ===
     212=== 3c. Debugging your Controller ===
     213While you are developing your controller, some useful debugging tools are:
     215==== i. Print messages ====
     216Run your controller in verbose mode (add --verbose) and add print messages around to see what your controller is seeing.
     218==== ii. Check the status in the switch ====
     219If you are using an OVS switch dump you can dump information about your switch, like dumping the flows:
     221sudo ovs-ofctl dump-flows br0
     223Two other useful commands show you the status of your switch:
     225sudo ovs-vsctl show br0
     226sudo ovs-ofctl show
     229==== iii. Use Wireshark to see the OpenFlow messages ====
     230Many times it is useful to see the OpenFlow messages being exchanged between your controller and the switch. This will tell you whether the messages that are created by your controller are correct and will allow you to see the details of any errors you might be seeing from the switch. If you are using OVS then you can use wireshark on both ends of the connection, in hardware switches you have to rely only on the controller view.
     232The controller host and OVS has wireshark installed, including the openflow dissector. For more information on wireshark you can take a look at the [ wireshark wiki].
     234Here we have a simple case of how to use the OpenFlow dissector for wireshark.
     236If you are on a Linux friendly machine (this includes MACs) open a terminal and ssh to your controller machine using the -Y command line argument, i.e.
     238ssh -Y <username>@<controller>
     241We will need to capture a packet trace to feed into wireshark to analyze it. So once you are logged in run:
     243sudo tcpdump -s 0 -w out.pcap tcp port 6633
     246The above command will run tcpdump capturing the full packets (`-s 0`), saving the capture to and out.pcap file (`-w out.pcap`) and only capturing packets with src/dst tcp port 6633 that is where our controller is running (`tcp port 6633`).
     248Run wireshark by typing:
     250wireshark &
     252Use the file menu to load the pcap file. Right-click on one of the files and choose "Decode as ...." and choose the OFP protocol. Once you do that you will see the OpenFlow message types in wireshark. If you have more than openflow packets in your pcap you can type `of` in the filter box on the top and only show OpenFlow messages.
     254=== 3d. Run a traffic duplication controller ===
    214256In the above example we ran a very simple learning switch controller. 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 a `tcpdump`  on a port on the OVS switch.