Changes between Version 143 and Version 144 of GENIExperimenter/Tutorials/OpenFlowOVS/Execute


Ignore:
Timestamp:
11/19/15 23:12:16 (8 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

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

    v143 v144  
    148148sudo ovs-ofctl dump-flows br0
    149149}}}
    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.
    151151
    152152  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.)
     
    248248The 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.
    249249
    250   1. Use the interfaces that are connected to `host2` and  `host3`.
     250  1. '''Use the interfaces that are connected to `host2` and  `host3`. '''
    251251    * 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.
    252252    * 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]]
     
    258258}}}
    259259
    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:'''
    262262
    263263       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.
     
    267267{{{
    268268cd /tmp/pox
    269 ./pox.py --verbose myDuplicateTraffic --duplicate_port=?
     269./pox.py --verbose DuplicateTraffic --duplicate_port=?
    270270}}}
    271271
     
    284284  5. Stop the POX controller:
    285285{{{
    286 DEBUG:myDuplicateTraffic:Got a packet : [02:f1:ae:bb:e3:a8>02:c7:e8:a7:40:65 IP]
     286DEBUG:DuplicateTraffic:Got a packet : [02:f1:ae:bb:e3:a8>02:c7:e8:a7:40:65 IP]
    287287DEBUG:SimpleL2Learning:installing flow for 02:f1:ae:bb:e3:a8.2 -> 02:c7:e8:a7:40:65.[1, 2]
    288288
     
    296296Now 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.
    297297
    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.
     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.
    299299
    300300  2. To test your controller we are going to use netcat. Go to the two terminals of host2. In one terminal run:
     
    330330}}}
    331331
    332   7. And start your port forwarding controller:
    333 {{{
    334 ./pox.py --verbose myPortForwarding
     332  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
    335335}}}
    336336
     
    351351As 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.
    352352
    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.
     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.
    354354
    355355  2. On the terminal of `host3` run a netcat server:
     
    364364   If you want to see the solution, it's available in file /tmp/pox/ext/Proxy.py file. 
    365365 
    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)::
    367367{{{
    368368cd /tmp/pox
    369 ./pox.py --verbose myProxy
     369./pox.py --verbose Proxy
    370370}}}
    371371