diff options
author | Florin Coras <fcoras@cisco.com> | 2018-04-18 16:40:55 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2018-04-20 05:33:43 -0700 |
commit | 62166004a9f0861e9ea50101b2194881ef1a35aa (patch) | |
tree | cf7a52e59565489d4922bb8fd39f3ab40003b124 /src/vnet/tcp/tcp_newreno.c | |
parent | 00cd22d627325a4a2869bedac68d0c1dd4d8ade7 (diff) |
tcp: make newreno byte instead of acks dependent
Should be more resilient to ack losses
Change-Id: Icec3b93c1d290dec437fcc4e6fe5171906c9ba8a
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_newreno.c')
-rw-r--r-- | src/vnet/tcp/tcp_newreno.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_newreno.c b/src/vnet/tcp/tcp_newreno.c index 103fea4c194..7ae7f484b56 100644 --- a/src/vnet/tcp/tcp_newreno.c +++ b/src/vnet/tcp/tcp_newreno.c @@ -36,8 +36,14 @@ newreno_rcv_ack (tcp_connection_t * tc) } else { - /* Round up to 1 if needed */ - tc->cwnd += clib_max ((tc->snd_mss * tc->snd_mss) / tc->cwnd, 1); + /* tc->cwnd += clib_max ((tc->snd_mss * tc->snd_mss) / tc->cwnd, 1); */ + tc->cwnd_acc_bytes += tc->bytes_acked; + if (tc->cwnd_acc_bytes >= tc->cwnd) + { + u32 inc = tc->cwnd_acc_bytes / tc->cwnd; + tc->cwnd += inc * tc->snd_mss; + tc->cwnd_acc_bytes -= inc * tc->cwnd; + } } } |