You can do that with the same syntax. The openflow_mod() returns the flow modification message with the default command set as OFPFC_ADD. Just reverse the match match.nw_src(IPAddr(B)) and match.nw_dst (IPAddr(A))
Make another back_msg=openflow_mod() and do a connection.send(back_msg) Be careful with the other entries that get wild carded. There is a proper example in the pox wiki. On Jun 25, 2013 11:27 AM, "Muhammad Asad" <[email protected]> wrote: > > Hi, > > In my network, a packet is sent from Host A to Host B. What I want is whenever Host A sends a packet to Host B, two flows should be created. One flow with NW Src A and NW Dest B and second flow with NW Src B and NW Dest A. > > I can install flow with NW Src A and NW Dest B with the following code: > > msg = of.ofp_flow_mod() > msg.match.nw_src = IPAddr("IP_of_Host_A") > msg.match.nw_dst = IPAddr("IP_of_Host_B") > msg.actions.append(of.ofp_action_output(port = 4)) > self.connection.send(msg) > > But how can I install the second flow with NW Src B and NW Dst A? Remember, I need to install both flows from packet sent from Host A to Host B, while Host B never sends a packet to Host A but I still need flow for it. > > Thank you. > > _______________________________________________ > discuss mailing list > [email protected] > http://openvswitch.org/mailman/listinfo/discuss >
_______________________________________________ discuss mailing list [email protected] http://openvswitch.org/mailman/listinfo/discuss
