Skip to content

Commit

Permalink
DCTCP (Data Center TCP) implementation.
Browse files Browse the repository at this point in the history
DCTCP congestion control algorithm aims to maximise throughput and minimise
latency in data center networks by utilising the proportion of Explicit
Congestion Notification (ECN) marked packets received from capable hardware as a
congestion signal.

Highlights:
Implemented as a mod_cc(4) module.
ECN (Explicit congestion notification) processing is done differently from
RFC3168.
Takes one-sided DCTCP into consideration where only one of the sides is using
DCTCP and other is using standard ECN.

IETF draft: http://tools.ietf.org/html/draft-bensley-tcpm-dctcp-00
Thesis report by Midori Kato: https://eggert.org/students/kato-thesis.pdf

Submitted by:	Midori Kato <katoon@sfc.wide.ad.jp> and
		Lars Eggert <lars@netapp.com>
		with help and modifications from
		hiren
Differential Revision:	https://reviews.freebsd.org/D604
Reviewed by:	gnn
  • Loading branch information
hirenp committed Jan 12, 2015
1 parent aad2c3d commit 8ad8794
Show file tree
Hide file tree
Showing 8 changed files with 658 additions and 1 deletion.
1 change: 1 addition & 0 deletions share/man/man4/Makefile
Expand Up @@ -86,6 +86,7 @@ MAN= aac.4 \
cc_cdg.4 \
cc_chd.4 \
cc_cubic.4 \
cc_dctcp.4 \
cc_hd.4 \
cc_htcp.4 \
cc_newreno.4 \
Expand Down
127 changes: 127 additions & 0 deletions share/man/man4/cc_dctcp.4
@@ -0,0 +1,127 @@
.\"
.\" Copyright (c) 2014 Midori Kato <katoon@sfc.wide.ad.jp>
.\" Copyright (c) 2014 The FreeBSD Foundation
.\" All rights reserved.
.\"
.\" Portions of this documentation were written at Keio University, Japan.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd January 12, 2015
.Dt CC_DCTCP 4
.Os
.Sh NAME
.Nm cc_dctcp
.Nd DCTCP Congestion Control Algorithm
.Sh DESCRIPTION
The DCTCP (data center TCP) congestion control algorithm aims to maximise
throughput and minimise latency in data center networks by utilising the
proportion of Explicit Congestion Notification (ECN) marks received from capable
hardware as a congestion signal.
.Pp
DCTCP uses fraction of ECN marked packets to update congestion window. The
window reduction ratio is always <= 1/2. Only when all of the packets are
marked, congestion window is halved.
.Pp
In order to keep the accuracy of the ECN marked fraction, a DCTCP receiver
mirrors back incoming (or missing) CE marks by setting (or clearing) ECE marks.
This feedback methodology is also adopted when the receiver uses delayed ACK.
.Pp
FreeBSD DCTCP implementation includes two minor modifications for the one-sided
deployment. Considering the situation that DCTCP is used as sender and classic
ECN is used as receiver, DCTCP sets the CWR flag as the reaction to the ECE
flag. In addition, when classic ECN is used as sender and DCTCP is used as
receiver, DCTCP avoids to mirror back ACKs only when the CWR flag is
set in the incoming packet.
.Pp
The other specifications are based on the paper and Internet Draft referenced
in the
.Sx SEE ALSO
section below.
.Sh MIB Variables
The algorithm exposes the following tunable variables in the
.Va net.inet.tcp.cc.dctcp
branch of the
.Xr sysctl 3
MIB:
.Bl -tag -width ".Va alpha"
.It Va alpha
An initial estimator of the congestion on the link.
Default is 0.
.It Va dctcp_shift_g
An estimation gain in the alpha calculation.
Default is 16.
.It Va slowstart
A trigger to halve congestion window after slow start.
Default does nothing to halve window.
.Sh SEE ALSO
.Xr cc_chd 4 ,
.Xr cc_cubic 4 ,
.Xr cc_hd 4 ,
.Xr cc_htcp 4 ,
.Xr cc_newreno 4 ,
.Xr cc_vegas 4 ,
.Xr mod_cc 4 ,
.Xr tcp 4 ,
.Xr mod_cc 9
.Rs
.%A "Mohammad Alizadeh"
.%A "Albert Greenberg"
.%A "David A. Maltz"
.%A "Jitendra Padhye"
.%A "Parveen Patel"
.%A "Balaji Prabhakar"
.%A "Sudipta Sengupta"
.%A "Murari Sridharan"
.%T "Data Center TCP (DCTCP)"
.%U "http://research.microsoft.com/pubs/121386/dctcp-public.pdf"
.%J "ACM SIGCOMM 2010"
.%D "July 2010"
.%P "63-74"
.Re
.Rs
.%A "Stephen Bensley"
.%A "Lars Eggert"
.%A "Dave Thaler"
.%T "Microsoft's Datacenter TCP (DCTCP): TCP Congestion Control for Datacenters"
.%U "http://tools.ietf.org/html/draft-bensley-tcpm-dctcp-01"
.Re
.Sh HISTORY
The
.Nm
congestion control module first appeared in
.Fx 11.0 .
.Pp
The module was first released in 2014 by Midori Kato studying at Keio
University, Japan.
.Sh AUTHORS
.An -nosplit
The
.Nm
congestion control module and this manual page were written by
.An Midori Kato katoon@sfc.wide.ad.jp
and
.An Lars Eggert lars@netapp.com
with help and modifications from
.An Hiren Panchasara hiren@FreeBSD.org
3 changes: 2 additions & 1 deletion share/man/man4/mod_cc.4
Expand Up @@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 26, 2014
.Dd January 12, 2015
.Dt MOD_CC 4
.Os
.Sh NAME
Expand Down Expand Up @@ -78,6 +78,7 @@ MIB variable.
.Xr cc_cdg 4 ,
.Xr cc_chd 4 ,
.Xr cc_cubic 4 ,
.Xr cc_dctcp 4 ,
.Xr cc_hd 4 ,
.Xr cc_htcp 4 ,
.Xr cc_newreno 4 ,
Expand Down
1 change: 1 addition & 0 deletions sys/modules/cc/Makefile
Expand Up @@ -3,6 +3,7 @@
SUBDIR= cc_cdg \
cc_chd \
cc_cubic \
cc_dctcp \
cc_hd \
cc_htcp \
cc_vegas
Expand Down
7 changes: 7 additions & 0 deletions sys/modules/cc/cc_dctcp/Makefile
@@ -0,0 +1,7 @@
# $FreeBSD$

.PATH: ${.CURDIR}/../../../netinet/cc
KMOD= cc_dctcp
SRCS= cc_dctcp.c

.include <bsd.kmod.mk>
7 changes: 7 additions & 0 deletions sys/netinet/cc.h
Expand Up @@ -90,6 +90,10 @@ struct cc_var {
/* cc_var flags. */
#define CCF_ABC_SENTAWND 0x0001 /* ABC counted cwnd worth of bytes? */
#define CCF_CWND_LIMITED 0x0002 /* Are we currently cwnd limited? */
#define CCF_DELACK 0x0004 /* Is this ack delayed? */
#define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */
#define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */
#define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */

/* ACK types passed to the ack_received() hook. */
#define CC_ACK 0x0001 /* Regular in sequence ACK. */
Expand Down Expand Up @@ -143,6 +147,9 @@ struct cc_algo {
/* Called when data transfer resumes after an idle period. */
void (*after_idle)(struct cc_var *ccv);

/* Called for an additional ECN processing apart from RFC3168. */
void (*ecnpkt_handler)(struct cc_var *ccv);

STAILQ_ENTRY (cc_algo) entries;
};

Expand Down

0 comments on commit 8ad8794

Please sign in to comment.