[nox-dev] messenger example

2011-10-27 Thread Aaron Rosen
Hello,

I was wondering if anyone had an example of something using the messenger
module that I could look at.

Thanks,

Aaron

-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] messenger example

2011-10-27 Thread Aaron Rosen
What I'm trying to do is make nox bind on a port and then I can send stuff
from my controller to clients who connect on that port.

Looking  at nox/coreapps/messenger/messenger.py :

It seems like this does a connect to a host. I'm looking for something that
does a bind.

from nox.coreapps.messenger.messenger import channel
inst.messenger = ctxt.resolve(channel("127.0.0.1", 2334))


Thanks,

Aaron


On Thu, Oct 27, 2011 at 9:54 AM, Aaron Rosen  wrote:

> Hello,
>
> I was wondering if anyone had an example of something using the messenger
> module that I could look at.
>
> Thanks,
>
> Aaron
>
> --
> Aaron O. Rosen
> Masters Student - Network Communication
> 306B Fluor Daniel
>
>
>


-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] messenger example

2011-10-27 Thread Aaron Rosen
I was able to get this working using epoll and nonblocking sockets in python
instead.

Aaron

On Thu, Oct 27, 2011 at 10:05 AM, Aaron Rosen  wrote:

> What I'm trying to do is make nox bind on a port and then I can send stuff
> from my controller to clients who connect on that port.
>
> Looking  at nox/coreapps/messenger/messenger.py :
>
> It seems like this does a connect to a host. I'm looking for something that
> does a bind.
>
> from nox.coreapps.messenger.messenger import channel
> inst.messenger = ctxt.resolve(channel("127.0.0.1", 2334))
>
>
> Thanks,
>
> Aaron
>
>
> On Thu, Oct 27, 2011 at 9:54 AM, Aaron Rosen  wrote:
>
>> Hello,
>>
>> I was wondering if anyone had an example of something using the messenger
>> module that I could look at.
>>
>> Thanks,
>>
>> Aaron
>>
>> --
>> Aaron O. Rosen
>> Masters Student - Network Communication
>> 306B Fluor Daniel
>>
>>
>>
>
>
> --
> Aaron O. Rosen
> Masters Student - Network Communication
> 306B Fluor Daniel
>
>
>


-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Error building dev/destiny-fast branch

2011-10-27 Thread Amin Tootoonchian
On Wed, Oct 26, 2011 at 7:32 PM, Andreas Voellmy
 wrote:
> On Wed, Oct 26, 2011 at 8:42 PM, Amin Tootoonchian 
> wrote:
>>
>> I only updated the 'switch' app in that code base, and I never looked
>> at 'hub'. My guess is that the hub app is doing so little that locking
>> within boost::asio scheduler outweights the actual work done by the
>> hub app. We need to make sure that the amount of work done by each
>> thread upon its invocation is significantly more than the locking
>> overhead in boost::asio's internal job queue.
>>
>
> I'm unclear about how components in the destiny branch work. Do the handlers
> run concurrently by default, or is there something extra that one has to
> write to get them to execute concurrently? If something extra is needed,
> what is it in switch.cc that makes it execute concurrently? Or are you
> saying that the event handlers in 'hub' are indeed running concurrently, but
> they aren't doing enough work to get much performance gain? (By the way, I
> was looking at /src/nox/coreapps/switch/switch.cc
> and /src/nox/coreapps/hub/hub.cc)
>
> Thanks,
> Andreas

They run concurrently by default. They should be indeed running
concurrently, but I am guessing locking overhead within boost::asio
significantly outweights the actual work done by each thread. It
shouldn't be hard to fix, but not worth it since we consider that code
base to be just a proof of concept.

Thanks,
Amin

>>
>> Cheers,
>> Amin
>>
>> P.S.: Btw, passing '--enable-ndebug' to configure should boost the
>> performace.
>>
>> On Wed, Oct 26, 2011 at 2:08 PM, Andreas Voellmy
>>  wrote:
>> > Thanks. The code compiled after configuring without python.
>> > I was able to get roughly the same kind of performance out of the
>> > 'switch'
>> > application that is mentioned on the performance page
>> >
>> > (http://www.openflow.org/wk/index.php/Controller_Performance_Comparisons).
>> > However, the 'hub' controller doesn't have much speedup when running
>> > with
>> > more threads. For example, when running with one thread I get a
>> > throughput
>> > of 213868.81 and when I run it with 8 threads I get a throughput
>> > of 264017.35. (To run with 8 threads, I am starting the controller like
>> > this: "./nox_core -i ptcp: hub -t 8"; I am testing with cbench in
>> > throughput mode "cbench -p  -t")
>> > Is this - that 'hub' gets not much speedup while 'switch' gets lots of
>> > speedup - expected with this branch of NOX? Is there something that
>> > needs to
>> > be done to hub in order to enable the framework to run it concurrently?
>> > Regards,
>> > Andreas
>> >
>> > On Wed, Oct 26, 2011 at 5:53 AM, Murphy McCauley  wrote:
>> >>
>> >> This branch is quite a bit behind the actual development.  We're
>> >> preparing
>> >> to release the updated codebase in the near future.
>> >> But for one thing, Python doesn't work in it.  So you probably need to
>> >> do
>> >> --with-python=no when you run configure.
>> >> Hope that helps.
>> >> -- Murphy
>> >> On Oct 25, 2011, at 8:49 PM, Andreas Voellmy wrote:
>> >>
>> >> Thanks. I tried editing the conflict marker out in a couple ways that
>> >> seemed reasonable to me, but I got other compile errors. Does anyone
>> >> know if
>> >> there is a known working version of this branch in the repository, and
>> >> how I
>> >> can get back to it?
>> >> Thanks,
>> >> Andreas
>> >>
>> >> 2011/10/25 Zoltán Lajos Kis 
>> >>>
>> >>> Seems like someone checked in a conflict marker to that file:
>> >>>
>> >>>
>> >>>
>> >>> http://noxrepo.org/cgi-bin/gitweb.cgi?p=nox;a=blob;f=src/nox/coreapps/pyrt/context.i;h=cb8641d72feb3a1f0543e97830a2addd55d502b9;hb=dev/destiny-fast#l83
>> >>>
>> >>> Z.
>> >>>
>> >>> 
>> >>> From: nox-dev-boun...@noxrepo.org [nox-dev-boun...@noxrepo.org] On
>> >>> Behalf
>> >>> Of Andreas Voellmy [andreas.voel...@gmail.com]
>> >>> Sent: Wednesday, October 26, 2011 4:40 AM
>> >>> To: nox-dev@noxrepo.org
>> >>> Subject: [nox-dev] Error building dev/destiny-fast branch
>> >>>
>> >>> Hi,
>> >>>
>> >>> I'd like to try the destiny-fast branch (I saw it mentioned here:
>> >>>
>> >>> http://www.openflow.org/wk/index.php/Controller_Performance_Comparisons),
>> >>>  so
>> >>> I did the following
>> >>>
>> >>> git clone git://noxrepo.org/nox
>> >>> cd nox
>> >>> git checkout dev/destiny-fast
>> >>>
>> >>> Is that the right way to get this branch? After that I ran
>> >>> ./boot.sh
>> >>> mkdir build
>> >>> cd build
>> >>> ../configure
>> >>> make
>> >>>
>> >>> and got the following error:
>> >>>
>> >>> Making all in pyrt
>> >>> make[8]: Entering directory
>> >>> `/home/av/Download/nox-destiny/nox/build/src/nox/coreapps/pyrt'
>> >>> /usr/bin/swig -c++ -python  -DSWIGWORDSIZE64
>> >>> -I../../../../../src/include/openflow -I../../../../../src/nox/lib/
>> >>> -outdir
>> >>> ./. -o oxidereactor_wrap.cc -module oxidereactor
>> >>> ../../../../../src/nox/coreapps/pyrt/oxidereactor.i
>> >>> /usr/bin/swig -c++ -python  -DSWIGWORDSIZ

[nox-dev] how to add the components of mobilevms to NOX destiny

2011-10-27 Thread 王健
hello,everyone.
Maybe i don't express my problem clearly, so i describe it more detailed. I 
got the source code of  mobilevms compoments(a folder) from 
http://www.openflow.org/wk/index.php/Mobile_VMs for NOX 0.4, now i want to 
transplant them to NOX destiny. The source code of mobilevms compoments is 
beyond 10M, so i can not add it to attachment, sorry for this.
How can I deal with this problem. For example i need convert the meta.xml  
to meta.json(anything else to modify?) and copy the mobilevms folder to 
nox/src/nox/netapps directory. This problem has confused me for a long time. 
Anyone who can give me a integral and detailed steps for it. Thank you very 
much, look forward to reply from you even a little bit advice~
best wishes

  wang jian

Friday October 28,2011







___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] how to add the components of mobilevms to NOX destiny

2011-10-27 Thread Kyriakos Zarifis
In your application folder, under src/   (NOT build/src)  , make sure you
have updated the Makefile.am file.
This is where you tell the build system to create links inside the build/
tree to files in your src/ tree. So, for example, you need to change
"meta.xml" to "meta.json" in there.
This is why your build failed until you manually copied the .json into your
build/ tree. Delete it from there, and once you update Makefile.am, and do
./boot.sh again, you'll see that a symbolic link to your meta.json will be
created under build/

This is one of the problems, I'm not sure it's the only one. Try changing
that and start again from ./boot.sh

On Thu, Oct 27, 2011 at 7:13 PM, 王健  wrote:

> hello,everyone.
> Maybe i don't express my problem clearly, so i describe it more
> detailed. I got the source code of  mobilevms compoments(a folder) from
> http://www.openflow.org/wk/index.php/Mobile_VMs for NOX 0.4, now i want to
> transplant them to NOX destiny. The source code of mobilevms compoments is
> beyond 10M, so i can not add it to attachment, sorry for this.
> How can I deal with this problem. For example i need convert the
> meta.xml  to meta.json(anything else to modify?) and copy the mobilevms
> folder to nox/src/nox/netapps directory. This problem has confused me for a
> long time. Anyone who can give me a integral and detailed steps for it.
> Thank you very much, look forward to reply from you even a little bit
> advice~
> best wishes
>
>wang jian
>
>  Friday October 28,2011
>
>
>
>
>
>
>
> --
> 网易公开课推出哈佛最受欢迎《幸福》课程,帮您修满幸福学分!
> ___
> nox-dev mailing list
> nox-dev@noxrepo.org
> http://noxrepo.org/mailman/listinfo/nox-dev
>
>
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Error building dev/destiny-fast branch

2011-10-27 Thread Andreas Voellmy
Thanks. I noticed that when I run cbench with 1 switch against the learning
switch controller in destiny, I get much worse throughput if I run with 32
OS threads than with 1 OS thread. With 1 OS thread I get 470k requests per
second, while with 32 OS threads I get 22k requests per second. With even 2
OS threads, the throughput drops to 49k requests per second. Have you
noticed this behavior? Do you know why this is happening? Is this something
that will be fixed in your upcoming release of this branch?

Andreas

On Thu, Oct 27, 2011 at 12:15 PM, Amin Tootoonchian wrote:

> On Wed, Oct 26, 2011 at 7:32 PM, Andreas Voellmy
>  wrote:
> > On Wed, Oct 26, 2011 at 8:42 PM, Amin Tootoonchian 
> > wrote:
> >>
> >> I only updated the 'switch' app in that code base, and I never looked
> >> at 'hub'. My guess is that the hub app is doing so little that locking
> >> within boost::asio scheduler outweights the actual work done by the
> >> hub app. We need to make sure that the amount of work done by each
> >> thread upon its invocation is significantly more than the locking
> >> overhead in boost::asio's internal job queue.
> >>
> >
> > I'm unclear about how components in the destiny branch work. Do the
> handlers
> > run concurrently by default, or is there something extra that one has to
> > write to get them to execute concurrently? If something extra is needed,
> > what is it in switch.cc that makes it execute concurrently? Or are you
> > saying that the event handlers in 'hub' are indeed running concurrently,
> but
> > they aren't doing enough work to get much performance gain? (By the way,
> I
> > was looking at /src/nox/coreapps/switch/switch.cc
> > and /src/nox/coreapps/hub/hub.cc)
> >
> > Thanks,
> > Andreas
>
> They run concurrently by default. They should be indeed running
> concurrently, but I am guessing locking overhead within boost::asio
> significantly outweights the actual work done by each thread. It
> shouldn't be hard to fix, but not worth it since we consider that code
> base to be just a proof of concept.
>
> Thanks,
> Amin
>
> >>
> >> Cheers,
> >> Amin
> >>
> >> P.S.: Btw, passing '--enable-ndebug' to configure should boost the
> >> performace.
> >>
> >> On Wed, Oct 26, 2011 at 2:08 PM, Andreas Voellmy
> >>  wrote:
> >> > Thanks. The code compiled after configuring without python.
> >> > I was able to get roughly the same kind of performance out of the
> >> > 'switch'
> >> > application that is mentioned on the performance page
> >> >
> >> > (
> http://www.openflow.org/wk/index.php/Controller_Performance_Comparisons).
> >> > However, the 'hub' controller doesn't have much speedup when running
> >> > with
> >> > more threads. For example, when running with one thread I get a
> >> > throughput
> >> > of 213868.81 and when I run it with 8 threads I get a throughput
> >> > of 264017.35. (To run with 8 threads, I am starting the controller
> like
> >> > this: "./nox_core -i ptcp: hub -t 8"; I am testing with cbench in
> >> > throughput mode "cbench -p  -t")
> >> > Is this - that 'hub' gets not much speedup while 'switch' gets lots of
> >> > speedup - expected with this branch of NOX? Is there something that
> >> > needs to
> >> > be done to hub in order to enable the framework to run it
> concurrently?
> >> > Regards,
> >> > Andreas
> >> >
> >> > On Wed, Oct 26, 2011 at 5:53 AM, Murphy McCauley 
> wrote:
> >> >>
> >> >> This branch is quite a bit behind the actual development.  We're
> >> >> preparing
> >> >> to release the updated codebase in the near future.
> >> >> But for one thing, Python doesn't work in it.  So you probably need
> to
> >> >> do
> >> >> --with-python=no when you run configure.
> >> >> Hope that helps.
> >> >> -- Murphy
> >> >> On Oct 25, 2011, at 8:49 PM, Andreas Voellmy wrote:
> >> >>
> >> >> Thanks. I tried editing the conflict marker out in a couple ways that
> >> >> seemed reasonable to me, but I got other compile errors. Does anyone
> >> >> know if
> >> >> there is a known working version of this branch in the repository,
> and
> >> >> how I
> >> >> can get back to it?
> >> >> Thanks,
> >> >> Andreas
> >> >>
> >> >> 2011/10/25 Zoltán Lajos Kis 
> >> >>>
> >> >>> Seems like someone checked in a conflict marker to that file:
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> http://noxrepo.org/cgi-bin/gitweb.cgi?p=nox;a=blob;f=src/nox/coreapps/pyrt/context.i;h=cb8641d72feb3a1f0543e97830a2addd55d502b9;hb=dev/destiny-fast#l83
> >> >>>
> >> >>> Z.
> >> >>>
> >> >>> 
> >> >>> From: nox-dev-boun...@noxrepo.org [nox-dev-boun...@noxrepo.org] On
> >> >>> Behalf
> >> >>> Of Andreas Voellmy [andreas.voel...@gmail.com]
> >> >>> Sent: Wednesday, October 26, 2011 4:40 AM
> >> >>> To: nox-dev@noxrepo.org
> >> >>> Subject: [nox-dev] Error building dev/destiny-fast branch
> >> >>>
> >> >>> Hi,
> >> >>>
> >> >>> I'd like to try the destiny-fast branch (I saw it mentioned here:
> >> >>>
> >> >>>
> http://www.openflow.org/wk/index.php/Controller_Performance_Com

[nox-dev] how to add the components of mobilevms to NOX destiny

2011-10-27 Thread 王健
Thank you very much for your fast reply, the attachment is "makefile.am"  
"meta.json" and "makefile.in"  for mobilevms. Would you please check them out 
for me.
I only change the meta.xml to meta.json at NOX_RUNTIMEFILES  and EXTRA_DIST in 
makefile.am. Am i right?
Then i rerun  ./boot.sh  
  cd build/
  ../configure
  make -j
There are only a makefile and a wireshark_dissector folder in 
nox/build/src/nox/netapps/mobilevms directory. What's wrong with it?

I also feel confused about this information at 
http://noxrepo.org/noxwiki/index.php/Developing_in_NOX
does it  indicate something else to change?
The information is:
Pointers:
The core python API is in nox/lib/core.py and nox/lib/util.py.
To get a handle to another component, use the Component.resolve(..) method on 
the class or interface to which you want a handle.  

  For example: from 
nox.app.examples.pyswitch import pyswitch   

   self.resolve(pyswitch)

Thank you again~
Best wishes

 wang jian

Friday, October 28, 2011 




At 2011-10-28 10:37:10,"Kyriakos Zarifis"  wrote:
In your application folder, under src/   (NOT build/src)  , make sure you have 
updated the Makefile.am file.
This is where you tell the build system to create links inside the build/ tree 
to files in your src/ tree. So, for example, you need to change "meta.xml" to 
"meta.json" in there. 
This is why your build failed until you manually copied the .json into your 
build/ tree. Delete it from there, and once you update Makefile.am, and do 
./boot.sh again, you'll see that a symbolic link to your meta.json will be 
created under build/ 


This is one of the problems, I'm not sure it's the only one. Try changing that 
and start again from ./boot.sh


On Thu, Oct 27, 2011 at 7:13 PM, 王健 wrote:

hello,everyone.
Maybe i don't express my problem clearly, so i describe it more detailed. I 
got the source code of  mobilevms compoments(a folder) 
fromhttp://www.openflow.org/wk/index.php/Mobile_VMs for NOX 0.4, now i want to 
transplant them to NOX destiny. The source code of mobilevms compoments is 
beyond 10M, so i can not add it to attachment, sorry for this.
How can I deal with this problem. For example i need convert the meta.xml  
to meta.json(anything else to modify?) and copy the mobilevms folder to 
nox/src/nox/netapps directory. This problem has confused me for a long time. 
Anyone who can give me a integral and detailed steps for it. Thank you very 
much, look forward to reply from you even a little bit advice~
best wishes

  wang jian

Friday October 28,2011











网易公开课推出哈佛最受欢迎《幸福》课程,帮您修满幸福学分!
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev





Makefile.am
Description: Binary data


meta.json
Description: Binary data


Makefile.in
Description: Binary data
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] how to use discovery component?

2011-10-27 Thread hzy
hi Kyriakos:

Thank you for your reply. I have solved my problem. But the discovery
component doesn't meat my requirement.
I want to collect the link information dynamically. e.g. the utilization
rate of bandwith. Can I get this kind of information directly? If not what
can I do to fit my aim? Can you give me some davices?

thanks for advance.



2011/10/11 Kyriakos Zarifis 

> Hi there,
>
> in order use Link_events in your python component you need to:
>
> 1) make your component aware of the Link_event object by importing it
> 2) register a handler for the event in your component's configure() (to
> make your component respond to such events)
> 3) write a handler (to tell your component how it should respond to such
> events)
>
> so, in practice:
>
> # 1
> from nox.netapps.discovery.pylinkevent import Link_event
> ...
> # 2
> def install(self):
> ...
> self.register_handler(Link_event.static_get_name(),
> self.handle_link_event)
> 
> # 3
> def handle_link_event(self, e):
> print "Received link event:", e.__dict__# this will show you
> the contents of the event (for example: 'dport': 2, 'dpsrc': 1L, 'dpdst':
> 2L, 'sport': 2, 'action': 'add')
> # do something about the event here
>
>
> On Tue, Oct 11, 2011 at 3:17 AM, hzy  wrote:
>
>> Hi murphy:
>>
>> yes, the results are the same.
>> the NOX I am using is download from
>> http://www.openflow.org/wk/index.php/OpenFlow_Tutorial.
>> Never mind, the thing I concern is that how can i deal with the link_event
>> in my component.
>> I think I should look some codes, like core.py or something else,  I just
>> don't know how to start.
>> Can you give me some advice?
>> best regards
>>
>> hzy
>>
>>
>> 2011/10/11 Murphy McCauley 
>>
>>> I don't know anything about pytutorial (it's not one of the mainlin NOX
>>> components), so I don't really know what to make of that.
>>>
>>> You tried implementing getInterface() like below on your my_router class?
>>> def getInterface (self):
>>>   return str(my_router)
>>>
>>> And the results were the same?
>>>
>>> This is unrelated, but you also seem to be using a version of NOX that's
>>> over a year old.  The destiny branch in particular has many bug fixes.
>>>
>>> -- Murphy
>>>
>>> On Oct 10, 2011, at 7:40 PM, hzy wrote:
>>>
>>> Hi murphy:
>>>
>>> Thank you for your reply, but I have added these codes in my component.
>>> This time I tried to invoke component pytutorial, so that you can get
>>> more information in your computer.
>>>
>>> So I add following codes in discovery component.
>>> self._pytutorial =
>>> self.resolve("nox.coreapps.tutorial.pytutorial.pyturorial")
>>> print self._pytutorial.mac_to_port
>>>
>>> 00478|pyrt|ERR:unable to invoke a Python event handler:
>>> Traceback (most recent call last):
>>>   File "./nox/lib/util.py", line 116, in f
>>> event.total_len, buffer_id, packet)
>>>   File "./nox/netapps/discovery/discovery.py", line 166, in 
>>> discovery.lldp_input_handler(self,dp,inport,reason,len,bid,packet),
>>>   File "./nox/netapps/discovery/discovery.py", line 316, in
>>> lldp_input_handler
>>> print self._pytutorial.mac_to_port
>>> AttributeError: 'NoneType' object has no attribute 'mac_to_port'
>>>
>>> I was confused.
>>>
>>> In other hand, I accept your advise to handle discovery's Link_even.
>>> Since I am a newbie, can you give me some advice how to deal with Link_event
>>> in my component?
>>>
>>> Best regards.
>>>
>>> hzy
>>>
>>> 2011/10/10 Murphy McCauley 
>>>
 Whoops.  I meant:

 def getInterface (self):
   return str(my_router)

 Sorry about that!

 -- Murphy


 On Oct 10, 2011, at 7:51 AM, Murphy McCauley wrote:

 So first off, maybe you have a reason, but in general, the hope is that
 you should have no reason to modify discovery.py.  Rather than modify
 discovery.py to explicitly call your component, hopefully you should be 
 able
 to simply handle discovery's Link_event.

 If you really do need to modify discovery.py to call your component
 explicitly, then as for why your code doesn't work, I don't think I have
 enough information to say.  Assuming that your paths are right (you have a
 directory/package called my_experiment) and that in my_router.py you have a
 class/component called my_router... my best guess is that you didn't
 implement getInterface() in my_router in the expected way.  Try adding the
 following to your my_router class:

 def getInterface (self):
   return my_router

 Hope that helps.

 -- Murphy

 On Oct 10, 2011, at 6:45 AM, hzy wrote:

 hi murpy:
 Thank you for your reply. it works now, but another problem comes up.
 This time I want the discovery component invoke the dic_all_path defined
 in my modle.

 So I add following codes in discovery component
 self._my_router =
 self.resolve("nox.coreapps.my_experiment.my_