Changes between Version 12 and Version 13 of GENIExperimenter/Tutorials/OpenFlowOVS/Execute
- Timestamp:
- 09/18/13 13:27:00 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/OpenFlowOVS/Execute
v12 v13 63 63 64 64 === 2c. Point your switch to a controller === 65 An OpenFlow switch will not forward any packet, unless instructed by a controller. Basically the forwarding table is empty, until an external controller inserts forwarding rules. The OpenFlow controller communicates with the switch over the control network and it can be anywhere in theInternet as long as it is reachable by the OVS host. For the purpose of this tutorial and in order to minimize the resources we have reserved we are going to run OpenFlow controller at the same host as the OVS switch. This is '''merely''' for convenience reasons, the controller could have been anywhere on the Internet.66 67 In order to point our software OpenFlow switch to the controller run:65 An !OpenFlow switch will not forward any packet, unless instructed by a controller. Basically the forwarding table is empty, until an external controller inserts forwarding rules. The !OpenFlow controller communicates with the switch over the control network and it can be anywhere in the! Internet as long as it is reachable by the OVS host. For the purpose of this tutorial and in order to minimize the resources we have reserved we are going to run OpenFlow controller at the same host as the OVS switch. This is '''merely''' for convenience reasons, the controller could have been anywhere on the Internet. 66 67 In order to point our software !OpenFlow switch to the controller run: 68 68 {{{ 69 69 sudo ovs-vsctl set-controller br0 tcp:127.0.0.1:6633 … … 71 71 72 72 ==== `standalone` vs `secure` mode ==== 73 The OpenFlow controller is responsible for setting up all flows on the switch, which means that when the controller is not running there should be no packet switching at all. Depending on the setup of your network, such a behavior might not be desired. It might be best that when the controller is down, the switch should default back in being a learning layer 2 switch. In other circumstances however this might be undesirable. In OVS this is a tunable parameter, called `fail-safe-mode` which can be set to the following parameters:73 The !OpenFlow controller is responsible for setting up all flows on the switch, which means that when the controller is not running there should be no packet switching at all. Depending on the setup of your network, such a behavior might not be desired. It might be best that when the controller is down, the switch should default back in being a learning layer 2 switch. In other circumstances however this might be undesirable. In OVS this is a tunable parameter, called `fail-safe-mode` which can be set to the following parameters: 74 74 * `standalone` [default] : in which case OVS will take responsibility for forwarding the packets if the controller fails 75 75 * `secure` : in which case only the controller is responsible for forwarding packets, and if the controller is down all packets are going to be dropped. … … 112 112 ==== Soft vs Hard Timeouts ==== 113 113 All rules on the switch have two different timeouts: 114 114 115 * '''Soft Timeout''': This determines for how long the flow will remain at the forwarding table of the switch, if there no packets received that match the specific flow. As long as packets from that flow are received the flow remains on the flow table. 115 116 * '''Hard Timeout''': This determines the total time that a flow will remain at the forwarding table, independent of whether packets that match the flow are received; i.e. the flow will be removed after the hard timeout expires. … … 118 119 119 120 === Useful Tips for writing your controller === 120 In order to make this first experience of writing controller easier, we wrote some helpful functions that will abstract some of the 121 In order to make this first experience of writing controller easier, we wrote some helpful functions that will abstract some of the particularities of PoX away. 121 122 These functions are locates at `/local/pox/ext/utils.py`, so while you write your controller consult this file for details. 122 123 … … 140 141 141 142 === 3c. Run a traffic duplication controller === 142 In the above example we ran a very simple 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. Our hosts are VMs so we are going 143 to verify the duplication by doing a `tcpdump` on the port on the ovs switch. 143 In the above example we ran a very simple 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. Our hosts are VMs so we are going to verify the duplication by doing a `tcpdump` on the port on the OVS switch. 144 144 145 145 1. Open two new terminals to the OVS switch. … … 155 155 }}} 156 156 157 2. There you would see two files : 157 2. There you would see two files: 158 158 159 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. 159 160 ii. !DuplicateTraffic.py : this has the actual solution you can just run this if you don't want to bother with writing a controller.