TCP receive buffer - TCP-IP

This is a discussion on TCP receive buffer - TCP-IP ; Hi! I have the following question regarding the tcp stack implementation of any OS. Can i make an assumption that once an byte sequence is acked by the tcp stack, resending the same byte sequence segment will not overwrite the ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: TCP receive buffer

  1. TCP receive buffer

    Hi!
    I have the following question regarding the tcp stack implementation of

    any OS.
    Can i make an assumption that once an byte sequence is acked by
    the tcp stack, resending the same byte sequence segment will not
    overwrite the previous byte sequence in any of the known tcp stacks?

    For e.g., Lets say the TCP stack has acknowledged sequence upto X,
    If i send segment whose seq number starts as X-a and ends in X+b,
    then what is the behaviour of the tcp stack.
    Does it overwrite the data from this new segment into the RCV buffer,
    or does it strip off the X-a tillX, and only accept data from X until
    X+b?

    Thanks
    Rajkumar...


  2. Re: TCP receive buffer

    shubamshreyas@yahoo.com wrote:
    > Hi!
    > I have the following question regarding the tcp stack implementation
    > of any OS.


    > Can i make an assumption that once an byte sequence is acked by the
    > tcp stack, resending the same byte sequence segment will not
    > overwrite the previous byte sequence in any of the known tcp stacks?


    Whether you "can" or not I don't think you "should" assume that.

    > For e.g., Lets say the TCP stack has acknowledged sequence upto X,
    > If i send segment whose seq number starts as X-a and ends in X+b,
    > then what is the behaviour of the tcp stack.


    > Does it overwrite the data from this new segment into the RCV
    > buffer, or does it strip off the X-a tillX, and only accept data
    > from X until X+b?


    If you are sending, I think you should make sure that the bytes from
    seq X-a to X are the same as they were before. I can recall no
    prohibition in the TCP specs that says that the data from X-a to X
    cannot be overwritten when a segment with bytes from X-a to X+b
    arrives.

    rick jones
    --
    a wide gulf separates "what if" from "if only"
    these opinions are mine, all mine; HP might not want them anyway...
    feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

  3. Re: TCP receive buffer

    Hi!

    Rick Jones wrote:
    > shubamshreyas@yahoo.com wrote:
    > > Hi!
    > > I have the following question regarding the tcp stack implementation
    > > of any OS.

    >
    > > Can i make an assumption that once an byte sequence is acked by the
    > > tcp stack, resending the same byte sequence segment will not
    > > overwrite the previous byte sequence in any of the known tcp stacks?

    >
    > Whether you "can" or not I don't think you "should" assume that.
    >
    > > For e.g., Lets say the TCP stack has acknowledged sequence upto X,
    > > If i send segment whose seq number starts as X-a and ends in X+b,
    > > then what is the behaviour of the tcp stack.

    >
    > > Does it overwrite the data from this new segment into the RCV
    > > buffer, or does it strip off the X-a tillX, and only accept data
    > > from X until X+b?

    >
    > If you are sending, I think you should make sure that the bytes from
    > seq X-a to X are the same as they were before. I can recall no
    > prohibition in the TCP specs that says that the data from X-a to X
    > cannot be overwritten when a segment with bytes from X-a to X+b
    > arrives.


    I am not sending such a seq, but i would like to know, how does the
    OS tcp stack handle such kind of scenario, i tried looking at the linux
    tcp
    stack, but being an hardware guy could not make out much, other
    than that the segment was attached to the rcv_buf tail, and the rcv
    window
    was modified with the X+b value

    Rajkumar...

    >
    > rick jones
    > --
    > a wide gulf separates "what if" from "if only"
    > these opinions are mine, all mine; HP might not want them anyway...
    > feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...



  4. Re: TCP receive buffer


    shubamshreyas@yahoo.com wrote:
    > Hi!
    > I have the following question regarding the tcp stack implementation of
    >
    > any OS.
    > Can i make an assumption that once an byte sequence is acked by
    > the tcp stack, resending the same byte sequence segment will not
    > overwrite the previous byte sequence in any of the known tcp stacks?


    That seems a safe ass-umption: If the bytes have been acknowledged,
    they may have already been consumed by the receiving application by the
    time the acknowlegement is noted by another system out in the tubes.
    The stack can't overwrite data it's already handed off to the receiver.

    > For e.g., Lets say the TCP stack has acknowledged sequence upto X,
    > If i send segment whose seq number starts as X-a and ends in X+b,
    > then what is the behaviour of the tcp stack.
    > Does it overwrite the data from this new segment into the RCV buffer,
    > or does it strip off the X-a tillX, and only accept data from X until
    > X+b?


    If the data has *not* been consumed by the receiving application, then
    all bets are off.

    I don't think it's safe to ask this question about "any OS". It can be
    highly implementation specific.

    You might try reading whitepapers about evading intrusion detection.
    Those folks do lots of investigation into this sort of thing.

    /chris marget


  5. Re: TCP receive buffer

    On 2006-09-14 10:23:36 -0400, googlegroups@marget.com said:

    >
    > shubamshreyas@yahoo.com wrote:
    >> Hi!
    >> I have the following question regarding the tcp stack implementation of
    >>
    >> any OS.
    >> Can i make an assumption that once an byte sequence is acked by
    >> the tcp stack, resending the same byte sequence segment will not
    >> overwrite the previous byte sequence in any of the known tcp stacks?

    >
    > That seems a safe ass-umption: If the bytes have been acknowledged,
    > they may have already been consumed by the receiving application by the
    > time the acknowlegement is noted by another system out in the tubes.
    > The stack can't overwrite data it's already handed off to the receiver.


    I agree with you, Chris, also that it may be a safe assumption, and
    like you said there's a ton of "optional" behavior by TCP/IP stacks.
    This thread gave me the thought too that it's highly likely the already
    acknowledged segment won't get "over-written" since the data has been
    ACK'd, it may follow that any data sent again for the ACK'd segment
    might be rejected as a duplication - this is a pretty common case for
    packets that are duplicated in their entirety.

    The OP brings up an interesting thought though - is this always true
    for packets sent for part of a data segment, where the packet sent is a
    smaller portion of a segment already ACK'd?

    /dmfh

    ----
    __| |_ __ / _| |_ ____ __
    dmfh @ / _` | ' \| _| ' \ _ / _\ \ /
    \__,_|_|_|_|_| |_||_| (_) \__/_\_\
    ----



+ Reply to Thread