171 | | == Run a port deflection Controller == |
| 171 | == Run a traffic duplication controller == |
| 172 | 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 |
| 173 | to verify the duplication by doing a `tcpdump` on the port on the ovs switch. |
| 174 | |
| 175 | 1. Open a new terminal to the OVS switch. |
| 176 | |
| 177 | 2. Look at the sliver details page in the portal and see what interface is bound to OVS:if2 and run tcpdump on the interface. This will allow you to see all traffic going out that interface |
| 178 | {{{ |
| 179 | sudo tcpdump -i ethX |
| 180 | }}} |
| 181 | |
| 182 | 2. In the other ovs host go under the `/local/pox/ext` directory: |
| 183 | {{{ |
| 184 | cd ext |
| 185 | }}} |
| 186 | |
| 187 | 2. There you would see two files : |
| 188 | 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. |
| 189 | ii. DuplicateTraffic.py : this has the actual solution you can just run this if you don't want to bother with writing a controller. |
| 190 | |
| 191 | To run the controller do : |
| 192 | {{{ |
| 193 | ./pox.py --verbose myDuplicateTraffic --duplicate_port=ethX |
| 194 | }}} |
| 195 | |
| 196 | To test it go to the terminal of host1 and try to ping host2: |
| 197 | {{{ |
| 198 | ping 10.10.1.2 |
| 199 | }}} |
| 200 | |
| 201 | At the terminal of host2, do a tcpdump on the dataplane interface (the one that is '''not''' eth0 |
| 202 | {{{ |
| 203 | sudo tcpdump -i ethY |
| 204 | }}} |
| 205 | |
| 206 | If your controller is working you the packets registering in both terminals that you run tcpdump. |
| 207 | |
| 208 | == Run a port forward Controller == |