summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast/pol/ca-mb-ecn.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-07-20 18:42:37 +0200
committerSander Vrijders <sander@ouroboros.rocks>2021-07-21 11:46:24 +0200
commitb066b8aa71be68586e7dd88fcb530733536aa30b (patch)
tree648b2ffb85cd4fdf5f1436c15234120713bee56b /src/ipcpd/unicast/pol/ca-mb-ecn.c
parent19a5cd2b494f5cea83f1c6332eab93ec19a9b649 (diff)
downloadouroboros-b066b8aa71be68586e7dd88fcb530733536aa30b.tar.gz
ouroboros-b066b8aa71be68586e7dd88fcb530733536aa30b.zip
ipcpd: Fix additive increase in CA-MB-ECN
The logic for additive increase was botched. It was adding to the current window limit, and to avoid a count-to-infinity when sending below the limit, I added a check that the application was trying to send more than the current limit. This fails in congestion avoidance mode when the IPCP is throttling traffic below the limit; causing the app to never increase the congestion window (and even worse, to keep decreasing in some cases). The Additive Increase will now always add bandwidth to the latest sending rate instead of the window bandwidth limit, avoiding all the problems. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast/pol/ca-mb-ecn.c')
-rw-r--r--src/ipcpd/unicast/pol/ca-mb-ecn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/unicast/pol/ca-mb-ecn.c b/src/ipcpd/unicast/pol/ca-mb-ecn.c
index a2454072..6cf140f5 100644
--- a/src/ipcpd/unicast/pol/ca-mb-ecn.c
+++ b/src/ipcpd/unicast/pol/ca-mb-ecn.c
@@ -135,8 +135,8 @@ ca_wnd_t mb_ecn_ctx_update_snd(void * _ctx,
if (ctx->tx_ece) /* Mult. Decrease */
ctx->tx_wbl -= (ctx->tx_wbl * ctx->tx_ece)
>> (CA_SHFT + 8);
- else if (ctx->tx_wbc > ctx->tx_wbl) /* Add. Increase */
- ctx->tx_wbl = ctx->tx_wbl + ctx->tx_inc;
+ else /* Add. Increase */
+ ctx->tx_wbl = ctx->tx_wbc + ctx->tx_inc;
}
/* Window scaling */