If you don't want to hardcode dpids (which is a good idea :-) ), you can
try to use configuration file with switch to rules bindings.
Look at this thread about working with configuration file from Ryu app:
https://sourceforge.net/p/ryu/mailman/message/35382122/
Also you can find interesting tricks in Greg Bernstein's post:
http://www.grotto-networking.com/SDNfun.html
Best Regards,
Nick
пн, 7 нояб. 2016 г. в 16:47, Aqsa Malik <[email protected]>:
> Alright thank you guys.
> I was just looking for a more sophisticated way to use in the code, rather
> than:
> if dpid == 1:
> ... add these rules..
> if dpid ==2:
> ...add these rules...
> Thanks :-)
>
> On Sun, Nov 6, 2016 at 6:46 AM, Iwase Yusuke <[email protected]>
> wrote:
>
> Hi,
>
> I'm agree with Nick.
> The way which the OpenFlow Spec says to differ the switches is only DPID,
> IIRC.
> The IP addresses of the switches might be used, but if the DPIDs are
> duplicated,
> this way will collapse.
>
> Thanks,
> Iwase
>
>
> On 2016年11月03日 00:59, Nick Sedelnikov wrote:
> > Sorry, maybe I misunderstood your question, but if you want to differ
> two switches you have only one option - DPID of the switch.
> >
> >
> > ср, 2 нояб. 2016 г. в 18:51, Aqsa Malik <[email protected] <mailto:
> [email protected]>>:
> >
> > But let's say I am adding the rules proactively in the
> (EventSwitchEnter).
> > How can i differentiate between the two switches, because they can
> be connected to the controller in any order.
> >
> > On Wed, Nov 2, 2016 at 4:24 PM, Nick Sedelnikov <
> [email protected] <mailto:[email protected]>> wrote:
> >
> > Hi,
> >
> > You should look at DPSet to retrieve Datapath objects from ryu:
> >
> http://ryu.readthedocs.io/en/latest/api_ref.html#ryu.controller.dpset.DPSet
> >
> > Then use standard datapath.send_msg(msg)
> >
> > Best Regards,
> > Nikolay Sedelnikov
> >
> > ср, 2 нояб. 2016 г. в 17:54, Aqsa Malik <[email protected]
> <mailto:[email protected]>>:
> >
> > Hi All,
> >
> > I want two add rules on two different switches using one Ryu
> application. What is the possible way to do that with two different dpid's
> to handle.
> >
> > Thanks
> >
>
> ------------------------------------------------------------------------------
> > Developer Access Program for Intel Xeon Phi Processors
> > Access to Intel Xeon Phi processor-based developer platforms.
> > With one year of Intel Parallel Studio XE.
> > Training and support from Colfax.
> > Order your platform today.
> http://sdm.link/xeonphi_______________________________________________
> > Ryu-devel mailing list
> > [email protected] <mailto:
> [email protected]>
> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >
> >
> >
> >
> > --
> > Aqsa Malik
> > Military College of Signals NUST
> >
> > visit my blog at
> > http://www.techiworld4u.blogspot.com
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Developer Access Program for Intel Xeon Phi Processors
> > Access to Intel Xeon Phi processor-based developer platforms.
> > With one year of Intel Parallel Studio XE.
> > Training and support from Colfax.
> > Order your platform today. http://sdm.link/xeonphi
> >
> >
> >
> > _______________________________________________
> > Ryu-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >
>
>
>
>
> --
> Aqsa Malik
>
> visit my blog at
> http://www.techiworld4u.blogspot.com
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel