in reply to Scaled TCP window with Net::RawIP

Reading the documentation and searching for window seems to suggest the window key in the constructor to specify the window size. The "Window" field is only 16 bit, so it's highly unlikely that you will be able to set it greater than 65535, at least, that's what TCP Protocol tells me.

Update: Reading TCP window scale option seems to indicate that you want to set the appropriate window scaling option to make the window go above 64k. I'm not sure how your supplied value of 1, affects the window size, but other than that, what you did should work, according to the documentation.

How do you check that it doesn't work?

As the option only sets a scale factor, you still need to set a window size.

Replies are listed 'Best First'.
Re^2: Scaled TCP window with Net::RawIP
by Martynas (Initiate) on Mar 02, 2011 at 11:48 UTC

    That is what I am trying to set - window to some value like for example 65535 and scaling factor via TCP option 3. However must be somthing still missing as scaling is usualy negotiated only in packets that have S flag. I do not catch how window size shgall be adjusted for specific scaling factor for ACK packet - like giving window size and telling that this is scaling factor to be used.

    When I play with TCP option 3 I tried various values as scaling factor, looks like there must be more fancy setup or something is not working as my window size remains as set in window with no scaling (according Wireshark).

    $packet = new Net::RawIP({tcp => {}}); $packet->set({ip=> {saddr=>$srcip, daddr=>$dstip, frag_off=>0, tos=>0 +, id=>int rand 50000}, tcp=> {source=>$sport, dest=>$dport, syn=>0, ack=>1, win +dow=> 65535, ack_seq=>++$his_seq, seq=>++$my_seq,}}); $packet->optset(tcp=> { type => [(3)], data => [(2)],});

    Updating with tcpdump output - win is 65535, wscale is 0, eol is set (?).

    13:53:56.892099 IP (tos 0x0, ttl 64, id 46408, offset 0, flags none, proto: TCP (6), length: 44) xx.yy.zz.yy.64570 > zz.yy.xx.ww.9876: ., cksum 0xce9f (correct), ack 1 win 65535 <wscale 0,eol>

    Martynas