Software Defined Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Associating a flow to a meter via Ryu controller on ARUBA 2930F JL253A Switch

 
Highlighted
Ramzah_Rehman
Occasional Contributor

Associating a flow to a meter via Ryu controller on ARUBA 2930F JL253A Switch

Hi,

I am trying to add a meter to the switch via RYU controller and then use that meter to rate-limit a flow. I was successful in adding the meter to the switch, however, when I try to associate that meter to a flow, I get this error.

EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0x1b412ff0
`-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x5, code=0x0, data=b'\x04\x0e\x00\x58\x1b\x41\x2f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x00\x00\x00\x00\x00\x00\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x01\x00\x00\x00\x01\x00\x04\x00\x00\x00\x00\x00\x04\x00\x18\x00\x00\x00\x00')
|-- type: OFPET_FLOW_MOD_FAILED(5)
|-- code: OFPFMFC_UNKNOWN(0)
`-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0x1b412ff0
`-- msg_type: OFPT_FLOW_MOD(14)

 

Result of show openflow Instance l1 meters command on switch's CLI

 Meter ID             : 1                   
 Flow Count           : 0                   
 Input Packet Count   : 0 
Input Byte COunt : 0     

 Duration             : 7                         

                        Packet  
 Band Type   Rate         Precedence Level   Count   
 ---------   ------------    ---------------------   --------
 Drop        100 kbps         NA                          0

My RYU app code snippet is as follows:

datapath = ev.msg.datapath

ofproto = datapath.ofproto

parser = datapath.ofproto_parser

bands = [parser.OFPMeterBandDrop(type_=ofproto.OFPMBT_DROP, len_=0, rate=100, burst_size=10)]

req = parser.OFPMeterMod(datapath=datapath, command=ofproto.OFPMC_ADD, flags=ofproto.OFPMF_KBPS, meter_id=1,
bands=bands)

datapath.send_msg(req)

#now meter_id=1 will be applied to a flow

match = parser.OFPMatch()

actions = [parser.OFPActionOutput(1)]

inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions),parser.OFPInstructionMeter(1)]

cookie_mask = 0
mod = datapath.ofproto_parser.OFPFlowMod(

datapath=datapath, match=match, cookie=0,

command=ofproto.OFPFC_ADD, idle_timeout=0,

hard_timeout=0, priority=3, instructions=inst,table_id=100,buffer_id = ofproto.OFP_NO_BUFFER, cookie_mask=cookie_mask,out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY,
flags=ofproto.OFPFF_SEND_FLOW_REM,)

datapath.send_msg(mod)

I am 100% sure there's no error in the code because I have tried running that same code for openVswitch (virtual switch) and I was able to add meter and associate it with the flow entry. Please let me know what's the issue with ARUBA swicth? Am I missing some configuration?

 

Please replay as soon as possible.

Thank you! 

2 REPLIES
Ramzah_Rehman
Occasional Contributor

Re: Associating a flow to a meter via Ryu controller on ARUBA 2930F JL253A Switch

Ramzah_Rehman
Occasional Contributor

Re: Associating a flow to a meter via Ryu controller on ARUBA 2930F JL253A Switch

I had to set hardware-rate of openflow instance to zero. Then I was able to use meter and associate it with a flow.

Steps to do that:

config

Openflow instance <name> limit hardware-rate 0