Date: Fri, 3 May 2013 09:28:07 +0200 From: Aris Angelo <arisangelo33@gmail.com> To: freebsd-net@freebsd.org Subject: Calculation of inflight data Message-ID: <CAPn0ZgL_GOJ_=yvHa=M0WiB6uoPBngpwXvJNzm%2BVoJisBqBrLA@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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; 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; 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? Thank you, Aris Angelogiannopoulos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPn0ZgL_GOJ_=yvHa=M0WiB6uoPBngpwXvJNzm%2BVoJisBqBrLA>