Monday, April 21, 2014

Running OpenWRT router as both OpenFlow switch and controller.


If your router does not have enough RAM, you would need to configure extroot/pivot overlay. If you have not already done so, you can see my previous post to configure that.

My other post details how to configure OpenWRT router as OpenFlow switch.

1. Install libffi and python-mini packages first as they are prerequisites. Then install python package. Only Python (2.7) package takes around 7.5 MB.

If you are installing using opkg install, prerequisite will be install automatically.

2. Install/get POX code directly on OpenWRT router or on local desktop and then SCP to router.

https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-GettingtheCode%2FInstallingPOX

3. Configure /etc/config/openflow: Since local openflow switch uses default port, for controller running on same router different port has to be used. So configure 'ofctl' parameter as below. All other settings remains same.

      option 'ofctl' 'tcp:127.0.0.1:6636'

4. For testing run openflow controller with new port as shown below:

cd ~/pox/
./pox.py log.level --DEBUG openflow.of_01 --port=6636 openflow.keepalive forwarding.l2_learning

openflow.keepalive parameter was required to avoid intermittent connection dropping between switch and controller.

References:
https://openflow.stanford.edu/display/ONL/POX+Wiki

No comments:

Post a Comment