Hi Guys,

   I think there is an extension proposed on the ONF site (Ext-109) for the
TCP flags as OXM match parameter. I guess it will incorporated into the
spec very soon (May be in 1.5).

   https://rs.opennetworking.org/bugs/browse/EXT-109

Regards,
Nitish

On Tue, Nov 25, 2014 at 10:54 AM, Minoru TAKAHASHI <
[email protected]> wrote:

> Hi,
>
> >   File "/home/ubuntu/ryu/ryu/lib/packet/packet.py", line 96, in
> get_protocols
> >     assert issubclass(protocol, packet_base.PacketBase)
>
> The above error, which means that "tcp.tcp" is not an instance of the
> following class.
>
>   ryu/lib/packet/tcp.py: class tcp (packet_base.PacketBase):
>
> Hmm, can you check if there is any error in the import of tcp.tcp?
> or
> If possible, could you show me all of the source code?
>
> On 2014年11月21日 22:59, Salaheddine ZERKANE wrote:
> >  Hello Minoru,
> > Thank you very much for your insights and support.
> > I wanted to test a TCP parser on packet in events,  the code I used is :
> > class Test(app_manager.RyuApp):
> >     def __init__(self, *args, **kwargs):
> >         super(Test, self).__init__(*args, **kwargs)
> >     @set_ev_cls(ofp_event.EventOFPPacketIn)
> >     def packet_in_TCP_Parser(self,ev):
> >         msg = ev.msg
> >         datapath = msg.datapath
> >         ofproto = datapath.ofproto
> >         bin_packet = msg.data
> >         pkt = Packet(data=bin_packet)
> >         pkt_tcp = pkt.get_protocol(tcp.tcp)
> >         FlagsTCP = pkt_TCP.bits
> >         self.logger.info("les drapeaux tcp sont   %s" % (FlagsTCP,))
> >
> > However, got the following error : AssertionError
> > File "/home/ubuntu/ryu/ryu/lib/hub.py", line 52, in _launch
> >     func(*args, **kwargs)
> >   File "/home/ubuntu/ryu/ryu/base/app_manager.py", line 274, in
> _event_loop
> >     handler(ev)
> >   File "/home/ubuntu/ryu/ryu/Test.py", line 22, in packet_in_TCP_Parser
> >     pkt_tcp = pkt.get_protocol(tcp.tcp)
> >   File "/home/ubuntu/ryu/ryu/lib/packet/packet.py", line 103, in
> get_protocol
> >     result = self.get_protocols(protocol)
> >   File "/home/ubuntu/ryu/ryu/lib/packet/packet.py", line 96, in
> get_protocols
> >     assert issubclass(protocol, packet_base.PacketBase)
> > AssertionError
> >
> > Could please help me to resolve the error?
> > Thanks and regards,
> >
> > -----Message d'origine-----
> > De : Minoru TAKAHASHI [mailto:[email protected]]
> > Envoyé : jeudi 20 novembre 2014 03:05
> > À : Salaheddine ZERKANE; [email protected]
> > Objet : Re: [Ryu-devel] TCP Flags in ryu
> >
> > On 2014年11月19日 21:20, Salaheddine ZERKANE wrote:
> >> Hello,
> >>
> >> I am a phd student working in SDN security and new in RYU, Could you
> please help me to find out if it is possible to create rules in RYUusing
> matching on TCP Flags such as : RST, FIN, SYNAck, etc. and if RYUsupports a
> parsing of packet-in by thesetcpflags? If it is the case how please?
> >
> >> RST, FIN, SYNAck, etc. and if RYUsupports a parsing of packet-in by
> thesetcpflags?
> > Is possible.
> > Ryu can generate a corresponding python object from a sequence of bytes
> of the packet. The following URL has describes how to use.
> >
> >
> http://osrg.github.io/ryu-book/en/html/packet_lib.html#analysis-of-packet-parse
> >
> > Of course, this feature also supports tcp.
> >
> >
> http://ryu.readthedocs.org/en/latest/library_packet_ref.html#ryu.lib.packet.tcp.tcp
> >
> > And I wrote a simple sample code.
> > Please try the following.
> >
> > sample.py
> > -----------------------------------------------------------
> > from ryu.lib.packet.packet import Packet from ryu.lib.packet import
> ethernet from ryu.lib.packet import tcp from ryu.lib.packet import ipv4
> from ryu.lib.packet import packet_utils
> >
> > # Generation of Packets (Serialization)
> > pkt = Packet()
> > pkt.add_protocol(ethernet.ethernet(dst='22:22:22:22:22:22',
> src='12:11:11:11:11:11', ethertype=2048))
> pkt.add_protocol(ipv4.ipv4(tos=32, proto=6, src='192.168.10.10',
> dst='192.168.20.20', ttl=64)) pkt.add_protocol(tcp.tcp(dst_port=2222,
> bits=0b001100, option=str('\\x00' * 4), src_port=11111))
> >
> pkt.add_protocol('\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f')
> >
> > pkt.serialize()
> > bin_packet = pkt.data
> >
> > # Analysis of Packet (Parse)
> > pkt = Packet(data=bin_packet)
> > pkt_tcp = pkt.get_protocol(tcp.tcp)
> >
> > print pkt_tcp
> > # show TCP Flags (6bits)
> > print pkt_tcp.bits
> > -----------------------------------------------------------
> >
> > xxx@xxx:xxx/ryu/ $ python sample.py
> >
> tcp(ack=0,bits=12,csum=57105,dst_port=2222,offset=9,option=bytearray(b'\\x00\\x00\\x00\\x00'),seq=0,src_port=11111,urgent=0,window_size=0)
> > 12
> >
> > thanks
> >
> >>
> >> Thanks and regards,
> >>
> >>
> >>
> >> *Meilleures salutations,*
> >>
> >> *Salaheddine ZERKANE*
> >>
> >>
> >>
> >> {P}
> >>
> >>
> >>
> >> Doctorant
> >> Cubiq
> >>
> >> {T}
> >>
> >>
> >>
> >> +33 (0) 2 56 35 82 11
> >>
> >>
> >>
> >> http://signature.b-com.com/logo-bleu.gif <http://www.b-com.com/>
> >>
> >>
> >>
> >> ZAC DES CHAMPS BLANCS
> >> BÂT. A · 13 RUE CLAUDE CHAPPE
> >> 35510 CESSON-SÉVIGNÉ (FRance)
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> ----------------------------------------------------------------------
> >> -------- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT
> >> Server from Actuate! Instantly Supercharge Your Business Reports and
> >> Dashboards with Interactivity, Sharing, Native Excel Exports, App
> >> Integration & more Get technology previously reserved for
> >> billion-dollar corporations, FREE
> >> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.
> >> clktrk
> >>
> >>
> >>
> >> _______________________________________________
> >> Ryu-devel mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to