Hello, sorry about the delay,

On Wed, 7 May 2014 14:09:32 +0200
Benjamin Eggerstedt <[email protected]> wrote:

> First of all I'd like to introduce myself to the members of the mailing
> list.
> 
> My name is Benjamin Eggerstedt and I'm working for Alcatel-Lucent
> Enterprise in Germany. I went through different SDN controllers (POX,
> Floodlight, now Ryu) and chose Ryu to be the one that I want to focus on. I
> like the feature richness and that it is developed in Python (my favorite
> programming language) with support for OF 1.3 (and probably later versions,
> that I didn't focus on yet).

Thanks a lot for choosing Ryu!

> A huge part of my work is the Alcatel-Lucent OmniSwitch portfolio that has
> support for OF 1.0 or 1.3.1 in full or API mode. I read through some
> documentation already, but didn't find the good example yet to solve "my
> issue".
>
> On-topic:
> Let us assume that I have an application that informs me about a certain
> bad behaviour (crossing a threshold) of a user connected to a certain
> switchport (e.g. snmp port index 1007), now that application only sees the
> IP-address of the corresponding switch, but doesn't know the DPID.
> 
> I went through different examples in the app/ directory, but didn't find a
> way to associate the IP-address of a device with the DPID. Did I oversee
> something? Could you probably point me to a method or function do do that
> mapping?
> 
> I have to admit that I didn't have the time to read through all the
> examples yet, so my question might be answered through one of them. Please
> point me to it if this is the case ...

Currently, there is no proper API to get the IP addreess of
switch. You need to access to kinda _private_ member like the
following example code.

fujitatomonari-no-MacBook-Air:~ fujita$ ryu-manager a.py
loading app a.py
loading app ryu.topology.switches
loading app ryu.controller.ofp_handler
instantiating app a.py of ExampleApp
instantiating app ryu.topology.switches of Switches
instantiating app ryu.controller.ofp_handler of OFPHandler
('192.168.177.32', 33331) 94895196319813


Adding a handy API for this information sounds a good idea to me.

=
from ryu.base import app_manager
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.topology import api
from ryu.topology import event

class ExampleApp(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(ExampleApp, self).__init__(*args, **kwargs)

    @set_ev_cls(event.EventSwitchEnter)
    def switch_features_handler(self, ev):
        for sw in api.get_all_switch(self):
            print sw.dp.socket.getpeername(), sw.dp.id

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to