aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/cc
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2020-06-10 07:32:02 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2020-06-10 07:32:02 +0000
commit2fda0a6f3aa9c3190bcab3c682dd51df110c1a2b (patch)
tree9822f5997f0b5e351fbac95e6376d4a1c56a981b /sys/netinet/cc
parent2b2c6d69191b689af79a1210f97b13719eb487a4 (diff)
downloadsrc-2fda0a6f3aa9c3190bcab3c682dd51df110c1a2b.tar.gz
src-2fda0a6f3aa9c3190bcab3c682dd51df110c1a2b.zip
Prevent TCP Cubic to abruptly increase cwnd after app-limited
Cubic calculates the new cwnd based on absolute time elapsed since the start of an epoch. A cubic epoch is started on congestion events, or once the congestion avoidance phase is started, after slow-start has completed. When a sender is application limited for an extended amount of time and subsequently a larger volume of data becomes ready for sending, Cubic recalculates cwnd with a lingering cubic epoch. This recalculation of the cwnd can induce a massive increase in cwnd, causing a burst of data to be sent at line rate by the sender. This adds a flag to reset the cubic epoch once a session transitions from app-limited to cwnd-limited to prevent the above effect. Reviewed by: chengc_netapp.com, tuexen (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 3 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D25065
Notes
Notes: svn path=/head/; revision=362006
Diffstat (limited to 'sys/netinet/cc')
-rw-r--r--sys/netinet/cc/cc_cubic.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
index 28e3d3c51649..cec5917e01b3 100644
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -94,6 +94,7 @@ struct cubic {
uint32_t flags;
#define CUBICFLAG_CONG_EVENT 0x00000001 /* congestion experienced */
#define CUBICFLAG_IN_SLOWSTART 0x00000002 /* in slow start */
+#define CUBICFLAG_IN_APPLIMIT 0x00000004 /* application limited */
/* Minimum observed rtt in ticks. */
int min_rtt_ticks;
/* Mean observed rtt between congestion epochs. */
@@ -153,8 +154,10 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type)
cubic_data->t_last_cong = ticks - INT_MAX;
}
- if (cubic_data->flags & CUBICFLAG_IN_SLOWSTART) {
- cubic_data->flags &= ~CUBICFLAG_IN_SLOWSTART;
+ if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART |
+ CUBICFLAG_IN_APPLIMIT)) {
+ cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART |
+ CUBICFLAG_IN_APPLIMIT);
cubic_data->t_last_cong = ticks;
cubic_data->K = 0;
}
@@ -214,6 +217,9 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type)
CCV(ccv, t_maxseg));
}
}
+ } else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) &&
+ !(ccv->flags & CCF_CWND_LIMITED)) {
+ cubic_data->flags |= CUBICFLAG_IN_APPLIMIT;
}
}