Date: Sat, 04 May 2013 11:38:44 +0200 From: Andre Oppermann <andre@freebsd.org> To: Aris Angelo <arisangelo33@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: Calculation of inflight data Message-ID: <5184D724.2070703@freebsd.org> In-Reply-To: <CAPn0ZgL_GOJ_=yvHa=M0WiB6uoPBngpwXvJNzm%2BVoJisBqBrLA@mail.gmail.com> References: <CAPn0ZgL_GOJ_=yvHa=M0WiB6uoPBngpwXvJNzm%2BVoJisBqBrLA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 03.05.2013 09:28, Aris Angelo wrote: > Hi, > > I am trying to implement an extension to the FreeBSD TCP stack. In order to > do that, I have a question regarding the calculation of the "pipe" > variable, the amount of data that the sender calculates as being inflight. > I am puzzled for the case when no SACK is negotiated and used. > > My idea would be that in this case the following is correct (during a > partial ack): > > pipe = tp->snd_max - th->th_ack; Actually pipe would decrease by one MSS for every duplicate ACK received, though we can't be sure that it really represents a full MSS due to smaller segments being possible with TCP_NODELAY. > But when looking at the tcp_output code, I can see that the off variable, > which is used as pipe to determine later how much data to send ( len = > snd_cwnd- off); ), is calculated as: > > off = tp->snd_nxt - tp->snd_una; off specifies the offset to send from in the send socket buffer and is not equal to pipe. > Obviously snd_una is used since there is no info on tcp_output for the ack > header, but I think using more up to date information is better (although > less data would be injected to the network). > > But why is snd_nxt instead of snd_max used? In case of a partial ack, > snd_nxt is readjusted for retransmit, that means, that it's closer to > snd_una. What is your opinion, how should this variable be calculated? Unfortunately the pipe value isn't really calculated at the moment. -- Andre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5184D724.2070703>