Hi
Thanks for your help. I have used ".OFPGT_ALL" in ".OFPGroupMod" message, and found that the flow is splitting. But there is a serious problem: if I set any value in "weight" field, except 0, then the flow does not split into multiple sub-flows. I have also noticed that if I set 0 in "weight" field, then the flow sends an equal number of packets in each sub-flows and the number of packets of a sub-flow is equivalent to the number of packets of the flow. I used the following code, ofproto = datapath.ofproto parser = datapath.ofproto_parser group_id = 1 action01 = [parser.OFPActionOutput(2)] action02 = [parser.OFPActionOutput(4)] weight01 = 0 weight02 = 0 watch_port = ofproto_v1_3.OFPP_ANY watch_group = ofproto_v1_3.OFPQ_ALL bucket01 = parser.OFPBucket(weight01, watch_port, watch_group, action01) bucket02 = parser.OFPBucket(weight02, watch_port, watch_group, action02) req = parser.OFPGroupMod(datapath, ofproto.OFPFC_ADD, ofproto.OFPGT_ALL, group_id=1, buckets=[bucket01, bucket02]) # (2) ofproto.OFPGT_SELECT --> ofproto.OFPGT_ALL datapath.send_msg(req) (1) How can I split a flow into multiple sub-flows defining the percentage of each sub-flows compared to the flow? (2) I want to know the use, and application of OFPGT_INDRIECT, and OFPGT_FF. Thanks, -Tanvir ________________________________________ From: Iwase Yusuke <iwase.yusu...@gmail.com> Sent: Thursday, 21 December 2017 10:50 AM To: Ul Huque, Tanvir (Data61, Eveleigh ATP) Cc: ryu-devel@lists.sourceforge.net Subject: Re: [Ryu-devel] splitting a flow into a number of flows Hi, > buckets = [parser.OFPBucket(weight01, watch_port, watch_group, > action01), parser.OFPBucket(weight02, watch_port, watch_group, action02)] > req = parser.OFPGroupMod(datapath, ofproto.OFPFC_ADD, > ofproto.OFPGT_SELECT, group_id, buckets) How about using ofproto.OFPGT_ALL instead of ofproto.OFPGT_SELECT? Please refer to "5.6.1 Group Types" on OpenFlow Spec 1.3.5 for the difference between the types of group action. Thanks, Iwase On 2017年12月19日 18:58, tanvir.ulhu...@data61.csiro.au wrote: > Hi > > > I want to split a flow into two flows, e.g., a flow entering into switch 1 > will > be splitted into two flows going to switch 3 and switch 5. > > > > ________________ switch 3_____________ > > | > | > > h1------switch 1 > switch 4-------- h2 > > |_________________ switch 5____________| > > > > Now, to split the flow I have used the following code, however, I have found > that flow is not splitting and passing through only one link without sending > any > packets in other link. > > 1. Could you please help me identifying the problem? > > 2. Could you please share necessary resources/links/guidelines of load sharing > in SDN using RYU so that I can have workable implementation? > > > > #....................................................... send_group_mod > ..................................................... > # applicable in Swicth-1 (shared switch/AP) > > > def group_mod01(self, datapath): > ofproto = datapath.ofproto > parser = datapath.ofproto_parser > > group_id = 1 > action01 = [parser.OFPActionOutput(2)] # for switch 3 > action02 = [parser.OFPActionOutput(4)] # for switch 5 > weight01 = 50 > weight02 = 50 > watch_port = ofproto_v1_3.OFPP_ANY > watch_group = ofproto_v1_3.OFPQ_ALL > buckets = [parser.OFPBucket(weight01, watch_port, watch_group, > action01), parser.OFPBucket(weight02, watch_port, watch_group, action02)] > req = parser.OFPGroupMod(datapath, ofproto.OFPFC_ADD, > ofproto.OFPGT_SELECT, group_id, buckets) > datapath.send_msg(req) > > #....................................................... switch_in_handler > ................................................... > # pro-active rule in > Switch 1 > > @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER) > def switch_features_handler(self, ev): > datapath = ev.msg.datapath > dpid = datapath.id > ofproto = datapath.ofproto > parser = datapath.ofproto_parser > > if datapath.id == 1: > self.group_mod01(datapath) > actions = [parser.OFPActionSetField(ip_dscp = 1), > parser.OFPActionGroup(group_id = 1)] > priority = 100 > match = parser.OFPMatch(in_port= 1, eth_type=0x0800, > ipv4_src='10.0.0.1', ipv4_dst='10.0.0.2', ip_proto=17, udp_dst=5555 ) > self.add_flow(datapath, priority , match, actions) > > > > > > > > > ------------------------------------------------------------------------------ > 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