Hi,
Please, see the code below:
pkt_tcp = pkt.get_protocol(tcp.tcp)
if pkt_tcp:
tcp_src_port = pkt_tcp.src_port
tcp_dst_port = pkt_tcp.dst_port
print "TCP_Source_port:", tcp_src_port
print "TCP_Dst_port:", tcp_dst_port
print "TCP Window size:", pkt_tcp.window_size
output at controller:
gv@controller:~/ryu/ryu/app$ ryu-manager myswitch_13.py
loading app myswitch_13.py
loading app ryu.controller.ofp_handler
instantiating app myswitch_13.py of SimpleSwitch13
instantiating app ryu.controller.ofp_handler of OFPHandler
TCP_Source_port: 39286
TCP_Dst_port: 22
TCP Window size: 299
packet in 37769644528961 02:e4:2e:e4:8a:23 02:4c:a0:20:cc:82 6
TCP_Source_port: 22
TCP_Dst_port: 39286
TCP Window size: 303
Thanks
Gandhimathi
On 3 May 2016 at 09:26, Randa Alani <el...@leeds.ac.uk> wrote:
> Dear all
>
>
>
> I am trying to get the TCP header but when I excute the following:
>
>
>
> pkt = packet.Packet(msg.data)
>
> eth = pkt.get_protocols(ethernet.ethernet)[0]
>
> print eth
>
>
>
>
>
> pkt_tcp= pkt.get_protocols(tcp.tcp)
>
> print pkt_tcp
>
>
>
>
>
> and send TCP packet, the result is:
>
>
>
> []
>
>
>
> Why it is empty?
>
>
>
> Actullay, I want to modify the window_size of the packet and send it back
> to the switch. How to do that.
>
>
>
> Any information would very helpful,
>
>
>
> Regards,
>
> Randa
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel