Hello Allen,

Please keep the mailing list in the recipients, thanks!

2015-01-30 15:20 GMT+08:00 Allen <[email protected]>:

> Hi Tang,
>
> If I construct the ring topology,The network is paralysis and I can't go
> on. Maybe the network is full use of ‍LLDP packets.Do the LLDP packets
> are produced periodically ?
>

Yes.


> How to resolve this problem?‍
>

The original packet_in_handler in simple_switch.py floods everything if the
destination of packet-in data was unknown. Since you were constructing a
ring topology, you must be careful not to let such packet cause broadcast
storm and prevent it flooding again.

For example, you can just filter specific ethertype not to packet-out (see
below).

===
diff --git a/ryu/app/simple_switch.py b/ryu/app/simple_switch.py
index 8fd3d21..6d1dbb7 100644
--- a/ryu/app/simple_switch.py
+++ b/ryu/app/simple_switch.py
@@ -26,6 +26,7 @@ from ryu.controller import ofp_event
 from ryu.controller.handler import MAIN_DISPATCHER
 from ryu.controller.handler import set_ev_cls
 from ryu.ofproto import ofproto_v1_0
+from ryu.ofproto.ether import ETH_TYPE_LLDP
 from ryu.lib.mac import haddr_to_bin
 from ryu.lib.packet import packet
 from ryu.lib.packet import ethernet
@@ -68,6 +69,9 @@ class SimpleSwitch(app_manager.RyuApp):

         self.logger.info("packet in %s %s %s %s", dpid, src, dst,
msg.in_port)

+        if eth.ethertype == ETH_TYPE_LLDP:
+            return
+
         # learn a mac address to avoid FLOOD next time.
         self.mac_to_port[dpid][src] = msg.in_port

===

You may need more checks or run spanning tree in your scenario.
See http://osrg.github.io/ryu-book/en/html/spanning_tree.html



>
> thanks
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Wei-Li Tang";<[email protected]>;
> *发送时间:* 2015年1月30日(星期五) 中午12:08
> *收件人:* "Xuchenhui"<[email protected]>;
> *抄送:* "[email protected]"<[email protected]>;
> *主题:* Re: [Ryu-devel] Topology Discover
>
> Hello,
>
> Most packets you received (Destination MAC=01:80:c2:00:00:0e) are LLDP
> packets which is used for link discovery.
>
> Packets with Destination MAC prefix: 33:33:xx:xx:xx:xx are IPv6 multicast
> packets, generated by hosts in your mininet. This is okay for your lab and
> you can just ignore it.
>
> 2015-01-30 11:23 GMT+08:00 Xuchenhui <[email protected]>:
>
>> Hi,
>>
>> I try to write function to get topology info in simple_switch.py,but I
>> receive a lot of packet in messages when I start ryu controller.
>>
>> If I run "ryu-manager simple_switch.py ",the controller is run
>> normally,but I can't discover link info.And if run "ryu-manager
>> --observe-links simple_switch.py",I will receive a lot of packet in
>> messages. I don't know why.
>>
>> sudo mn --controller=remote --topo linear,2
>>
>> Add function in simple_simple_switch.py is :
>>
>>     @set_ev_cls(event.EventSwitchEnter)
>>     def get_topology(self,ev):
>>         switch_list=get_switch(self.topology_api_app,None)
>>         switches=[switch.dp.id for switch in switch_list]
>>         links_list=get_link(self.topology_api_app,None)
>>
>> receive:
>>
>> packet in 2 02:d5:9e:b1:87:b7 01:80:c2:00:00:0e 2
>> packet in 1 56:52:4e:dc:b5:b6 01:80:c2:00:00:0e 2
>> packet in 1 56:52:4e:dc:b5:b6 01:80:c2:00:00:0e 2
>> packet in 2 f6:a1:05:d0:db:73 33:33:00:00:00:16 1
>> packet in 1 f6:a1:05:d0:db:73 33:33:00:00:00:16 2
>> packet in 2 02:d5:9e:b1:87:b7 01:80:c2:00:00:0e 2
>> packet in 1 56:52:4e:dc:b5:b6 01:80:c2:00:00:0e 2
>> packet in 1 56:52:4e:dc:b5:b6 33:33:00:00:00:fb 2
>> packet in 2 02:d5:9e:b1:87:b7 01:80:c2:00:00:0e 2
>> packet in 1 56:52:4e:dc:b5:b6 01:80:c2:00:00:0e 2
>> packet in 2 02:d5:9e:b1:87:b7 33:33:00:00:00:fb 2
>> packet in 1 56:52:4e:dc:b5:b6 33:33:00:00:00:02 2
>> packet in 2 02:d5:9e:b1:87:b7 01:80:c2:00:00:0e 2
>>                 :
>>                 :
>>
>>
>> thanks
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net/
>> _______________________________________________
>> Ryu-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
>
>
> --
> Sincerely,
>
> Wei-Li Tang
> RD Engineer, Xinguard Inc.
>



-- 
Sincerely,

Wei-Li Tang
RD Engineer, Xinguard Inc.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to