Hi, I was working on multicasting implementation. The scenario was host 1 
multicast packets to h2 and h3.
So my switch will change ipv4_dst = 10.0.0.2 and 10.0.0.3 respectively and 
output to h2(port 2) and h3(port 3).
I use group table to do this.
I put my initialization code under Event EventOFPStateChange, it looks like this

@set_ev_cls(ofp_event.EventOFPStateChange, [MAIN_DISPATCHER, DEAD_DISPATCHER])
    def _state_change_handler(self, ev):
        datapath = ev.datapath
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        self.logger.info("*****Initialization*****")

        # install a group table 
        actions1 = [parser.OFPActionSetField(ipv4_dst=“10.0.0.2”), 
parser.OFPActionOutput(2)]

        actions2 = [parser.OFPActionSetField(ipv4_dst=“10.0.0.3”), 
parser.OFPActionOutput(3)]

        buckets = [parser.OFPBucket(weight=0, watch_port=0, watch_group=0, 
actions=actions1),
                   parser.OFPBucket(weight=0, watch_port=0, watch_group=0, 
actions=actions2)]

        req = parser.OFPGroupMod(datapath=datapath,
                           command=ofproto.OFPFC_ADD,
                           type_=ofproto.OFPGT_ALL,
                           group_id=0,
                           buckets=buckets)
        datapath.send_msg(req)
        self.logger.info("1. Install Group Table”)
        
        match = parser.OFPMatch(in_port=1, eth_dst="00:00:00:00:00:02")
        actions = [parser.OFPActionGroup(0)]
        self.add_flow(datapath, 2, match, actions)

        self.logger.info("*****Initialization*****”)

def add_flow(self, datapath, priority, match, actions):
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                             actions)]


        mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                match=match, instructions=inst)
        datapath.send_msg(mod)

// packet_in event handler (all the rest is same as simple_switch_13.py)


First, when launching my code, the group table will set up and add one flow 
entry into table: when match in_port =1 (from h1) and eth_dst = 
“00:00:00:00:00:02” (which is h2), the action will be taken is direct to group 
table 0, which I created above. 

When I use mininet to h1 ping h2, the first 6 pings are successful, but after 6 
it stuck, I don’t know why.
The dpctl is even not working, it has message like this.

ubuntu@ip-172-31-12-125:~$ sudo dpctl unix:/tmp/s1 stats-flow
Jan 24 02:11:14|00001|vconn_unix|ERR|/tmp/vconn-unix.11620.0: connection to 
/tmp/s1 failed: Connection refused
dpctl: Error connecting to switch unix:/tmp/s1. (Connection refused)

So I can’t even check the flow table.

Is my logic wrong of doing this ??

Thank you!
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to