Changes between Version 17 and Version 18 of GENIExperimenter/Tutorials/OpenFlowRyu/Execute


Ignore:
Timestamp:
03/09/17 14:23:39 (7 years ago)
Author:
matta@cs.bu.edu
Comment:

--

Legend:

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

    v17 v18  
    1818== Step 3. Execute Experiment ==
    1919
    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.
     20Now 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.
    2121
    2222=== 3a. Login to your hosts ===
    2323
    24 To start our experiment we need to ssh all of our hosts.
     24To start our experiment we need to ssh into all of our hosts.
    2525
    2626To get ready for the tutorial you will need to have the following windows open:
     
    9090  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).
    9191
    92   3. Kill your Ryu controller by pressing `Ctrl-C`:
     92  3. Kill your Ryu controller by pressing `Ctrl-C`.
    9393
    9494  4. Notice what happens to your ping on host1.
     
    140140  * packetIsReplyARP : Test if this is an ARP Reply packet
    141141  * packetArpDstIp : Test what is the destination IP in an ARP packet
    142   * packetArpSrcIp : Test what is the sources IP in an ARP packet
     142  * packetArpSrcIp : Test what is the source IP in an ARP packet
    143143  * packetIsTCP : Test if a packet is TCP
    144144  * packetDstIp : Test the destination IP of a packet
     
    212212       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".
    213213
    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`): 
    215215{{{
    216216cd /tmp/ryu
     
    224224  If your controller is working, your packets will register in both terminals running tcpdump.
    225225
    226   5. Stop the Ryu controller using `Ctrl-C`:
     226  5. Stop the Ryu controller using `Ctrl-C`.
    227227
    228228=== 3g. Run a port forward Controller ===
     
    230230Now 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.
    231231
    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 controller are 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.
    233233
    234234  2. To test your controller we are going to use netcat. Go to the two terminals of host2. In one terminal run:
     
    253253}}}
    254254   
    255   5. Type something and you should see it at the the terminal of host2 at port 5000.
     255  5. Type something and you should see it at the terminal of host2 at port 5000.
    256256
    257257  6. Now, stop the simple layer 2 forwarding controller by `Ctrl-C`.
     
    271271As 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.
    272272
    273   1. Under the `/tmp/ryu/ryu/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.
     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.
    274274
    275275  2. On the terminal of `host3` run a netcat server:
     
    284284   If you want to see the solution, it's available in file /tmp/ryu/ryu/ext/Proxy.py file. 
    285285 
    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):
    287287{{{
    288288cd /tmp/ryu
    289 ./bin/ryu-manager ryu/ext/myProxy.py
     289./bin/ryu-manager ryu/ext/Proxy.py
    290290}}}
    291291