frenetic-lang / pyretic

The Pyretic language and runtime system
http://frenetic-lang.org/pyretic/
159 stars 99 forks source link

RunTime Error when traffic increased #22

Open sebasjuancho opened 10 years ago

sebasjuancho commented 10 years ago

Hi, I'm having some troubles trying to use the methods count_packets and count_bytes. I'm implementing a module that prints networks stats every second. When I test the module with low traffic (ping tests) it works just fine, but when I increased the traffic using a script, the next error arise:

error: uncaptured python exception, closing channel <pyretic.backend.backend.BackendChannel connected 127.0.0.1:38907 at 0x8eccf6c> (<type 'exceptions.RuntimeError'>:BAD MSG IN!!!! [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|444] [/usr/lib/python2.7/asynchat.py|handle_read|158] [/home/mininet/pyretic/pyretic/backend/backend.py|found_terminator|81] [/home/mininet/pyretic/pyretic/backend/comm.py|deserialize|67])

I don't really know what could be wrong with my module since I'm just using those methods and printing the result. I hope you can help me.

Thanks

joshreich commented 10 years ago

I believe this is due to a problem in python's asynchat library. I've assigned Srinivas who is our current asynchat expert and also happens to be in charge of pyretic's querying engine to look into this. How problematic is this error for you at the moment?

sebasjuancho commented 10 years ago

Thanks for the answer. Right now I'm trying to monitor network traffic during a DoS attack. This is part of a bigger project I'm working on for my thesis, so I'd appreciate any help you could provide.

ngsrinivas commented 10 years ago

Hi, apologies for the delays in getting back. Are you using the most updated version of the pyretic VM? I'm unable to find the specific error message in the code (also the line numbers in the exception message don't match the specific functions being called.) Could you do an update of your pyretic code (do a git pull on the pyretic folder), and also tell me how to replicate this error? :)

Count_packets and count_bytes are not inherently suited for high-volume traffic monitoring, since they send out all the monitored packets to the controller. (I don't think that's directly leading to this bug, though.) We are currently actively working on a proactively compiled version of queries which count packets and bytes on the switch itself. Will keep you posted on that!

sebasjuancho commented 10 years ago

Hi, as you said, I wasn't using the latest version of the pyretic VM. However, after I updated the VM, the exception persisted:

error: uncaptured python exception, closing channel <of_client.pox_client.BackendChannel connected at 0x941dcec> (<type 'exceptions.IndexError'>:deque index out of range [/usr/lib/python2.7/asyncore.py|write|91] [/usr/lib/python2.7/asyncore.py|handle_write_event|466] [/usr/lib/python2.7/asynchat.py|handle_write|174] [/usr/lib/python2.7/asynchat.py|initiate_send|244])

I'm using a simple mininet topology ( sudo mn --controller=remote --topo=single,3 --mac --arp) and what I'm doing for testing ,is to run a SimpleHTTPServer on h1 and then, from h2 I run this script (http://skidpaste.org/SersZQbI). The exception is not thrown immediately, but after some requests arrive to the HTTPServer, the controller crashes.

shwethabetageri commented 6 years ago

I am getting below while i running the cmd in the other terminal sudo mn --topo tree,3 --controller remote.

error: uncaptured python exception, closing channel <pyretic.backend.backend.BackendChannel connected 127.0.0.1:46330 at 0x7fef837fd680> (<type 'exceptions.AttributeError'>:'Graph' object has no attribute 'add_switch' [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|449] [/usr/lib/python2.7/asynchat.py|handle_read|160] [/home/shwetha/pyretic/pyretic/backend/backend.py|found_terminator|92] [/home/shwetha/pyretic/pyretic/core/runtime.py|handle_switch_join|1948] [/home/shwetha/pyretic/pyretic/core/runtime.py|handle_switch_join|2342])

shwetha@shwetha-HP:~/pyretic$ git pull Already up-to-date.

Plzz help me to slove this error