Date: Thu, 12 May 2016 05:50:18 -0400 From: Randall Stewart <rrs@netflix.com> To: FreeBSD Transports <transport@FreeBSD.org> Subject: Consider this code in tcp_output.c and tcp_input.c Message-ID: <A025183A-7E1C-452A-8700-614476F285A7@netflix.com>
next in thread | raw e-mail | index | archive | help
All:
Here are a couple blocks of code from input/output
************************************
tcp_input.c:
       /*
         * Segment received on connection.
         * Reset idle time and keep-alive timer.
         * XXX: This should be done after segment
         * validation to ignore broken/spoofed segs.
         */
        tp->t_rcvtime =3D ticks;
tcp_output.c:
       /*
         * Determine length of data that should be transmitted,
         * and flags that will be used.
         * If there is some data or critical controls (SYN, RST)
         * to send, then transmit; otherwise, investigate further.
         */
        idle =3D (tp->t_flags & TF_LASTIDLE) || (tp->snd_max =3D=3D =
tp->snd_una);
        if (idle && ticks - tp->t_rcvtime >=3D tp->t_rxtcur)
                cc_after_idle(tp);
**************************************
Now this works just fine if you are the sender of the data.. i.e. we go =
idle, and then=20
you call send(=85) to the peer.
However what happens if say you are a CDN?
Your client goes idle, its gotten everything.. for some period of time, =
maybe its playing out
its play-buffer or what ever..
Then it sends in a request, "please send me a large block of data=94?
You then start to stream out your 2Meg block of data=85.
Since you received a request at tp->t_rcvtime to send you a big block of =
data
the timestamp is current.
So you blast out 2Meg using your old cwnd/ssthresh and send a nice =
line-rate
burst=85 which of course hits tail drops and other fun :-)
I believe we need to have something like:
***************************
if ((tp->snd_max =3D=3D tp->and_una) && ((ticks - tp->t_rcvtime) >=3D =
tp->t_rxtcur))) {
     cc_after_idle(tp)
}
tp->t_rcvtime =3D ticks;
***********************************
added so we catch both sides of the equation..
R
--------
Randall Stewart
rrs@netflix.com
803-317-4952
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A025183A-7E1C-452A-8700-614476F285A7>
