Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Scaled TCP window with Net::RawIP

by Illuminatus (Curate)
on Mar 02, 2011 at 21:15 UTC ( [id://891096]=note: print w/replies, xml ) Need Help??


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

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

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

    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

        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://891096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found