[pox-dev] Bind POX to Multiple IP Interfaces

Murphy McCauley murphy.mccauley at gmail.com
Fri Nov 8 11:35:01 PST 2013


On Nov 8, 2013, at 5:45 AM, Anton Matsiuk <anton.matsiuk at gmail.com> wrote:

> Thank you! It works! 
> 
> At least I tested it with L2_Switch without problems. In this case first address to listen on should be specified as argument in def launch() of of_01.py and the second - as CLI argument when launching pox. The only warning appears from core about registering 'of_01" multiple times (see debug below). 

I actually would have thought the code would stop it from registering multiple times using the same name.  Though it's possible there's also something that needs adjusting with dart's new on-demand loading of OpenFlow.  Or... are you specifying "of_01" in l2sw?  More generally, are you directly calling of_01's launch() from l2sw?  If so, can you post the code where you do?

> We run multiple concurrent OpenFlow_01_Tasks in this case, and the performance might be slower than one task binding multiple listeners, right? 

Probably very slightly, in theory.  IIRC, though, the same task currently listens for connections and also handles established connections.  The way it figures out which are which would require a bit of adjusting to do cheaply when there are multiple listening connections, or listeners could be put in their own task.  Running multiple tasks seemed a bit easier, pretty elegant, and I didn't expect the performance difference to be dramatic.  But I didn't benchmark it or anything. :)

> mininet at mininet-vm:~/pox$ ./pox.py --unthreaded_sh log.level --DEBUG openflow.of_01 --address=192.168.20.1 l2sw
> POX 0.3.0 (dart) / Copyright 2011-2013 James McCauley, et al.
> WARNING:core:Warning: Registered 'of_01' multipled times
> DEBUG:core:POX 0.3.0 (dart) going up...
> DEBUG:core:Running on CPython (2.7.3/Sep 26 2012 21:51:14)
> DEBUG:core:Platform is Linux-3.5.0-17-generic-x86_64-with-Ubuntu-13.04-raring
> INFO:core:POX 0.3.0 (dart) is up.
> DEBUG:openflow.of_01:Listening on 192.168.20.1:6633
> DEBUG:openflow.of_01:Listening on 192.168.10.1:6633
> INFO:openflow.of_01:[00-00-00-00-00-02 1] connected
> INFO:l2sw:Controlling conID=1, dpid=2
> INFO:openflow.of_01:[00-00-00-00-00-01 2] connected
> INFO:l2sw:Controlling conID=2, dpid=1
> 
> 
> On 7 November 2013 20:56, Murphy McCauley <murphy.mccauley at gmail.com> wrote:
> I think this MIGHT be as easy as making the launcher for of_01 multi-instance aware.  I don't have time to actually check, but here's a hacked version which at least doesn't crash immediately. :)  Maybe you can give it a shot?
> 
> def launch (port=6633, address="0.0.0.0", name=None, __INSTANCE__=None):
>   if name is None:
>     basename = "of_01"
>     counter = 1
>     name = basename
>     while core.hasComponent(name):
>       counter += 1
>       name = "%s-%s" % (basename, counter)
> 
>   if core.hasComponent(name):
>     log.warn("of_01 '%s' already started", name)
>     return None
> 
>   global deferredSender
>   if not deferredSender:
>     deferredSender = DeferredSender()
> 
>   if of._logger is None:
>     of._logger = core.getLogger('libopenflow_01')
> 
>   l = OpenFlow_01_Task(port = int(port), address = address)
>   core.register(name, l)
>   return l
> 
> -- Murphy
> 
> On Nov 7, 2013, at 5:30 AM, Anton Matsiuk <anton.matsiuk at gmail.com> wrote:
> 
> > Dear Murphy,
> >
> > I am asking about possibility to bind POX Controller to listen for OF messages on multiple IP Interfaces. In my case, I need to bind it to 2 interfaces: listening from Open vSwitch through Loopback, and Hardware switch from external eth, but, of course, the quantity doesn't mater.
> >
> > As I understood there is no possibility to run 2 instances of OpenFlow_01_Task concurrently (and to register them both on core) or to bind one instance of Task to 2 different IP's.
> >
> > I know that it is possible to solve the problem by proxying through iptables, but I am looking for a possibility to do it with POX in a straightforward and scalable way.
> >
> > --
> > Best regards,
> > Anton Matsiuk
> 
> 
> 
> 
> -- 
> Best regards,
> Anton Matsiuk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20131108/ca73a7cc/attachment-0002.htm>


More information about the pox-dev mailing list