I have inserted two flow entry for same source and destination pair for active and backup path with different priority. Even if a link failure occurs the flow does not go through the backup path. Probably the kernel space doesn't care about port status. It only match flow table and do the action. But still I'm interested to use the backup path with different priority. I have heard about fast failure group table of OVS. I'm not sure how to use it to guide the traffic to my alternative path. May I have any help on this circumstance? or is there any mechanism to flush the flow entry that belongs to down interface without communication with the controller? I'm using Ryu 4.24, OVS 2.9.0 and mininet. Thanks in advance for your help.
You are right that fast failure groups can address your issue. Say you want to use port 2 only if port 1 is down, you would then configure your Open vSwitch's bridge as follows:
ovs-ofctl -O OpenFlow13 add-group br0 group_id=1,type=fast_failover,bucket=bucket_id=1,actions=output:2,watch_port=2,bucket=bucket_id=2,actions=output:3,watch_port=3
ovs-ofctl add-flow br0 priority=1,ip,nw_dst=10.0.0.1,actions=group:1
The first command creates a group 1 of type fast_failover with 2 buckets (i.e., 2 possible destinations for packets reaching that group). Bucket 1 sends packet to port 2 on the condition that it is live (watch_port=2
), while bucket 2 sends packet to port 3 with a similar condition (watch_port=3
). A group of type fast_failover iterates on its buckets (in the order you defined them) until it finds one that is live.
The second command simply sends packet with a 10.0.0.1 destination IP to the group.