Date: Wed, 9 Sep 2015 17:18:06 -0700 From: hiren panchasara <hiren@strugglingcoder.info> To: freebsd-net@FreeBSD.org, lstewart@FreeBSD.org Cc: kmacy@FreeBSD.org Subject: Wrong cwnd calculation in cubic when blackhole detection is on Message-ID: <20150910001806.GB64965@strugglingcoder.info>
next in thread | raw e-mail | index | archive | help
--MW5yreqqjyrRcusr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline When blackhole detection is turned on with FreeBSD 10.2, I see really large (overflowed) values close to ulong max returning from cubic_cwnd() in netinet/cc/cc_cubic.h The culprit is this equation at the end of the function: cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; wmax is the cwnd when we entered congestion. In case of blackhole detection on, it can go down to 524. And when that happens, the equation above returns -ve value. Now, right before returning from that function, we cast it to ulong: return ((unsigned long)cwnd); That gives a really large value. In one particular example, we enter the function with following values: ticks:140 wmax=524 smss=524 K=430 and return with cwnd = 18446744073709551378. I still need to read the cubic draft [1] and see how this is supposed to work but if someone has any ideas, please let me know. I've thought about setting cwnd to 0 when cwnd < 0 but that's not fair and it'll hurt connection as it won't recover fast enough. Cheers, Hiren [1] https://tools.ietf.org/html/draft-rhee-tcpm-cubic-02 --MW5yreqqjyrRcusr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJV8Mw6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/luD0H/i8eUIcW5NkcXSCN3AZxqLqP l0Gs2DShH51F1JnTvRldUgCi41LcaZnDKtBE5cVjnM+ao9aoTYkZuIKNS9O+Ev+6 SVrqPdGNM815gN4yFZLC97dsOoEnrv2hGXzfVeqqm8rUEM47Pq/pZDhWsItm4F2r WkR9+pvsC2JNDLA8yFmwr4VQMVrwhLG/sq7VKXarlZPpTvRWNjU8i+4gZJlFoHxw +gj8U8e1QskD0eSDr5AoUSG0iOtpforUuUW0V4mpT46b45VltK7RJws8n0X0m1rr xWpnV/R+iux9OCvgZSk4wkjOgxe3MiswK4CGtyYhUmZw0sBS7APl7DWdnXkHya0= =bAGg -----END PGP SIGNATURE----- --MW5yreqqjyrRcusr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150910001806.GB64965>