Hi, Sunil

I guess that the controller could not connect to the OVS.

Please confirm it by running controller with "--verbose" option.
If connected, you will see "move onto config mode" message in stdout.

    $ryu-manager ryu/app/simple_switch_13.py --verbose
    Registered VCS backend: git
    Registered VCS backend: hg
    (...snip...)
connected socket:<eventlet.greenio.base.GreenSocket object at 0x7f20c43efd68> address:('127.0.0.1', 33670) hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f20c43ef0b8>
    move onto config mode
    EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures

I think the client and the controller cannot share one interface.
So you need another port to connect the controller and OVS.

 (for controller)
 ┌------------┐
PC ----------- OVS -------- Server
   (for client)

FYI, fail mode of OVS may be the cause of the packet passing without flow entries. If the fail mode is "standalone" and OVS cannot connect to its controller, OVS works as an L2 switch, so the packet will be passed.
You can see the current fail mode by running this command:
    $ovs-vsctl get-fail-mode [bridge]


Thanks,
Fujimoto

On 2017年08月28日 15:25, Sunil wrote:
Hello Ryu experts!,
I am trying to create a simple PacketOut for a TCP packet and I had followed the example code provided for the ICMP. I modified the sample_switch_13 application . Please find the code below. I am not sure why the flow table is not created and my traffic is passed. I am fairly new to the controller and therefore requesting some help. I have an raspberry pi running OVS and it has 2 ports. One input ( eth0 -port1 and one output eth1-port2). Both are defined as part of the br-int bridge.

My topology has a edge device ( PC) connected to the OVS ( rasberry pi). The other end of the Raspberry pi is connected to the server. I am running a simple client ( PC) to the server ( Linux) via the Raspberry pi ( OVS). Client is connected to eth0 ( port 1) and server is connected to eth1 ( port 2).

My controller is also running the edge device (PC). what am I doing wrong ?. Also, do I need to create 2 separate flow entries - one for client to server and other for server to client or it is created as part of the PacketOut ( once the below code is fixed ).

Your help will be greatly appreciated here!


def _handle_tcp(self, datapath,ipv4_pkt,eth_pkt,tcp_pkt, in_port):
        pkt=packet.Packet()
pkt.add_protocol(ethernet.ethernet(ethertype=eth_pkt.ethertype,
                                       src=eth_pkt.src,
                                       dst=eth_pkt.dst))
pkt.add_protocol(ipv4.ipv4(src=ipv4_pkt.src,dst=ipv4_pkt.dst,
                                   proto=ipv4_pkt.proto))
pkt.add_protocol(tcp.tcp(dst_port=tcp_pkt.dst_port,
                             src_port=tcp_pkt.src_port))
        # learn a mac address to avoid FLOOD next time.
self.mac_to_port[datapath.id <http://datapath.id>][eth_pkt.src] = in_port

        # if the destination mac address is already learned,
        # decide which port to output the packet, otherwise FLOOD.
if eth_pkt.dst in self.mac_to_port[datapath.id <http://datapath.id>]: out_port = self.mac_to_port[datapath.id <http://datapath.id>][eth_pkt.dst]
        else:
                out_port = datapath.ofproto.OFPP_FLOOD
        self._send_packet(datapath, in_port
                          ,pkt,out_port)

    def _send_packet(self,datapath, port, pkt,out_port):
        print( "PRINTING INPORT AND OUTPORT......:",port,out_port)
        ofproto=datapath.ofproto
        parser=datapath.ofproto_parser
        pkt.serialize()
        data=pkt.data
        action=[parser.OFPActionOutput(port=port)]

         out=parser.OFPPacketOut(datapath=datapath,
         buffer_id=ofproto.OFP_NO_BUFFER,
 in_port=ofproto.OFPP_CONTROLLER,actions=action,
            data=data)
        datapath.send_msg(out)


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

Reply via email to