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


Ignore:
Timestamp:
07/22/14 10:26:31 (10 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/OpenFlowOVS/Execute

    v70 v71  
    210210  * createArpReply : Create an Arp Reply for  a different source IP
    211211
    212 === 3c. Run a traffic duplication controller ===
     212=== 3c. Debugging your Controller ===
     213While you are developing your controller, some useful debugging tools are:
     214
     215==== i. Print messages ====
     216Run your controller in verbose mode (add --verbose) and add print messages around to see what your controller is seeing.
     217
     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:
     220{{{
     221sudo ovs-ofctl dump-flows br0
     222}}}
     223Two other useful commands show you the status of your switch:
     224{{{
     225sudo ovs-vsctl show br0
     226sudo ovs-ofctl show
     227}}}
     228
     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.
     231
     232The controller host and OVS has wireshark installed, including the openflow dissector. For more information on wireshark you can take a look at the [http://wiki.wireshark.org/ wireshark wiki].
     233
     234Here we have a simple case of how to use the OpenFlow dissector for wireshark.
     235
     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.
     237{{{
     238ssh -Y <username>@<controller>
     239}}}
     240
     241We will need to capture a packet trace to feed into wireshark to analyze it. So once you are logged in run:
     242{{{
     243sudo tcpdump -s 0 -w out.pcap tcp port 6633
     244}}}
     245
     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`).
     247
     248Run wireshark by typing:
     249{{{
     250wireshark &
     251}}}
     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.
     253
     254=== 3d. Run a traffic duplication controller ===
    213255
    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.