Date: Tue, 4 Jun 2019 14:31:08 -0700 From: Lars Eggert <lars@eggert.org> To: Yu He <yuhe@vmware.com> Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Gopakumar Pillai <gpillai@vmware.com> Subject: Re: Some question about DCTCP implementation in FreeBSD Message-ID: <D4DBFD20-0908-467C-A129-B1DD96C4A64F@eggert.org> In-Reply-To: <2F719086-68CA-46CB-AE01-40E2AAB6E964@vmware.com> References: <2F719086-68CA-46CB-AE01-40E2AAB6E964@vmware.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi, glad to see interest in DCTCP! On 2019-6-4, at 11:05, Yu He via freebsd-net <freebsd-net@freebsd.org> wrote: > In line 387 of file cc_tcp.c, the update of alpha is calculated by following code: > > dctcp_data->alpha = min(alpha_prev - (alpha_prev >> V_dctcp_shift_g) + > (dctcp_data->bytes_ecn << (10 - V_dctcp_shift_g)) / > dctcp_data->bytes_total, MAX_ALPHA_VALUE); > > As the update formula from the original paper is alpha = (1 - g) * alpha + g * F, I’m wandering about what the intention is of using left-shift when calculating the g * F part, which might seemingly multiplying the value rather than dividing it as suggested by the previous code. Let alone the operand (10 - V_dctcp_shift_g) might be a negative value, which will lead to an undefined behavior in C. You should really, really be looking at RFC8257 (https://tools.ietf.org/html/rfc8257) if you are interested in a DCTCP implementation, and not the original paper (which is of course still required reading for much of the background). The RFC fixes a bunch of issues with the paper, and this is one of them. Also, the tcpm@ietf.org list is likely going to be a better forum for these questions, except for FreeBSD-specific ones. Lars [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEDrrUO3PMwKM8fddaHbmKvSnuNPgFAlz24xwACgkQHbmKvSnu NPgpuA//XuCUqm0JUJ54tRLy5lB/jfYtiOohgkrAO9Xw7eMDkb593o/sf64tCnHx ChVsrRoidHAr32xseiQXdqUxlk+mEflLh3RzJfrhhFq6C1Eh+tL/kI8OBnPCB5Vh QXxIXVI1+Mnpl5ekA4sAFPjhCpa0MPxmoACARsYXorEJsi+bzwe+Jv1xjqlS/fal A8O+wigxq/tJKpVyn5Y1fQFF/PUwRgG5j+sbBHIylvH70huC1KhsXxf+XG/7PZG5 euV+Pdi2YhY1X761C3u6LqmKPKc0Lr1XtMW+j95wOH4W8M/Ko6VC8+dQQnqqCxwV txDhROBuibqwouq4aJ5X4BOLPOYRYCPTO4qxfOcuVXvP78zLpj/1CasQUnr2OpPf oUyHhH4ZEOO0Oo+1UxdX91vstUZjZskzaDOYBoRMfgEtmiwIckxGZq6cu4GISmY9 7fzkHq2p0/uk1kUc0eHJFdSLy9Ui6QYd3rWa9xxA4YuB9wYd/V4e/6LNDUXEe/Ol avSU7NWL9rMDRJtzynCw9soQeTPZ6MYRiRVO1QM2ngOWPEGotvp/jsuxYhc9xEeV 8plBM1I32VVnejdeHT0uaeLSaAA11RZ0FvmOd7HaZnzTSqNKjPIoqwVi0O4wtPfH bQ4waXlqk+hdIjsXhGf66pHRXMg/dqDZ37Jmb9hDUmfAhZoepJg= =snOf -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D4DBFD20-0908-467C-A129-B1DD96C4A64F>
