in reply to Re: Scaled TCP window with Net::RawIP
in thread Scaled TCP window with Net::RawIP

That is the point. I receive scaling factor in previous SYN/ACK. Now how I shall form packet flow after that to use scaled window with window size and scaling factor?

Martynas

  • Comment on Re^2: Scaled TCP window with Net::RawIP

Replies are listed 'Best First'.
Re^3: Scaled TCP window with Net::RawIP
by Illuminatus (Curate) on Mar 02, 2011 at 21:15 UTC
    Maybe you should read the rfc that defines window scaling (section 2). As long as both the SYN and SYN/ACK contain wscale opts, both sides will do scaling based on the values they sent/received. The option is never resent, but its shift-value is implied in the window value in the tcp header of each packet. The session info in the stack keeps track of the scale. This is a different question from "how can I get optset to work?" I guess I am a little confused about what you are trying to do. Are you really trying to manage a complete TCP session via RawIP? Unless the session is extremely trivial, this is not recommended.

    fnord

      My intension is to use Net::RawIP to assemble single ACK packet that would have window size scaled (greater than 65535). I am not trying to simulate whole flow, just taking some values from normal S-S/A-A flow.

      When I analyze normal flow I see in Wireshark that "Windows size: 262144 (scaled)" and trying to assemble same packet with Net::RawIP.

      In previous S/A packet I see "Window size: 65535" and also "Window scale: 3 (multiply by 8)".So that is ok - S packet has scaling factor set up clearly. Windows scale is not present in A packet, but still Windows size is presented as scaled.

      Question is how I can use this factor in assembling next single A packet so that window size would be scaled?

      Thanks, Martynas

        All packets in the session after the S-S/A assume the negotiated scale for their direction. OK, so 262144/8 = 32768. That's the correct window value, assuming you are still signaling a complete window. This is also assuming you are sending the ack from the same direction as the S/A. If you are sending it from the other direction, you use the wscale advertised by the SYN (if it was different). I am still confused on how you plan to 'insert' this ack into the session. The receiving stack is going to generate acks for all data received. How are you going to decide the sequence number to acknowledge?

        fnord