李呈 | 24 Oct 08:02 2014

[PATCH] add_arp_proxy_13

From a776615f17211b660e32b9ab4bc2d7df1fccd629 Mon Sep 17 00:00:00 2001
From: muzixing <350959853 <at> qq.com>
Date: Fri, 24 Oct 2014 13:54:59 +0800
Subject: [PATCH] add_arp_proxy_13

arp_proxy_13 is a ryu app:
* Reply ARP requests
* Avoid broadcast storm instead of STP
---
 ryu/app/arp_proxy_13.py | 188 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 188 insertions(+)
 create mode 100644 ryu/app/arp_proxy_13.py

diff --git a/ryu/app/arp_proxy_13.py b/ryu/app/arp_proxy_13.py
new file mode 100644
index 0000000..b3b50ad
--- /dev/null
+++ b/ryu/app/arp_proxy_13.py
<at> <at> -0,0 +1,188 <at> <at>
+# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# 
+# Contributor:Li Cheng <at> BUPT
+# Homepage:www.muzixing.com
+# Time:2014/10/19
+#
+
+from ryu.base import app_manager
+from ryu.controller import ofp_event
+from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
+from ryu.controller.handler import set_ev_cls
+from ryu.ofproto import ofproto_v1_3
+from ryu.lib.packet import packet
+from ryu.lib.packet import ethernet
+from ryu.lib.packet import arp
+
+ETHERNET = ethernet.ethernet.__name__
+ETHERNET_MULTICAST = "ff:ff:ff:ff:ff:ff"
+ARP = arp.arp.__name__
+
+
+class ARP_PROXY_13(app_manager.RyuApp):
+    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
+
+    def __init__(self, *args, **kwargs):
+        super(ARP_PROXY_13, self).__init__(*args, **kwargs)
+        self.mac_to_port = {}
+        self.arp_table = {}
+        self.sw = {}
+
+     <at> set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
+    def switch_features_handler(self, ev):
+        datapath = ev.msg.datapath
+        ofproto = datapath.ofproto
+        parser = datapath.ofproto_parser
+
+        # install table-miss flow entry
+        #
+        # We specify NO BUFFER to max_len of the output action due to
+        # OVS bug. At this moment, if we specify a lesser number, e.g.,
+        # 128, OVS will send Packet-In with invalid buffer_id and
+        # truncated packet data. In that case, we cannot output packets
+        # correctly.
+
+        match = parser.OFPMatch()
+        actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
+                                          ofproto.OFPCML_NO_BUFFER)]
+        self.add_flow(datapath, 0, match, actions)
+
+    def add_flow(self, datapath, priority, match, actions):
+        ofproto = datapath.ofproto
+        parser = datapath.ofproto_parser
+
+        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
+                                             actions)]
+
+        mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
+                                idle_timeout=5, hard_timeout=15,
+                                match=match, instructions=inst)
+        datapath.send_msg(mod)
+
+     <at> set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
+    def _packet_in_handler(self, ev):
+        msg = ev.msg
+        datapath = msg.datapath
+        ofproto = datapath.ofproto
+        parser = datapath.ofproto_parser
+        in_port = msg.match['in_port']
+
+        pkt = packet.Packet(msg.data)
+
+        eth = pkt.get_protocols(ethernet.ethernet)[0]
+        dst = eth.dst
+        src = eth.src
+        dpid = datapath.id
+
+        header_list = dict(
+            (p.protocol_name, p)for p in pkt.protocols if type(p) != str)
+        if ARP in header_list:
+            self.arp_table[header_list[ARP].src_ip] = src  # ARP learning
+
+        self.mac_to_port.setdefault(dpid, {})
+        self.logger.info("packet in %s %s %s %s", dpid, src, dst, in_port)
+
+        # learn a mac address to avoid FLOOD next time.
+        self.mac_to_port[dpid][src] = in_port
+
+        if dst in self.mac_to_port[dpid]:
+            out_port = self.mac_to_port[dpid][dst]
+        else:
+            if self.arp_handler(header_list, datapath, in_port, msg.buffer_id):
+                # 1:reply or drop;  0: flood
+                print "ARP_PROXY_13"
+                return None
+            else:
+                out_port = ofproto.OFPP_FLOOD
+                print 'OFPP_FLOOD'
+
+        actions = [parser.OFPActionOutput(out_port)]
+
+        # install a flow to avoid packet_in next time
+        if out_port != ofproto.OFPP_FLOOD:
+            match = parser.OFPMatch(in_port=in_port, eth_dst=dst)
+            self.add_flow(datapath, 1, match, actions)
+
+        data = None
+        if msg.buffer_id == ofproto.OFP_NO_BUFFER:
+            data = msg.data
+        out = parser.OFPPacketOut(datapath=datapath, buffer_id=msg.buffer_id,
+                                  in_port=in_port, actions=actions, data=data)
+        datapath.send_msg(out)
+
+    def arp_handler(self, header_list, datapath, in_port, msg_buffer_id):
+        header_list = header_list
+        datapath = datapath
+        in_port = in_port
+
+        if ETHERNET in header_list:
+            eth_dst = header_list[ETHERNET].dst
+            eth_src = header_list[ETHERNET].src
+
+        if eth_dst == ETHERNET_MULTICAST and ARP in header_list:
+            arp_dst_ip = header_list[ARP].dst_ip
+            if (datapath.id, eth_src, arp_dst_ip) in self.sw:  # Break the loop
+                if self.sw[(datapath.id, eth_src, arp_dst_ip)] != in_port:
+                    out = datapath.ofproto_parser.OFPPacketOut(
+                        datapath=datapath,
+                        buffer_id=datapath.ofproto.OFP_NO_BUFFER,
+                        in_port=in_port,
+                        actions=[], data=None)
+                    datapath.send_msg(out)
+                    return True
+            else:
+                self.sw[(datapath.id, eth_src, arp_dst_ip)] = in_port
+
+        if ARP in header_list:
+            hwtype = header_list[ARP].hwtype
+            proto = header_list[ARP].proto
+            hlen = header_list[ARP].hlen
+            plen = header_list[ARP].plen
+            opcode = header_list[ARP].opcode
+
+            arp_src_ip = header_list[ARP].src_ip
+            arp_dst_ip = header_list[ARP].dst_ip
+
+            actions = []
+
+            if opcode == arp.ARP_REQUEST:
+                if arp_dst_ip in self.arp_table:  # arp reply
+                    actions.append(datapath.ofproto_parser.OFPActionOutput(
+                        in_port)
+                    )
+
+                    ARP_Reply = packet.Packet()
+                    ARP_Reply.add_protocol(ethernet.ethernet(
+                        ethertype=header_list[ETHERNET].ethertype,
+                        dst=eth_src,
+                        src=self.arp_table[arp_dst_ip]))
+                    ARP_Reply.add_protocol(arp.arp(
+                        opcode=arp.ARP_REPLY,
+                        src_mac=self.arp_table[arp_dst_ip],
+                        src_ip=arp_dst_ip,
+                        dst_mac=eth_src,
+                        dst_ip=arp_src_ip))
+
+                    ARP_Reply.serialize()
+
+                    out = datapath.ofproto_parser.OFPPacketOut(
+                        datapath=datapath,
+                        buffer_id=datapath.ofproto.OFP_NO_BUFFER,
+                        in_port=datapath.ofproto.OFPP_CONTROLLER,
+                        actions=actions, data=ARP_Reply.data)
+                    datapath.send_msg(out)
+                    return True
+        return False
-- 
1.9.4.msysgit.1

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Lei Wang | 24 Oct 02:29 2014
Picon

(no subject)


------------------------------------------------------------------------------
controller | 23 Oct 20:05 2014

controller-users@... 가 귀하를 팔로우하고 있지 않습니다. 보시겠습니까?

여기를 클릭하여 controller-users-ZwoEplunGu0FYaSHDMS2/9wCX5O+HJzA@public.gmane.org가 즐겨찾는 웹사이트를 확인하세요!
controller-users-ZwoEplunGu0FYaSHDMS2/9wCX5O+HJzA@public.gmane.org 가 귀하를 팔로우하고 있지 않습니다
당신을 친구로 추가하고 싶습니다
-controller-users-ZwoEplunGu0FYaSHDMS2/9wCX5O+HJzA@public.gmane.org
수락 거절
controller-users-ZwoEplunGu0FYaSHDMS2/9wCX5O+HJzA@public.gmane.org 를 팔로우하면 그들이 추천하는 멋진 웹사이트를 발견하는 데 도움이 됩니다 :)
여기를 클릭하여 controller-users-ZwoEplunGu0FYaSHDMS2/9wCX5O+HJzA@public.gmane.org 또는 모든 친구들로부터의 이메일구독을 해제합니다


P.O. BOX 70928, Sunnyvale, CA 94086
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Jeff Rasley | 23 Oct 19:22 2014

Trouble parsing DHCP packets

I seem to be having trouble parsing DHCP Discover packets in Ryu. I see there is a test for DHCP Offer messages in ryu/tests/unit/packet/test_dhcp.py. Has DHCP Discover parsing been implemented?

Thanks,
Jeff Rasley
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
A G | 23 Oct 16:58 2014
Picon

Using ryu.base.app_manager - Help

Will using the ryu.base.app_manager."My App Name".reply_to_request(req, rep) ensure that the application that I've written is still running?
  • If it does ensure that it is still running
    • Will it block the framework from responding to echo requests from a switch?
    • Can someone please provide an example of how I would set up an application to use this request and reply_to_request methods?
  • My application received a packet that was attempted to be parsed as an LLC packet but failed somewhere

2014-10-13 17:32:54102 ERROR ryu.lib.hub hub: uncaught exception: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/ryu/base/app_manager.py", line 274, in _event_loop
    handler(ev)
  File "/home/alex/ryu/ryu/app/simple_switch_HP-9-16-2014.py", line 91, in _packet_in_handler
    pkt = packet.Packet(msg.data)
  File "/usr/lib/python2.6/site-packages/ryu/lib/packet/packet.py", line 45, in __init__
    self._parser(parse_cls)
  File "/usr/lib/python2.6/site-packages/ryu/lib/packet/packet.py", line 51, in _parser
    proto, cls, rest_data = cls.parser(rest_data)
  File "/usr/lib/python2.6/site-packages/ryu/lib/packet/llc.py", line 153, in parser
    control, information = ctrl.parser(buf[cls._PACK_LEN:])
  File "/usr/lib/python2.6/site-packages/ryu/lib/packet/llc.py", line 253, in parser
    assert (control >> 12) & 0b1111 == 0
AssertionError


As a result this killed my switching application but the underlying framework was still running. In any event that the switching application dies, I'd like for the framework to also stop. I understand that the root cause should fixed too. But I'd like for a mechanism to stop the framework so that my physical switches will enter into the fail-standalone mode.

Thanks.

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
李呈 | 23 Oct 03:46 2014
Picon

About the contribution of RYU

Hi, I am very glad to meet you. Recently, I have finished an ARP proxy application on RYU, and I have sent a pull request to you at Github. I am looking forward to your review my code, thanks for your time!


Li Cheng

muzixing at Github

Homepage: www.muzixing.com


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
FUJITA Tomonori | 22 Oct 16:29 2014
Picon

Re: Issue when incoming LLDP packet is truncated

On Sat, 18 Oct 2014 16:03:41 +0200
Benjamin Eggerstedt <benjamin.eggerstedt <at> gmail.com> wrote:

> Hi Ryu-Team,
> 
> I noticed the following on one of my laboratory networks.
> 
> If you run the simple_switch_13.py application and you receive an LLDP
> packet that is truncated you'll receive an AssertionError. I have attached
> a packet capture of the concerning packets and the following behaviour seen
> on console.
> 
> *Packet capture taken with:*
> $ sudo tcpdump -lnni eth0 -s 0 -w filename.pcap
> (-s 0 lets tcpdump default to 65535, so it means to capture the full packet)
> 
> *Console log:*
> $ ryu-manager --verbose ryu/ryu/app/simple_switch_13.py
> loading app ryu/ryu/app/simple_switch_13.py
> loading app ryu.controller.ofp_handler
> instantiating app ryu/ryu/app/simple_switch_13.py of SimpleSwitch13
> instantiating app ryu.controller.ofp_handler of OFPHandler
> BRICK SimpleSwitch13
>   CONSUMES EventOFPPacketIn
>   CONSUMES EventOFPSwitchFeatures
> BRICK ofp_event
>   PROVIDES EventOFPPacketIn TO {'SimpleSwitch13': set(['main'])}
>   PROVIDES EventOFPSwitchFeatures TO {'SimpleSwitch13': set(['config'])}
>   CONSUMES EventOFPPortDescStatsReply
>   CONSUMES EventOFPSwitchFeatures
>   CONSUMES EventOFPEchoRequest
>   CONSUMES EventOFPHello
>   CONSUMES EventOFPErrorMsg
> connected socket:<eventlet.greenio.GreenSocket object at 0x7f45515d7fd0>
> address:('192.168.120.71', 32962)
> hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f45515ea510>
> move onto config mode
> EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures
> switch features ev version: 0x4 msg_type 0x6 xid 0x5d6c86fd
> OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=537554655993737,n_buffers=256,n_tables=3)
> move onto main mode
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> hub: uncaught exception: Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in
> _launch
>     func(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py",
> line 274, in _event_loop
>     handler(ev)
>   File "/home/alu4u/ryu/ryu/app/simple_switch_13.py", line 69, in
> _packet_in_handler
>     pkt = packet.Packet(msg.data)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py",
> line 45, in __init__
>     self._parser(parse_cls)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py",
> line 51, in _parser
>     proto, cls, rest_data = cls.parser(rest_data)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 132, in parser
>     tlv = cls._tlv_parsers[tlv_type](buf)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 336, in __init__
>     super(SystemDescription, self).__init__(buf, *args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 89, in __init__
>     assert len(buf) >= self.len + LLDP_TLV_SIZE
> AssertionError
> 
> ###
> 
> The packet in question is #31 of the packet capture (attached). This is my
> upstream switch sending me some information via LLDP (but it appears to be
> truncated to 128 bytes as it is buffered).
> 
> I added a print statements and the assert fails as 61 is not equal or
> greater than 76.
> 
> *Edited in:*
> /usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py
> 
> *Console log (with my print statements):*
> $ ryu-manager --verbose ryu/ryu/app/simple_switch_13.py
> loading app ryu/ryu/app/simple_switch_13.py
> loading app ryu.controller.ofp_handler
> instantiating app ryu/ryu/app/simple_switch_13.py of SimpleSwitch13
> instantiating app ryu.controller.ofp_handler of OFPHandler
> BRICK SimpleSwitch13
>   CONSUMES EventOFPSwitchFeatures
>   CONSUMES EventOFPPacketIn
> BRICK ofp_event
>   PROVIDES EventOFPSwitchFeatures TO {'SimpleSwitch13': set(['config'])}
>   PROVIDES EventOFPPacketIn TO {'SimpleSwitch13': set(['main'])}
>   CONSUMES EventOFPHello
>   CONSUMES EventOFPPortDescStatsReply
>   CONSUMES EventOFPEchoRequest
>   CONSUMES EventOFPSwitchFeatures
>   CONSUMES EventOFPErrorMsg
> connected socket:<eventlet.greenio.GreenSocket object at 0x7fabcd9fbed0>
> address:('192.168.120.71', 33301)
> hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7fabcda0e410>
> move onto config mode
> EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures
> switch features ev version: 0x4 msg_type 0x6 xid 0xbfe66b2e
> OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=537554655993737,n_buffers=256,n_tables=3)
> move onto main mode
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:c8:6b:21 01:80:c2:00:00:00 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> packet in 537554655993737 00:e0:b1:f4:7a:fd e8:e7:32:51:5f:89 1
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> self.typelen = 519
> LLDP_TLV_LENGTH_MASK = 511
> self.len = 7
> len(buf) = 114
> self.len + LLDP_TLV_SIZE = 9
> self.typelen = 1029
> LLDP_TLV_LENGTH_MASK = 511
> self.len = 5
> len(buf) = 105
> self.len + LLDP_TLV_SIZE = 7
> self.typelen = 1538
> LLDP_TLV_LENGTH_MASK = 511
> self.len = 2
> len(buf) = 98
> self.len + LLDP_TLV_SIZE = 4
> self.typelen = 2067
> LLDP_TLV_LENGTH_MASK = 511
> self.len = 19
> len(buf) = 94
> self.len + LLDP_TLV_SIZE = 21
> self.typelen = 2570
> LLDP_TLV_LENGTH_MASK = 511
> self.len = 10
> len(buf) = 73
> self.len + LLDP_TLV_SIZE = 12
> 
> 
> 
> 
> *self.typelen = 3146LLDP_TLV_LENGTH_MASK = 511self.len = 74len(buf) =
> 61self.len + LLDP_TLV_SIZE = 76*
> hub: uncaught exception: Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in
> _launch
>     func(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py",
> line 274, in _event_loop
>     handler(ev)
>   File "/home/alu4u/ryu/ryu/app/simple_switch_13.py", line 69, in
> _packet_in_handler
>     pkt = packet.Packet(msg.data)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py",
> line 45, in __init__
>     self._parser(parse_cls)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py",
> line 51, in _parser
>     proto, cls, rest_data = cls.parser(rest_data)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 137, in parser
>     tlv = cls._tlv_parsers[tlv_type](buf)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 341, in __init__
>     super(SystemDescription, self).__init__(buf, *args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/lldp.py",
> line 94, in __init__
>     assert len(buf) >= self.len + LLDP_TLV_SIZE
> AssertionError
> 
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
> 
> ###
> 
> W
> ​here does the issue come from?​
> 
> a) The OF switch should not send an apparently truncated packet?

I think so unless such flow is installed. What flows are installed on
your switch?

> b) The lldp.py needs to handle this?

Yeap, it should. I'll take care of it shortly.

> c) I should avoid receiving LLDP with simple_switch_13.py?

If you know what you want to receive, you could use:

https://github.com/osrg/ryu/blob/master/ryu/lib/ofp_pktinfilter.py



> My switch is supposed to work up to the specs of OF v1.3.1 and when I
> reviewed page 92 (Appendix 4.1 Packet In), it appears that it is allowed to
> truncate the packet down to 128 bytes (which is what is part of DATA in
> packet #31) if it is buffered.
> 
> ​I'm running Ryu 3.13 on this host.
> $ ryu-manager --version
> ryu-manager 3.13​
> 
> 
> ​Just in case the mailing-list doesn't allow me to attach a file, you can
> also get it from the following URL:
> https://ale.files.wimi.pro/download.php?id=30176716&code=7hjy6rcnfios808kcgk4s0ss8

> 
> Thanks,
> Regards,
> Benny
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ryu-devel mailing list
Ryu-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel
manyu4605 | 22 Oct 06:56 2014
Picon

manyu4605@... has indicated you are a friend. Accept?

Click here to discover manyu4605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org's favorite websites!
manyu4605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org is now following you
I would like to add you as a friend
-manyu4605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Accept Decline
Following manyu4605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org helps you discover great websites they recommend :)
Click here to unsubscribe from such emails from manyu4605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org or all friends


P.O. BOX 70928, Sunnyvale, CA 94086
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
陳建豪 | 21 Oct 10:50 2014
Picon

dynamic load and unload modules

Can we build a mother module which can dynamically load and unload other modules instead of calling all of them in the beginning (ryu_manager A.py B.py ...)?

We have try to use run_apps in base/app_manager.py, but it will be conflict if they both have function relate to controller.

For example, we run a controller first and then use web gui to load simple_switch_13.py, controller will be crash.

Nn web gui we just use run_apps to call simple_switch_13.py, it will show SERVICE_BRICK problem.
                                                                                                                                                             
Thank for your reply.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Aneta Wojewoda | 21 Oct 00:21 2014
Picon

Dokumenty

Witam,

Zwracam się z zapytaniem w imieniu internetowego serwisu tłumaczeniowego.

Polscy przedsiębiorcy szukają dobrych jakościowo tłumaczeń w związku z
rosnącym eksportem i chęcią nawiązywania międzynarodowej współpracy.

Chciałam się zapytać czy mogę przedstawić ofertę na usługi tłumaczeń
pisemnych?

Pozdrawiam,
Aneta Wojewoda
Senior Account Manager
lingworld.eu

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
汪 建廷 | 20 Oct 05:51 2014
Picon

dynamic load and unload modules

Can we build a mother module which can dynamically load and unload other modules instead of calling all of them in the beginning (ryu_manager A.py B.py ...)? <!-- .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 12pt; font-family:新細明體 } -->

We have try to use run_apps in base/app_manager.py, but it will be conflict if they both have function relate to controller.

For example, we run a controller first and then use web gui to load simple_switch_13.py, controller will be crash.

Nn web gui we just use run_apps to call simple_switch_13.py, it will show SERVICE_BRICK problem.
                                                                                                                                                             
Thank for your reply.


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Gmane