Hi Fujita,
Thanks for the response.
I wanted to know if we can specify the table number on the switch side when
we are trying to install the flow? The switch architecture is different
compared to traditional Openflow switches. We have a L2 mode where we can
install only L2 flows and L3 mode where we can install L2+L3. The program
below works perfectly fine when the switch is in an L2 mode and programs
the flow fine. But in L3 mode since we have seperate L2 and L3 table we
might be getting that error. So is there a way for specifying the table
number that the controller wants to specify the flow to be installed in?
The program I am using is as below. Please let me know if there is some
error I am overlooking in this. For example on the switch side the L2 table
number is 10. Is there anyways in this program we can specify table number
10 when we are passing down the flow to the switch?
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.topology import switches
from ryu.topology.event import EventSwitchEnter, EventSwitchLeave
class SwitchEventApp(app_manager.RyuApp):
_CONTEXTS = {
'switches': switches.Switches,
}
@set_ev_cls(EventSwitchEnter)
def _ev_switch_enter_handler(self, ev):
print('enter: %s' % ev)
datapath = ev.switch.dp
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
#dst = "00:11:22:33:44:55"
vlan=100
out_port=5098
match = parser.OFPMatch(in_port=5097, vlan_vid=vlan)
actions = [parser.OFPActionOutput(out_port)]
print 'Datapath to be added is ', datapath
print 'Flow to be added'
self.add_flow(datapath, 1000, match, actions)
def add_flow(self, datapath, priority, match, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
match = match, instructions=inst)
print 'Flow Sent'
datapath.send_msg(mod)
@set_ev_cls(EventSwitchLeave)
def _ev__switch_leave_handler(self, ev):
print('leave: %s' % ev)
Regards,
Vinay Pai B.H.
On Wed, Feb 12, 2014 at 8:38 PM, FUJITA Tomonori <
fujita.tomon...@lab.ntt.co.jp> wrote:
> On Wed, 12 Feb 2014 20:06:16 -0800
> vinay pai <bantw...@usc.edu> wrote:
>
> > I have another small query. When I pass the flow onto my switch I see the
> > error on my switch as follows:
> >
> > Debug: |1|00705|connmgr|INFO|sw1<->tcp:172.28.243.51:6633%management:
> > sending OFPBRC_EPERM error reply to OFPT_FLOW_MOD message
> >
> > Debug: |1|00706|vconn|DBG|tcp:172.28.243.51:6633%management: sent
> > (Success): OFPT_ERROR (OF1.3) (xid=0x61504c8f): OFPBRC_EPERM
> >
> >
> > The Flow Mod message from the controller goes fine to the switch but then
> > the switch responds with the OFPBRC_EPERM error. I wanted to know if flow
> > being sent is read-only in nature because of which the error is being
> seen?
> > Does Ryu have the concept of read-only flows?
>
> No. No such definition at the controller side.
>
> I guess that your controller is a slave (in a case that multiple
> controllers connect to a switch) or the configuration issue at the
> switch side.
>
--
Vinay Pai B.H.
Grad Student - Computer Science
Viterbi School of Engineering
University of Southern California
Los Angeles, CA, USA
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel