Some question about DCTCP implementation in FreeBSD

Lars Eggert lars at eggert.org
Tue Jun 4 21:31:29 UTC 2019


Hi,

glad to see interest in DCTCP!

On 2019-6-4, at 11:05, Yu He via freebsd-net <freebsd-net at 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 at ietf.org list is likely going to be a better forum for these questions, except for FreeBSD-specific ones.

Lars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20190604/36843961/attachment.sig>


More information about the freebsd-net mailing list