Hi,
At least I think a following code causes an error.
> match = ofp_parser.OFPMatch(ipv4_src='10.10.10.100')
A match field of "ipv4_src" is allowed only if it is preceded by another entry
with oxm_type=OXM_OF_ETH_TYPE, oxm_hasmask=0, and oxm_value=0x0800.
(See A.2.3.6 of OpenFlowSpec1.3)
So, please corrrects as follows.
match = ofp_parser.OFPMatch(ipv4_src='10.10.10.100', eth_type=0x800)
And, it may becomes easier to find out the error for using --verbose option as
follows.
# ryu-manager [app_name] --verbose
^^^^^^^^^
<output example>
EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0x4f1e1a45
`-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9,
data=b'\x04\x0e\x00\x58\x4f\x1e\x1a\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x02\x00\x00\x00\x01\x00\x01\x00\x00\x00\x01\x00\x0c\x80\x00\x16\x04\x0a\x0a\x0a\x64\x00\x00\x00\x00')
|-- type: OFPET_BAD_MATCH(4)
|-- code: OFPBMC_BAD_PREREQ(9)
`-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0x4f1e1a45
`-- msg_type: OFPT_FLOW_MOD(14)
thanks,
On 2016年02月29日 19:21, mehran shetabi wrote:
> Hi,
> How can I get a notification that a flow has been deleted? i am using the
> attached code for realizing when a specific flow entry was deleted and then
> measuring the flow setup time, but there is no EventOFPFlowRemoved event that
> i can catch it. why? would you please help me to fix it?
> this is the code:
>
> def _measure_flow_setup_time(self):
> while True:
> for dp in self.datapaths.values():
> if dp.id == 1:
> ofp = dp.ofproto
> ofp_parser = dp.ofproto_parser
>
> match = ofp_parser.OFPMatch(ipv4_src='10.10.10.100')
> actions = [ofp_parser.OFPActionOutput(ofp.OFPP_NORMAL, 0)]
> inst =
> [ofp_parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS, actions)]
> req_add = ofp_parser.OFPFlowMod(dp,
> command=ofp.OFPFC_ADD, idle_timeout=0, hard_timeout=0,
> flags=ofp.OFPFF_SEND_FLOW_REM,
> priority=0, out_port=2,
> out_group=1, match=match, instructions=inst)
>
> dp.send_msg(req_add)
> hub.sleep(1)
>
>
>
> req_del = ofp_parser.OFPFlowMod(dp,
> command=ofp.OFPFC_DELETE_STRICT, idle_timeout=0, hard_timeout=0,
> flags=ofp.OFPFF_SEND_FLOW_REM,
> priority=0, out_port=2,
> out_group=1, match=match, instructions=inst)
>
>
> dp.send_msg(req_del)
> self.flow_del_send_time = time.time()
> self.k += 1
> hub.sleep(1)
>
>
>
>
> @set_ev_cls(ofp_event.EventOFPFlowRemoved, MAIN_DISPATCHER)
> def flow_removed_handler(self, ev):
> print "flow_removed_handler"
> msg = ev.msg
> dp = msg.datapath
> ofp = dp.ofproto
>
>
> if dp.id == 1:
> if msg.reason == ofp.OFPRR_IDLE_TIMEOUT:
> reason = 'IDLE TIMEOUT'
> elif msg.reason == ofp.OFPRR_HARD_TIMEOUT:
> reason = 'HARD TIMEOUT'
> elif msg.reason == ofp.OFPRR_DELETE:
> reason = 'DELETE'
> self.flow_removed_receive_time = time.time()
>
> self.f4.write(str(self.k)+'\t'+str(((self.flow_removed_receive_time -
> self.flow_del_send_time) + self.execution_time)*1000)+'\n')
>
> elif msg.reason == ofp.OFPRR_GROUP_DELETE:
> reason = 'GROUP DELETE'
> else:
> reason = 'unknown'
>
> print reason
>
>
> Thank you,
> ...................................................
> mehran shetabi
> PhD student
> Computer Engineering Department
> IUST
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel