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

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

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

Replies are listed 'Best First'.
Re^5: Scaled TCP window with Net::RawIP
by Illuminatus (Curate) on Mar 03, 2011 at 00:37 UTC
    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

      I am trying to generate last A packet in S-S/A-A sequence. I get sequence numbers from S/A packet, also can get wscale value. And send back as an answer A packet with scaled window, just have no idea how to scale window using NET::RawIP.

      But I guess I am looking more for an advice how to use/set required packet options with RawIP especially ones related with window scaling instead of analysis of the packet flow.

      Thanks for any ideas about how to generate such packet.

      Martynas

        Ok, case can be closed. :) It is really not set in any further packets and taken from last S/A packet. I amnaged to get what I want, so question is not valid. For the ones who want set Window scale - option 3 shall be used in any packet with S flag. Below example is scaling factor 4, right window size still shall be set with set command.

        $packet->optset(tcp=> { type => [(3)], data => [("\x04",)],});

        I appreciate all provided comments about the case and thanks to the ones who answered

        Martynas