On Mon, 21 Apr 2014 15:12:56 +1200
Karthik Sharma <[email protected]> wrote:

> I have copied the function send_lldp_packet() from
> *ryu/topology/switches.py.*The only addition that I have done to the
> function is to add a print statement.Now If I were to run the controller
> using
> 
> * sudo ryu-manager --observe-links ryu/app/simple_switch.py*
> 
> and
> 
> make the mininet topology connect to the controller I don't see the print
> *('send_lldp_packet')* coming on the screen.

Just copying send_lldp_packet() doesn't anything. You also need the
caller, etc. If you want to do l2 switch feature with toplogy feature,
I would recommend you to extend ryu/topology/ instead of simple_switch

> I was told that the topology is cached in some structure by RYU.It would be
> great if someone could point me to the structure?
> 
> def send_lldp_packet(self, port):
>         try:
>             port_data = self.ports.lldp_sent(port)
>         except KeyError as e:
>             # ports can be modified during our sleep in self.lldp_loop()
>             # LOG.debug('send_lldp: KeyError %s', e)
>             return
>         if port_data.is_down:
>             return
> 
>         print('send_lldp_packet')
>         dp = self.dps.get(port.dpid, None)
>         if dp is None:
>             # datapath was already deleted
>             return
> 
>         # LOG.debug('lldp sent dpid=%s, port_no=%d', dp.id, port.port_no)
>         # TODO:XXX
>         if dp.ofproto.OFP_VERSION == ofproto_v1_0.OFP_VERSION:
>             actions = [dp.ofproto_parser.OFPActionOutput(port.port_no)]
>             dp.send_packet_out(actions=actions, data=port_data.lldp_data)
>         elif dp.ofproto.OFP_VERSION >= ofproto_v1_2.OFP_VERSION:
>             actions = [dp.ofproto_parser.OFPActionOutput(port.port_no)]
>             out = dp.ofproto_parser.OFPPacketOut(
>                 datapath=dp, in_port=dp.ofproto.OFPP_CONTROLLER,
>                 buffer_id=dp.ofproto.OFP_NO_BUFFER, actions=actions,
>                 data=port_data.lldp_data)
>             dp.send_msg(out)
>         else:
>             LOG.error('cannot send lldp packet. unsupported version. %x',
>                       dp.ofproto.OFP_VERSION)
> 
> Regards,
> Karthik.

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to