Hi Ramana,

It is depending on your settings of the installed flow entries which sending the
packet to controller by the OUTPUT action.

If you want to the get whole packet, please specify 
"max_len=ofproto.OFPCML_NO_BUFFER"
into OFPActionOutput class.
  
https://github.com/osrg/ryu/blob/master/ryu/ofproto/ofproto_v1_3_parser.py#L2867

Thanks,
Iwase

On 2015年12月19日 02:40, Ramana Reddy wrote:
> Hi Iwase,
> Thank you so much. It solved my problem. I have one more concern. Is that RYU 
> get the whole packet, or the first few bytes of the packet.   If that is not 
> true,  what are the options we have to provide so that RYU controller get the 
> whole packet from the switch.
> 
> Thanks & Regards,
> Ramana
> 
> On Fri, Dec 18, 2015 at 10:45 AM, Yusuke Iwase <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     Hi Ramana,
> 
>     In Ryu, TCP payload will be at the last element of pkt.protocols if the 
> payload exists.
> 
>      e.g.)
>       If the payload exists:
>         pkt.protocols = [ethernet(...), ipv4(...), tcp(...), 'payload_data']
>       You can access the payload like "pkt.protocols[-1]".
> 
>       If the payload does not exist:
>         pkt.protocols = [ethernet(...), ipv4(...), tcp(...)]
> 
>     Thanks,
>     Iwase
> 
>     On 2015年12月18日 12:58, Ramana Reddy wrote:
>     > Thanks for your reply. The library pkt.get_protocol(tcp.
>     > tcp) gives the entire packet including the header. I could not see any 
> api to get only tcp payload. In pox, tcp.payload gives the payload without 
> the header. Any such api in ryu.
>     >
>     > Thanks,
>     > Ramana
>     >
>     > On 18 Dec 2015 5:26 am, "Yusuke Iwase" <[email protected] 
> <mailto:[email protected]> <mailto:[email protected] 
> <mailto:[email protected]>>> wrote:
>     >
>     >     Hi Ramana,
>     >
>     >     Please refer to this Ryu-Book page for the usage of the packet 
> library.
>     >       http://osrg.github.io/ryu-book/en/html/packet_lib.html
>     >
>     >      e.g.)
>     >         tcp_packet = pkt.get_protocol(tcp.tcp)
>     >         if tcp_packet:
>     >             print(tcp_packet)
>     >
>     >     Thanks,
>     >     Iwase
>     >
>     >     On 2015年12月18日 02:16, Ramana Reddy wrote:
>     >     > What I need basically is:
>     >     >
>     >     > msg = ev.msg
>     >     > pkt = packet.Packet(msg.data)
>     >     >
>     >     > from 'pkt' we will get all ethernet, IP and TCP headers using 
> pkt.get_protocol(). But I would like to know
>     >     > how to extract the payload of the packet after stripping of all 
> these headers.
>     >     >
>     >     > Regards,
>     >     > Ramana
>     >     >
>     >     >
>     >     >
>     >     > On Thu, Dec 17, 2015 at 10:38 PM, Ramana Reddy 
> <[email protected] <mailto:[email protected]> <mailto:[email protected] 
> <mailto:[email protected]>> <mailto:[email protected] 
> <mailto:[email protected]> <mailto:[email protected] 
> <mailto:[email protected]>>>> wrote:
>     >     >
>     >     >     Hi All,
>     >     >
>     >     >     I would like to know the API to extract the payload of a tcp 
> packet.
>     >     >
>     >     >
>     >     >     Thanks & Regards,
>     >     >     Ramana
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > 
> ------------------------------------------------------------------------------
>     >     >
>     >     >
>     >     >
>     >     > _______________________________________________
>     >     > Ryu-devel mailing list
>     >     > [email protected] 
> <mailto:[email protected]> 
> <mailto:[email protected] 
> <mailto:[email protected]>>
>     >     > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>     >     >
>     >
>     >
>     >
>     > 
> ------------------------------------------------------------------------------
>     >
>     >
>     >
>     > _______________________________________________
>     > Ryu-devel mailing list
>     > [email protected] <mailto:[email protected]>
>     > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>     >
> 
> 

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to