Re: TCPIP sequence number question



JF Mezei skrev:
Ok, this isn't specifically VMS related but here it goes...

And this is a little late in answering, but anyway...

Say I am sending TCP data packets with sequence numbers #10 #11 #12 #13
#14 and #15.

Someone meddles with my traffic and changes, while in transit, the
sequence number of the second packet from #11 to #789

How will the receiver behave upon receiving the packet with sequence
number #789 ? Will it wait a certain amount of time to see if the
packet #11 will arrive out of sequence before declaring #11 to be lost
and sending NAK to the sender ?

The received should, assuming that #789 is outside the window, just toss the data and pretend it didn't see it. If the data is inside the window, it might be stored for later usage.

How long will it wait before declaring #11 to be lost at sea ?

That depends. TCP/IP implementations can do this differently, but it is recommended that the average round trip time is measured, and that timeouts are set to about 2*rtt.

But this is all done by the sender. There is no NAK capability in TCP/IP.

base on what I read, the recipient will send an ack confirming it has
received all data intact until/including #10. (instead of sending an
actual "I haven't received #11").

Correct.

Once the sender has realised the recipient hasn't received #11, will the
sender then resend #11 and all subsequent packets ?

That depends on the implementation. It could do either.
Since TCP uses a sliding window, a lot of data can be outstanding at the time of a retransmission. If all data after the data not acknowledged is resent or not is not defined. However, it might be wise to back off, and not immediately start retransmitting all data again.

With windowing, will the sender end up stopping transmission at one
point, waiting for an ack ? Or will the "sorry I didn,t get #11"
realisation reach the sender before the sender has finished sending all
packets permitted in the sliding window ?

There is no NAK packet. TCP uses a sliding window to define which data can be sent and be outstanding before any ACK arrives. In addition, you also have a transmission window, which is used to do flow control. And this is normally all regulated by the amount of retransmissions you get.
And TCP don't acknowledge all data. ACK to a certain sequence number implies that all data up until that sequence number is acked.

The TCP flow control, congestion, retransmission, round trip calculation and back off algorithms are rather complex, and not easy to answer like this.

aka: will the data line become idle for some time, or will it remain
constantly in full use with packets flowing with retransmissions here
and there ?

No, TCP tries to be smart and not fill the net with retransmissions. But there is definitely some leeway for implementors to do things as they see fit as well, so it's not always possible to give a straight answer.

Johnny

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt@xxxxxxxxxx || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
.



Relevant Pages

  • Re: How much RAM needed for low end Ethernet application?
    ... > How many Ethernet controllers are able to address this memory directly? ... checksum after the packet is buffered. ... > relied on the remote host to do retransmissions. ... there is no way of knowing what sequence ...
    (comp.arch.embedded)
  • Re: MC9S12NE64
    ... >>> haveing some Problems with the ACK. ... >>> old sequence number and therefore there are a lot of retransmissions. ... > or third packet is retransmitted because sequence number check (in tcp.c ...
    (comp.arch.embedded)
  • Re: Question regarding using AES in CTR mode to encrypt UDP
    ... But this doesn't solve the counter synchronization problem in CTR ... number explicitly in the packet that is transmitted. ... What I meant was that the sliding window doesn't solve the counter ... accept a certain sequence number in the authentication process. ...
    (sci.crypt)
  • Fwd: svn commit: r221418 - head/sys/net80211
    ...  Fix some corner cases in the net80211 sequence number retransmission ...    that out of order / retransmission handling would be handled by the AMPDU RX ...    software packet aggregation isn't yet handled), ...  static int ...
    (freebsd-current)
  • RE: IP Session Hijacking And Spoofing
    ... can use B as the bogus source address. ... A sends a SYN packet to T with B's address as the source to open a TCP ... Any sequence number will work in this packet. ... IP Session Hijacking And Spoofing ...
    (Security-Basics)