Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2019 18:05:34 +0000
From:      Yu He <yuhe@vmware.com>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:        Gopakumar Pillai <gpillai@vmware.com>
Subject:   Some question about DCTCP implementation in FreeBSD
Message-ID:  <2F719086-68CA-46CB-AE01-40E2AAB6E964@vmware.com>

next in thread | raw e-mail | index | archive | help

Greetings!

I’m a graduate student from Carnegie Mellon University, and currently an intern in VMware. I’m now working on some internal project about implementing DCTCP algorithm and coming across the implementation in https://reviews.freebsd.org/rS277054. There is one thing I’m quite curious about.

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.

Because this is the very central formula of DCTCP algorithm, I’m feeling it necessary to have an explanation from the original authors.

Or if in another way this is actually a bug, I’m willing to improve it.

Best,

Yu He
Intern-Product Development-NSBU,
VMware

Master of Science, Information Networking,
Carnegie Mellon University





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2F719086-68CA-46CB-AE01-40E2AAB6E964>