190 | | == Run a traffic duplication controller == |
191 | | 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 |
192 | | to verify the duplication by doing a `tcpdump` on the port on the ovs switch. |
193 | | |
194 | | 1. Open a new terminal to the OVS switch. |
195 | | |
196 | | 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 |
197 | | {{{ |
198 | | sudo tcpdump -i ethX |
199 | | }}} |
200 | | |
201 | | 2. In the other ovs host go under the `/local/pox/ext` directory: |
202 | | {{{ |
203 | | cd ext |
204 | | }}} |
205 | | |
206 | | 2. There you would see two files : |
207 | | 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. |
208 | | ii. !DuplicateTraffic.py : this has the actual solution you can just run this if you don't want to bother with writing a controller. |
209 | | |
210 | | To run the controller do (while at /local/pox directory) |
211 | | {{{ |
212 | | ./pox.py --verbose myDuplicateTraffic --duplicate_port=ethX |
213 | | }}} |
214 | | |
215 | | To test it go to the terminal of host1 and try to ping host2: |
216 | | {{{ |
217 | | ping 10.10.1.2 |
218 | | }}} |
219 | | |
220 | | At the terminal of host2, do a tcpdump on the dataplane interface (the one that starts with 'mv', use /sbin/ifconfig to get a list): |
221 | | {{{ |
222 | | sudo tcpdump -i ethY |
223 | | }}} |
224 | | |
225 | | If your controller is working you the packets registering in both terminals that you run tcpdump. |
226 | | |
| 212 | == Run a traffic duplication controller == |
| 213 | 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 |
| 214 | to verify the duplication by doing a `tcpdump` on the port on the ovs switch. |
| 215 | |
| 216 | 1. Open a new terminal to the OVS switch. |
| 217 | |
| 218 | 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 |
| 219 | {{{ |
| 220 | sudo tcpdump -i ethX |
| 221 | }}} |
| 222 | |
| 223 | 2. In the other ovs host go under the `/local/pox/ext` directory: |
| 224 | {{{ |
| 225 | cd ext |
| 226 | }}} |
| 227 | |
| 228 | 2. There you would see two files : |
| 229 | 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. |
| 230 | ii. !DuplicateTraffic.py : this has the actual solution you can just run this if you don't want to bother with writing a controller. |
| 231 | |
| 232 | To run the controller do (while at /local/pox directory) |
| 233 | {{{ |
| 234 | ./pox.py --verbose myDuplicateTraffic --duplicate_port=ethX |
| 235 | }}} |
| 236 | |
| 237 | To test it go to the terminal of host1 and try to ping host2: |
| 238 | {{{ |
| 239 | ping 10.10.1.2 |
| 240 | }}} |
| 241 | |
| 242 | At the terminal of host2, do a tcpdump on the dataplane interface (the one that starts with 'mv', use /sbin/ifconfig to get a list): |
| 243 | {{{ |
| 244 | sudo tcpdump -i ethY |
| 245 | }}} |
| 246 | |
| 247 | If your controller is working you the packets registering in both terminals that you run tcpdump. |