Hi All,

I am writing my first non-tutorial controller using Ryu. We are currently
writing a program using a Ryu Controller connected to OvS with openflow 1.5.
During the program an external client sends a packet to OvS which is then
transferred to Ryu for handling. The packet_in interface works fine, the
packet is received and the operation is performed correctly, the problem is
that the controller needs to send a reply packet at the end of the
operation. But when I TCP dump the client computer I don't get the reply
packet, and I am not sure what I did wrong. I am pasting the code for the
reply operation below. (the reply pkt is created in a different function,
and port == in_port of the original request packet that arrived in
packet_in)

@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
                datapath = ev.msg.datapath
                port = ev.msg.match['in_port']

     <... some more code ...>

                reply_pkt =
self._handle_delete(eth,ip,udp_p,md_udp,md_bin,key)
                self._send_reply_packet(datapath,port,reply_pkt)

def _send_reply_packet(self, datapath, port, pkt):
                ofproto = datapath.ofproto
                parser = datapath.ofproto_parser
                pkt.serialize()
                data = pkt.data
                actions = [parser.OFPActionOutput(port=port)]
                out = parser.OFPPacketOut(datapath=datapath,
                                          buffer_id=ofproto.OFP_NO_BUFFER,

match=parser.OFPMatch(in_port=ofproto.OFPP_CONTROLLER),
                                          actions=actions,
                                          data=data)
                datapath.send_msg(out)

Thanks,

Eyal Cidon
------------------------------------------------------------------------------
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

Reply via email to