Hi,
I guess you mean "fast failover (FF)" type of group action.
For the details of this action, please refer to the "5.6.1 Group Types" section
in the OpenFlow Spec
1.3.5, first.
Here is the sample code to install a simple FF group entry and a flow entry
using group action.
$ git diff
diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py
index 3e7c598..d06bc60 100644
--- a/ryu/app/simple_switch_13.py
+++ b/ryu/app/simple_switch_13.py
@@ -48,6 +48,28 @@ class SimpleSwitch13(app_manager.RyuApp):
ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)
+ buckets = [
+ parser.OFPBucket(
+ watch_port=1,
+ actions=[parser.OFPActionOutput(1)],
+ ),
+ parser.OFPBucket(
+ watch_port=2,
+ actions=[parser.OFPActionOutput(2)],
+ ),
+ ]
+ req = parser.OFPGroupMod(
+ datapath,
+ command=ofproto.OFPGC_ADD,
+ type_=ofproto.OFPGT_FF,
+ group_id=1,
+ buckets=buckets)
+ datapath.send_msg(req)
+
+ match = parser.OFPMatch(in_port=3)
+ actions = [parser.OFPActionGroup(1)]
+ self.add_flow(datapath, 0, match, actions)
+
def add_flow(self, datapath, priority, match, actions, buffer_id=None):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
With OVS on Mininet:
mininet> sh ovs-ofctl dump-flows s1
cookie=0x0, duration=14.256s, table=0, n_packets=0, n_bytes=0, priority=0
actions=CONTROLLER:65535
cookie=0x0, duration=14.256s, table=0, n_packets=0, n_bytes=0,
priority=0,in_port=3 actions=group:1
mininet> sh ovs-ofctl dump-groups s1 -O OpenFlow13
OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):
group_id=1,type=ff,bucket=watch_port:"s1-eth1",actions=output:"s1-eth1",bucket=watch_port:"s1-eth2",actions=output:"s1-eth2"
The above entries mean "if packets came from port 3, then output from port 1 if
lives otherwise
output from port 2".
Please note if the both port 1 and 2 is dead, packets will be dropped.
Thanks,
Iwase
On 2017年11月13日 23:31, Soliman Awad Alshra´a Abdullah TU Ilmenau wrote:
Dears,
I am working on Fast failure recovery, and I found some people talk about use two port for the same
entry in failure situation.
Is there any code that help me to make the prime port and backup on in the same
entry ??
for example :
flow_entry['match']=OFPHashableMatch(in_port=6,eth_type=0x8847,mpls_label=501)
flow_entry['actions']=[osparser.OFPExpActionSetState(ofparser.OFPActionOutput(output:1,altinative:3)
Please, if there anything like that, could you guide me or give me an example.
Thanks in advance
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel