On Wed, 26 Nov 2014 10:41:27 +0200
"Vilius Palubinskas" <[email protected]> wrote:
> Hi Nitish and Ryu team,
>
> Thank you for detailed info.
>
> Still got problems with flows. I am trying to install default flow in table
> 100 which sends packets to controller and after that installs new flows in
> table 200 according to packets. I found that if I run controller first time
> flow is not installed and if I run second time flow is installed
> successfully. But after some time I got this error:
>
>
> packet in 585321643271168 00:15:2b:19:a9:c0 ff:ff:ff:ff:ff:ff 3
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> hub: uncaught exception: Traceback (most recent call last):
> File "/home/vilpalu/ryu/ryu/lib/hub.py", line 52, in _launch
> func(*args, **kwargs)
> File "/home/vilpalu/ryu/ryu/base/app_manager.py", line 274, in _event_loop
> handler(ev)
> File "/home/vilpalu/ryu/ryu/app/HP_switch.py", line 80, in
> _packet_in_handler
> pkt = packet.Packet(msg.data)
> File "/home/vilpalu/ryu/ryu/lib/packet/packet.py", line 45, in __init__
> self._parser(parse_cls)
> File "/home/vilpalu/ryu/ryu/lib/packet/packet.py", line 51, in _parser
> proto, cls, rest_data = cls.parser(rest_data)
> File "/home/vilpalu/ryu/ryu/lib/packet/ospf.py", line 625, in parser
> raise InvalidChecksum
> InvalidChecksum
>
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> connected socket:<eventlet.greenio.GreenSocket object at 0xb66e86ac>
> address:('10.0.0.2', 54484)
> hello ev <ryu.controller.ofp_event.EventOFPHello object at 0xb66e88cc>
> move onto config mode
> EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures
> connected socket:<eventlet.greenio.GreenSocket object at 0xb66e8a0c>
> address:('10.0.0.2', 58543)
>
>
> Looks like controller stuck after malformed packet?
Yeah, looks so. But Ryu should not crash even with malformed
packets. Please try the following patch.
diff --git a/ryu/lib/packet/ospf.py b/ryu/lib/packet/ospf.py
index 5f49402..cc84d88 100644
--- a/ryu/lib/packet/ospf.py
+++ b/ryu/lib/packet/ospf.py
@@ -612,7 +612,7 @@ class OSPFMessage(packet_base.PacketBase, _TypeDisp):
self.authentication = authentication
@classmethod
- def parser(cls, buf):
+ def _parser(cls, buf):
if len(buf) < cls._HDR_LEN:
raise stream_parser.StreamParser.TooSmallException(
'%d < %d' % (len(buf), cls._HDR_LEN))
@@ -637,6 +637,13 @@ class OSPFMessage(packet_base.PacketBase, _TypeDisp):
return subcls(length, router_id, area_id, au_type, authentication,
checksum, version, **kwargs), None, rest
+ @classmethod
+ def parser(cls, buf):
+ try:
+ return cls._parser(buf)
+ except:
+ return None, None, buf
+
def serialize(self):
tail = self.serialize_tail()
self.length = self._HDR_LEN + len(tail)
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel