From owner-freebsd-net@freebsd.org Tue Jun 4 21:31:29 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FBB15BDCDA for ; Tue, 4 Jun 2019 21:31:28 +0000 (UTC) (envelope-from lars@eggert.org) Received: from emh04.mail.saunalahti.fi (emh04.mail.saunalahti.fi [62.142.5.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "emh04.mail.saunalahti.fi", Issuer "emh04.mail.saunalahti.fi" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C65186F03 for ; Tue, 4 Jun 2019 21:31:27 +0000 (UTC) (envelope-from lars@eggert.org) Received: from eggert.org (unknown [62.248.255.8]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 48C7030041; Wed, 5 Jun 2019 00:31:17 +0300 (EEST) From: Lars Eggert Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_F17B59A5-63CB-4755-9F89-57054981FF8D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Some question about DCTCP implementation in FreeBSD Date: Tue, 4 Jun 2019 14:31:08 -0700 In-Reply-To: <2F719086-68CA-46CB-AE01-40E2AAB6E964@vmware.com> Cc: "freebsd-net@freebsd.org" , Gopakumar Pillai To: Yu He References: <2F719086-68CA-46CB-AE01-40E2AAB6E964@vmware.com> X-MailScanner-ID: B9B5E649EBD.A7306 X-MailScanner: Found to be clean X-MailScanner-From: lars@eggert.org X-Spam-Status: No X-Rspamd-Queue-Id: 7C65186F03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ATTACHMENT(0.00)[]; MX_GOOD(-0.01)[eggert.org]; NEURAL_HAM_SHORT(-0.20)[-0.198,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.10)[asn: 790(-0.49), country: EU(-0.01)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:790, ipnet:62.142.0.0/16, country:EU]; MIME_TRACE(0.00)[0:+,1:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[eggert.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[110.5.142.62.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 21:31:29 -0000 --Apple-Mail=_F17B59A5-63CB-4755-9F89-57054981FF8D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, glad to see interest in DCTCP! On 2019-6-4, at 11:05, Yu He via freebsd-net = wrote: > In line 387 of file cc_tcp.c, the update of alpha is calculated by = following code: >=20 > dctcp_data->alpha =3D 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); >=20 > As the update formula from the original paper is alpha =3D (1 - g) * = alpha + g * F, I=E2=80=99m 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 --Apple-Mail=_F17B59A5-63CB-4755-9F89-57054981FF8D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----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----- --Apple-Mail=_F17B59A5-63CB-4755-9F89-57054981FF8D--