hi, Fujimoto

for initializing controllers, i want to populate mac-to-port tables of all of 
controllers by sending packet-in with OFPR_NO_MATCH reason to them.

as before, i want to use this code for installing table-miss flow entry:


  # install table-miss flow entry
        match = parser.OFPMatch()
        actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER, 
ofproto.OFPCML_NO_BUFFER)]


and then, with Nicira extension action set controller_id for them:


 # configuring controller_id of this controller
        req = ofproto_v1_0_parser.NXTSetControllerId(datapath, controller_id=2)
        datapath.send_msg(req)


but, when i do this, there is no packet-in to my controller.

why?

 can i have OpenFlow action and Nicira Extension action together in my ryu code?


thank you,

Mehran shetabi

________________________________
From: Fujimoto Satoshi <satoshi.fujimo...@gmail.com>
Sent: Friday, July 14, 2017 5:11 AM
To: mehran shetabi; ryu-devel@lists.sourceforge.net
Subject: Re: [Ryu-devel] how can i distinguish controllers for packet in to 
them?

Hi, Mehran

how can i install table-miss flow entry with "NXActionController" that consists 
controller_id of all of my controller and OFPR_NO_MATCH reason?
You can specify "OFPR_NO_MATCH" to "reason" field in "NXActionController":
    parser.NXActionController(max_len=0, controller_id=2, 
reason=ofproto.OFPR_NO_MATCH)

However, what is "consists controller_id of all of my controller" ?
I thought you want to send packet-in to the "specific" controller,
so I think there is no need to specify two or more controllers in 
"NXActionController".

Anyway, I think it's up to you how to implement your application.


Thanks,
Fujimoto

On 2017年07月14日 08:24, mehran shetabi wrote:

hi, Fujimoto


it is working.

but now my problem is, how can i install table-miss flow entry with 
"NXActionController" that consists controller_id of all of my controller and 
OFPR_NO_MATCH reason?

i want to populate mac-to-port table of all of my controller with running 
pingall command and then send packet-in to specific controller.

how can i do this?


thank you,

Mehran shetabi

________________________________
From: Fujimoto Satoshi 
<satoshi.fujimo...@gmail.com><mailto:satoshi.fujimo...@gmail.com>
Sent: Thursday, July 13, 2017 5:40 AM
To: mehran shetabi; 
ryu-devel@lists.sourceforge.net<mailto:ryu-devel@lists.sourceforge.net>
Subject: Re: [Ryu-devel] how can i distinguish controllers for packet in to 
them?

Hi, Mehran

is there any conflict between OpenFlow 1.0 and OpenFlow 1.3?
Sorry, I didn't make it clear enough.
"NXTSetControllerId" is not a OpenFlow action, is a Nicira Extension action.
But in Ryu, this action is provided for only OpenFlow 1.0.
In this solution, we "hack" to use this action in OpenFlow 1.3.
I think there should be no conflict.

And in your code, you should use "NXActionController" to send Packet-In to the 
specific controller,
instead of "OFPActionOutput", it cannot do such a thing.
For "NXActionController", you have to specify the "controller_id" which you 
specified in "NXTSetControllerId".

I attached a code to this mail, it should be work well.
Please try it.


Thanks,
Fujimoto

On 2017年07月13日 05:50, mehran shetabi wrote:

hi, Fujimoto


is there any conflict between OpenFlow 1.0 and OpenFlow 1.3?

you know, as you said, i use the code in my controller:



from ryu.ofproto import ofproto_v1_0_parser

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

    def __init__(self, *args, **kwargs):
        super(SimpleSwitch13, self).__init__(*args, **kwargs)
        self.mac_to_port = {}

    @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
        dpid = datapath.id

        # configuring controller_id of this controller
        req = ofproto_v1_0_parser.NXTSetControllerId(datapath, controller_id=2)
        datapath.send_msg(req)


        # install table-miss flow entry
        match = parser.OFPMatch()
        actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER, 
ofproto.OFPCML_NO_BUFFER)]

        idle_timeout=0
        self.add_flow(datapath, 0, match, actions, idle_timeout, dpid)



but after adding the code that you mentioned, my controller didn't work 
properly (e.g. pingall command don't work).


how can i fix it?


thank you,

Mehran shetabi




________________________________
From: Fujimoto Satoshi 
<satoshi.fujimo...@gmail.com><mailto:satoshi.fujimo...@gmail.com>
Sent: Wednesday, July 12, 2017 5:43 AM
To: mehran shetabi; 
ryu-devel@lists.sourceforge.net<mailto:ryu-devel@lists.sourceforge.net>
Subject: Re: [Ryu-devel] how can i distinguish controllers for packet in to 
them?


Hi, Mehran


Sorry, I've overlooked about the following action, it may be able to solve your 
problem:

    
http://ryu.readthedocs.io/en/latest/nicira_ext_ref.html#ryu.ofproto.ofproto_v1_3_parser.NXActionController


This action belongs to 'Nicira extensions', not OpenFlow,

but with this, switches can send Packet-In to the specific controller.


To specify the controller, the "controller_id" should be configured.

Ryu can configure it by "NXTSetControllerId", but this can be used in only 
OpenFlow 1.0.


Then, it is not a beautiful method, how about the following?

(customizing ryu/app/simple_switch_13.py)



    @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


        # configuring controller_id of this controller

        req = ofproto_v1_0_parser.NXTSetControllerId(datapath, controller_id=5)
        datapath.send_msg(req)


                # add an action to send Packet-In to this controller

        match = parser.OFPMatch()
        actions = [
            parser.NXActionController(0, 5, ofproto.OFPR_ACTION)]

        self.add_flow(datapath, 0, match, actions)


This can be good for you?

Thanks,
Fujimoto


On 2017年07月11日 14:20, mehran shetabi wrote:

hi, Fujimoto


with setting roles and Async solution, if there are more than two controllers, 
how can i distinguish between them?

my problem is, how can i sent packet-in to the exact controller?


thank you,

Mehran shetabi


________________________________
From: Fujimoto Satoshi 
<satoshi.fujimo...@gmail.com><mailto:satoshi.fujimo...@gmail.com>
Sent: Tuesday, July 11, 2017 4:45 AM
To: mehran shetabi; 
ryu-devel@lists.sourceforge.net<mailto:ryu-devel@lists.sourceforge.net>
Subject: Re: [Ryu-devel] how can i distinguish controllers for packet in to 
them?

Hi, Mehran

 how can i use OpenFlow channel in Mininet?
Sorry, OpenFlow channel is a connection which is used for OpenFlow protocol and 
you already have.
What I meant was that you should have another connection between controllers 
and the switch other than OpenFlow channel,
to exchange "raw" packets, not OpenFlow packets.

in the second solution, how can i retrieve  Packet-in header?
As I said, in the second solution, the packets will be sent without Packet-in 
header.
So, in this solution, there is no way to retrieve Packet-in header.
If you want to get Packet-in header, I think this solution is not suitable,
then you should apply the first solution (setting roles and Async).

Do you need to get Packet-in header?
If not, I try implementing and tell you how to implement the second solution.


Thanks,
Fujimoto


On 2017年07月11日 06:04, mehran shetabi wrote:

hi, Fujimoto


in the second solution, how can i retrieve  Packet-in header?

is there any solution for it?


thank you,

Mehran shetabi

________________________________
From: Fujimoto Satoshi 
<satoshi.fujimo...@gmail.com><mailto:satoshi.fujimo...@gmail.com>
Sent: Monday, July 10, 2017 5:35 AM
To: mehran shetabi; 
ryu-devel@lists.sourceforge.net<mailto:ryu-devel@lists.sourceforge.net>; 
satoshi.fujimo...@gmail.com<mailto:satoshi.fujimo...@gmail.com>
Subject: Re: [Ryu-devel] how can i distinguish controllers for packet in to 
them?

Hi, Mehran

Unfortunately, you cannot use the port number which is connected to the 
controller in OFPActionOutput().

However, if you can set roles(Master/Slave) to the controllers,
you can use OFPSetAsync to control whether the switch sends Packet-In to Master 
or Slave controller:
    
http://ryu.readthedocs.io/en/latest/ofproto_v1_3_ref.html#ryu.ofproto.ofproto_v1_3_parser.OFPSetAsync


Or, this is not a beautiful method, you can connect controllers and the switch 
by another connection, like:

c1 ──of───sw ──of───c2
│      ││      │
└──────┘└──────┘     ("of" means an OpenFlow channel)

Then, you can specify the port number which is connected to the controller.
But the controller should receive packets in your application,
and the packets are "raw" packets, so the informations in the Packet-in header 
will be lost.


Thanks,
Fujimoto

On 2017年07月10日 07:52, mehran shetabi wrote:
Hi,

In Mininet, I created a topology with one switch, two host, and two inband RYU 
controller.
In OFPActionOutput() function, instead of using ofproto.OFPP_CONTROLLER for 
output port may I use port number (e.g. 3) that connected to the controller?
If the answer is no, is there any way to distinguish controllers for packet in 
to them?

Thank you,
Mehran shetabi




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net<mailto:Ryu-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/ryu-devel






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to