Re: [nox-dev] Event triggered subprocess call

2011-06-10 Thread Murphy McCauley
So the confusing bit is that you're being lied to.  The lambda function being 
referred to is actually on line 132 of coreapps/pyrt/pyoxidereactor.py.  
Inside subprocess.py, os.waitpid has been called and is blocking.  This is 
where the stack trace leads.  However, while waitpid is blocking, the SIGCHLD 
from the subprocess dying is causing the signal handler from 
pyoxidereactor.py:132 to be invoked, which is causing an exception because the 
handler (a lambda function) is taking no arguments by Python tries to call it 
with two (I believe I am responsible for this bug -- oops!).  The interpreter 
then throws an exception in the context of the call that was interrupted 
instead of at the actual site (kind of understandable, but confusing for 
sure!).

So, to fix this, you can just fix the lambda function, by changing line 132 in 
pyoxidereactor.py to:
signal.signal(signal.SIGCHLD, lambda n,f: self.callLater(0, reapAllProcesses))

However, since this code was originally written, I think Twisted has 
confronted handling of child process reaping, which is what lines 132 and 138 
in pyoxidereactor are trying to fix.  So... I think you can probably just 
comment out lines 132 and 138 and Twisted will take care of this.  I'm no 
Twisted expert, though.  If you notice that removing these lines leads to 
zombie processes, add them back in (and let me know, please!). :)

-- Murphy

On Thursday, June 09, 2011 02:37:47 AM Partti, Tapio (NSN - FI/Espoo) wrote:
 Hi all.
 
 When giving out a subprocess call (with subprocess.check_call) in any
 event's callback function, nox gives out the following error.
 
 3|reactor|ERR:Unhandled Error
 Traceback (most recent call last):
 --- exception caught here ---
   File ./nox/coreapps/pyrt/pyoxidereactor.py, line 85, in
 __call__
 self.func(*self.args, **self.kw);
   File ./nox/coreapps/examples/pyswitch.py, line 110, in
 timer_callback
 subprocess.check_call('uname', shell=True)
   File /usr/lib/python2.6/subprocess.py, line 483, in
 check_call
 retcode = call(*popenargs, **kwargs)
   File /usr/lib/python2.6/subprocess.py, line 470, in call
 return Popen(*popenargs, **kwargs).wait()
   File /usr/lib/python2.6/subprocess.py, line 1182, in wait
 pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
   File /usr/lib/python2.6/subprocess.py, line 455, in
 _eintr_retry_call
 return func(*args)
 exceptions.TypeError: lambda() takes no arguments (2 given)
 
 In the sample case I put a line subprocess.check_call('uname',
 shell=True) in pyswitches timer_callback function. If I do the same in
 some simple python application using twisted reactor, there are no
 errors. Could someone explain why the error occurs and what is the
 reason for it? I mean, I can ignore this error with a try-catch sentence
 and everything seems ok, but am I then doing something that should not
 be done for some good reason.
 
 Thanks,
 
 Tapio Partti
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


[nox-dev] how to use Authentication component

2011-06-10 Thread 颜玮
Hi all,
I met difficulty in using /Authontication/ component,and i need your help.
here is my problem:
I want to know the location of each host,and i think there must be a
function in Authentication component that i can ues,but i don't know
which one. Any one knows?
also,should i import the component in my codefile like /from
nox.netapps.authenticator.pyauth import */ ?

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


Re: [nox-dev] Doubt about len parameter in packet in event

2011-06-10 Thread Srini Seetharaman
Hi Luciano
I guess you're using the ofp_packet_in-total_len value? That is
indeed the length of the packet that came into the port which
generated the pkt_in.

If you're looking to compute the overall traffic sent from a server,
you can also use the flow_exp message and sum it for all the flows
sent by that server.

On Wed, May 25, 2011 at 11:05 PM,  lignac...@inf.ufrgs.br wrote:
 Hello,

 I have developed a script to distribute flows among three servers using
 mininet + FlowVisor + Nox. I tested the scripts with Iperf and Wireshark and
 apparently it is working well. My only question is related to the len
 parameter in packet_in event. I am using this parameter to calculate the
 traffic sent for each server. Can I really use this parameter? Does it
 represent the length of the packet?

 PS. I just sum the len´s value when the switch receives a IP_TYPE packet.

 Thank you.

 My best regards.

 Luciano Ignaczak

 
 This message was sent using IMP, the Internet Messaging Program.


 ___
 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] how can nox controller get rtt time?

2011-06-10 Thread Srini Seetharaman
Hi Yi-Shou
You could possibly use the following to approx for RTT
time: timestamp(barrier_reply) - timestamp(fwd pkt_in), assuming the
barrier_request is sent with the pkt_out of the reverse direction ICMP.

On Wed, May 11, 2011 at 8:16 AM, false ladj...@yahoo.com.tw wrote:

 Hi,

 I have a problem about the nox controller get rtt time from NetFPGA based
 OpenFlow switch.
 Assuming there are two hosts connecting to a LAN network is established by
 NetFPGA
 based OF switch, and hosts can not communication with nox controller which
 control the NetFPGA based OF swtich because hosts do not connect to
 internet.
 Then, if hosts can not tell rtt time to nox controller, does the nox
 controller has any methods can know rtt time between hosts?

 Any suggest will be helpful! Thank you!

 Yi-Shou

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


Re: [nox-dev] how to use Authentication component

2011-06-10 Thread Srini Seetharaman
You may be able to listen for Host_event (with filter
Host_event.action == Action.ADD), and track the datapath_id and port
of each host.

In the python side, I think it is Host_bind_event.

2011/6/10 颜玮 yan...@bupt.edu.cn:
 Hi all,
 I met difficulty in using Authontication component,and i need your help.
 here is my problem:
 I want to know the location of each host,and i think there must be a
 function in Authentication component that i can ues,but i don't know which
 one. Any one knows?
 also,should i import the component in my codefile like from
 nox.netapps.authenticator.pyauth import *   ?

 ---
 yan
 6/10

 ___
 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