i'm trying to implement a method that blocks a specific flow and consequently drops packets. I pass to it the datapath, the source ip and the destination ip. The app detects the flow, but the flow continues to work, the source sends data, and the dest host receives it. What am I doing wrong?
def drop_flow(self, datapath, ip_src, ip_dst):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
match = parser.OFPMatch(ipv4_src=ip_src,
ipv4_dst=ip_dst)
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, [])]
mod = parser.OFPFlowMod(datapath=datapath,
command=ofproto.OFPFC_DELETE,
out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY,
match=match, instructions=inst)
print "deleting flow entries in the table "
datapath.send_msg(mod)
Thanks!