Hi

I am extracting information from packets using this and generating packets
using proto=150 from Scapy tool and trying to aggregate all the packets in
a list for specific time:-

        self.mac_to_port = {}
        self.start_time = time.time()
        self.data = []
        self.data_size = 0


 # get ipv4 packet
        ipv4_packet = pkt.get_protocol(ipv4.ipv4)
        if ipv4_packet:
            proto = ipv4_packet.proto
            total_len = ipv4_packet.total_length
            source=ipv4_packet.src
            destination= ipv4_packet.dst
            print "INFORMATION:", proto
            print total_len
            print "source address", source
        else:
            proto = total_len = 0

           dpid = datapath.id
           self.mac_to_port.setdefault(dpid, {})

           self.logger.info("packet in %s %s %s %s", dpid, src, dst,
in_port)
           if proto == 150 and total_len <= 128:
              elapsed_time = time.time() - self.start_time
              elapsed_time = 0
              data = msg.data
              self.data.append(data)
              self.data_size += total_len
              elapsed_time = time.time() - self.start_time
              print "ELAPSED: ", elapsed_time
              print "BUFFER: ", self.iot_data

            if elapsed_time > 10 or self.data_size >= 1000:

                out_port = ofproto.OFPP_FLOOD

                actions = [parser.OFPActionOutput(out_port)]

                data = ''.join(self.data)

                self.data = []
                print "BUFFER: ", self.data
                self.data_size = 0
                self.start_time = time.time()

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


Here is the verbose output:-

[root@host3 app]# ryu-manager --verbose simple_switch_13.py
loading app simple_switch_13.py
loading app ryu.controller.ofp_handler
instantiating app simple_switch_13.py of SimpleSwitch13
instantiating app ryu.controller.ofp_handler of OFPHandler
BRICK SimpleSwitch13
  CONSUMES EventOFPPacketIn
  CONSUMES EventOFPSwitchFeatures
BRICK ofp_event
  PROVIDES EventOFPPacketIn TO {'SimpleSwitch13': set(['main'])}
  PROVIDES EventOFPSwitchFeatures TO {'SimpleSwitch13': set(['config'])}
  CONSUMES EventOFPErrorMsg
  CONSUMES EventOFPPortDescStatsReply
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPHello
  CONSUMES EventOFPSwitchFeatures
connected socket:<eventlet.greenio.base.GreenSocket object at 0x2142710>
address:('192.168.1.101', 43530)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x2142cd0>
move onto config mode
EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures
switch features ev
version=0x4,msg_type=0x6,msg_len=0x20,xid=0xfc786a28,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=207120314010642,n_buffers=256,n_tables=254)
move onto main mode


Thanks
Sheenam

On Tue, Apr 4, 2017 at 8:03 AM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi,
>
> Could you send more information?
> e.g., what modification you have, log message of ryu-manager with
> "--verbose" option.
>
> Thanks,
> Iwase
>
>
> On 2017年04月04日 03:39, Attitude Killer wrote:
> > Hi
> >
> > I modified simple_switch_13.py a bit and when I run , it hangs the
> remote host on which openvswitch is running and when I stop application
> then host starts working again.
> >
> > Can anyone please guide me through this?
> >
> > Thanks in advance
> >
> >
> > Sheenam
> >
> >
> >
> >
> >
> > ------------------------------------------------------------
> ------------------
> > 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