From owner-freebsd-transport@freebsd.org Mon Jul 10 14:25:20 2017 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A122EDA994A; Mon, 10 Jul 2017 14:25:20 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6351266965; Mon, 10 Jul 2017 14:25:19 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3C9E525D3857; Mon, 10 Jul 2017 14:25:17 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 6D5EED1F935; Mon, 10 Jul 2017 14:25:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id YMUWoVT2znfK; Mon, 10 Jul 2017 14:25:15 +0000 (UTC) Received: from [10.248.97.251] (unknown [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C6D9BD1F8E7; Mon, 10 Jul 2017 14:25:14 +0000 (UTC) From: "Bjoern A. Zeeb" To: "FreeBSD Net" , freebsd-transport@freebsd.org Subject: Remove flowtable from HEAD Date: Mon, 10 Jul 2017 14:25:13 +0000 Message-ID: <7D1D07E3-B3B7-49FB-842D-0CD952EE6DEE@lists.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; markup=markdown X-Mailer: MailMate (2.0BETAr6086) X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 14:25:20 -0000 Hi, I have a review pending to remove flowtable from head. Now is the time to speak up if, after the inpcb caching went in a while ago, you still have a good reason for it to stay in the tree. Also review would be highly appreciated :) https://reviews.freebsd.org/D11448 /bz From owner-freebsd-transport@freebsd.org Wed Jul 12 14:44:57 2017 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FCFD99366; Wed, 12 Jul 2017 14:44:57 +0000 (UTC) (envelope-from tj@enoti.me) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41BDB64F35; Wed, 12 Jul 2017 14:44:56 +0000 (UTC) (envelope-from tj@enoti.me) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6768D20816; Wed, 12 Jul 2017 10:36:53 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Wed, 12 Jul 2017 10:36:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=wwZcQDxcqLEPTTSwqOb1exWHVu4CMuyhcSJY/JYmA TE=; b=EEI7OTKiQ/xN47Gyo0MAryb4R4ObVESm5bMlrBOT526F0c1qslkJcHjWY T3E1ROV1WPtj9gez3fAaFBKTj+wcuFq+ecPh3DKCoqGOhZrK/9RXBjmp/Ky+H/GA at7UTBBTL/BuPH2EKWIdKDfmkJaQ88fAgigjib4UB2IORb9zDFTWv2fDJWZodwyN HXuqF5KBOT4rpCDf1VuxGDtR6ODnpmVTP91diBYyQWd2pf5/1IZ39lCqShkMUi0f tc9kbsLAuGUSusU5vVXsNe+bljWW7kwvxdQwaNahFbsIq9gewKYqhiyDHNnzJHD7 btq5dqTMXniLdmCnHT+CAFFTcNDaA== X-ME-Sender: X-Sasl-enc: h5mtpZvxTMI+SkkKmzY/I2V5Pbat8FpvsvV+kTVADDu5 1499870213 Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [139.133.204.4]) by mail.messagingengine.com (Postfix) with ESMTPA id D25E12424F; Wed, 12 Jul 2017 10:36:52 -0400 (EDT) Date: Wed, 12 Jul 2017 15:36:50 +0100 From: tj To: freebsd-transport@freebsd.org, freebsd-net@freebsd.org Subject: [patch] Add support for TCP ABE draft-khademi-tcpm-alternativebackoff-ecn Message-ID: <20170712143649.GD25989@tom-desk.erg.abdn.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) X-Mailman-Approved-At: Wed, 12 Jul 2017 15:53:21 +0000 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 14:44:57 -0000 This patch adds support Alternative Backoff ECN for TCP with the New Reno congestion control module. TCP ABE is described in https://tools.ietf.org/html/draft-khademi-tcpm-alternativebackoff-ecn-01 I have created a bug for this patch here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220677 ABE updates the TCP sender-side reaction to congestion notification received via Explicit Congestion Notifiction (ECN) marks. From the Abstract in the draft: The updated method reduces FlightSize in Congestion Avoidance by a smaller amount than the TCP reaction to loss. The intention is to achieve good throughput when the queue at the bottleneck is smaller than the bandwidth-delay-product of the connection. This is more likely when an Active Queue Management (AQM) mechanism has used ECN to CE-mark a packet, than when a packet was lost. This patch adds 3 new sysctl values, one to control the use of ABE and two new cc controls under net.inet.tcp.cc.newreno to control the loss and ecn response factors. These controls are intended to aid future experimentation and research in this area. net.inet.tcp.abe: Toggles whether a transport uses the new abe conditions. Currently only implemented for New Reno. net.inet.tcp.cc.newreno.beta_ecn: The factor used to change FlightSize in response to an ecn mark, defaults to 0.8 as described in the draft. net.inet.tcp.cc.newreno.beta_loss: The factor used to change FlightSize in response to a loss event, defaults to 0.5 as described in the draft. This patch is a port of the same functionality implemented by Naeem Khademi and is available here: http://heim.ifi.uio.no/~naeemk/research/ABE/diff-0d38090e881d-newrenoVB-7jan15.txt - [tj] From owner-freebsd-transport@freebsd.org Thu Jul 13 06:08:44 2017 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6217D9821A; Thu, 13 Jul 2017 06:08:44 +0000 (UTC) (envelope-from tj@enoti.me) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3EB668D0; Thu, 13 Jul 2017 06:08:43 +0000 (UTC) (envelope-from tj@enoti.me) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7AF272091A; Thu, 13 Jul 2017 02:08:42 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Thu, 13 Jul 2017 02:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=fdQ27DOmJsqBm9mfdT 1Lrn/cyOQQq9a7mu/vNzzGzxo=; b=TbvC1TB3homa88x7zbnpg+KiNRGDc9kEg6 vgUKLNSSWakYBP8vucX3QqgiIFsD4Q3UVvE8YOsYEHWQ28jKn0XrmQ7o5EF6StSg HCcRJzc+sLctIKxHmJcmXER4czupP6D5I9KH4CB0ravIvFkhMDKe8aYwiY0n5g1x 2kO4fCviKBoqsJfZjhFkvv8tG32Nm5pdMH5aKUExg3SAZ/HDh26t8k/JSIZqZdiJ m205QAVHuEqKAxdjDo5uW+4sfehFJLao7ss248E/jZmvVUP3T3YbzM2HQ9lCKEWg 31sRG4+q7YrYNN0/D+K7BcyVs4/mjUQuRA+B8mc6B1jy/rmON6CQ== X-ME-Sender: X-Sasl-enc: hEvhmBqeKCxLzdDR0F7boWeTYMgXXRRApc2EaWlEb/0a 1499926122 Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [139.133.204.4]) by mail.messagingengine.com (Postfix) with ESMTPA id E7C4B242CE; Thu, 13 Jul 2017 02:08:41 -0400 (EDT) Date: Thu, 13 Jul 2017 07:08:40 +0100 From: tj To: freebsd-transport@freebsd.org, freebsd-net@freebsd.org Subject: Re: [patch] Add support for TCP ABE draft-khademi-tcpm-alternativebackoff-ecn Message-ID: <20170713060839.GB30194@tom-desk.erg.abdn.ac.uk> References: <20170712143649.GD25989@tom-desk.erg.abdn.ac.uk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20170712143649.GD25989@tom-desk.erg.abdn.ac.uk> User-Agent: Mutt/1.8.3 (2017-05-23) X-Mailman-Approved-At: Thu, 13 Jul 2017 11:32:59 +0000 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 06:08:44 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > This patch is a port of the same functionality implemented by Naeem Khademi and > is available here: > http://heim.ifi.uio.no/~naeemk/research/ABE/diff-0d38090e881d-newrenoVB-7jan15.txt Pointed out offline, the early work was done by Grenville Armitage garmitage@swin.edu.au and not Naeem. I have also included the patch which is attached to the bug here inline. - [tj] --5vNYLRcllDrimb99 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="abe.diff" diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 392a2f21cd8..5dbf84a0eed 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -68,11 +68,23 @@ __FBSDID("$FreeBSD$"); #include #include +#define CAST_PTR_INT(X) (*((int*)(X))) + +#ifndef VIMAGE +#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ + sysctl_handle_int(oidp, arg1, arg2, req) +#endif + static void newreno_ack_received(struct cc_var *ccv, uint16_t type); static void newreno_after_idle(struct cc_var *ccv); static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); static void newreno_post_recovery(struct cc_var *ccv); +static VNET_DEFINE(uint32_t, newreno_beta_loss) = 50; +static VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; +#define V_newreno_beta_loss VNET(newreno_beta_loss) +#define V_newreno_beta_ecn VNET(newreno_beta_ecn) + struct cc_algo newreno_cc_algo = { .name = "newreno", .ack_received = newreno_ack_received, @@ -195,10 +207,14 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) KASSERT((type & CC_SIGPRIVMASK) == 0, ("%s: congestion signal type 0x%08x is private\n", __func__, type)); - cwin = max(cwin / 2 / mss, 2) * mss; switch (type) { case CC_NDUPACK: + if (V_tcp_do_abe) + cwin = max((cwin * V_newreno_beta_loss)/100 / mss, 2) * mss; + else + cwin = max(cwin / 2 / mss, 2) * mss; + if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { CCV(ccv, snd_ssthresh) = ssthresh_on_loss; @@ -208,6 +224,11 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) } break; case CC_ECN: + if (V_tcp_do_abe) + cwin = max((cwin * V_newreno_beta_ecn)/100 / mss, 2) * mss; + else + cwin = max(cwin / 2 / mss, 2) * mss; + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { CCV(ccv, snd_ssthresh) = ssthresh_on_loss; CCV(ccv, snd_cwnd) = cwin; @@ -252,5 +273,28 @@ newreno_post_recovery(struct cc_var *ccv) } } +static int +newreno_beta_handler(SYSCTL_HANDLER_ARGS) +{ + if (req->newptr != NULL && + (CAST_PTR_INT(req->newptr) <= 0 || CAST_PTR_INT(req->newptr) > 100)) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +SYSCTL_DECL(_net_inet_tcp_cc_newreno); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno, CTLFLAG_RW, NULL, + "New Reno related settings"); + +SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_loss, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(newreno_beta_loss), 3, &newreno_beta_handler, "IU", + "newreno beta loss, specified as number between 0 and 100"); + +SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_ecn, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(newreno_beta_ecn), 3, &newreno_beta_handler, "IU", + "newreno beta ecn, specified as number between 0 and 100"); DECLARE_CC_MODULE(newreno, &newreno_cc_algo); diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 15e5afffc48..40c0f638ff5 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -181,6 +181,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); +VNET_DEFINE(int, tcp_do_abe) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, abe, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_do_abe), 0, + "Enable ABE for NewReno (Alternative Backoff with ECN)"); + static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); VNET_DEFINE(int, tcp_do_ecn) = 2; diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index d298c9dd6c6..f59c67f294a 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -708,6 +708,7 @@ VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(int, tcp_do_abe); #define V_tcb VNET(tcb) #define V_tcbinfo VNET(tcbinfo) #define V_tcp_mssdflt VNET(tcp_mssdflt) @@ -720,6 +721,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_do_abe VNET(tcp_do_abe) VNET_DECLARE(int, tcp_do_sack); /* SACK enabled/disabled */ VNET_DECLARE(int, tcp_sc_rst_sock_fail); /* RST on sock alloc failure */ --5vNYLRcllDrimb99--