From owner-freebsd-net@FreeBSD.ORG Tue Apr 21 00:05:56 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61504FCB for ; Tue, 21 Apr 2015 00:05:56 +0000 (UTC) Received: from gpo2.cc.swin.edu.au (gpo2.cc.swin.edu.au [136.186.1.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0EEF9CC for ; Tue, 21 Apr 2015 00:05:55 +0000 (UTC) Received: from [136.186.229.37] (garmitage.caia.swin.edu.au [136.186.229.37]) by gpo2.cc.swin.edu.au (8.14.3/8.14.3) with ESMTP id t3L05pGL030439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Apr 2015 10:05:53 +1000 Message-ID: <5535945F.90504@swin.edu.au> Date: Tue, 21 Apr 2015 10:05:51 +1000 From: grenville armitage User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121107 Thunderbird/16.0.2 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: Congestion Control Modification References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 00:05:56 -0000 Hi, On 04/18/2015 16:59, Karlis Laivins wrote: > Hello, > > I have read an interesting publication about a proposed modification of TCP > Congestion Control algorithm that would allow to improve it (the CC) by > dynamic bandwidth estimation. The idea seems so interesting that I would > like to try to implement it by modifying the NewReno code. > > Do I understand correctly that to do the above stated, I would create a > copy of source file (in my case - cc_newreno.c) located in /usr/src/sys/ > and rename it to, for example, cc_newreno_test.c and make changes to it? > How would I then compile it, and how would I create a newreno_test.ko file > that can be loaded into Kernel and tested? > > Thank you in advance for your answers! In case this helps shed some (probably incomplete) light, here are the steps I took late last year to make a modified version of NewReno: I start with copying the newreno module under sys/netinet/cc/cc_newreno.c as a template. The new source file will be called newrenoVarBeta.c /usr/src/sys/netinet/cc % cp cc_newreno.c cc_newrenoVarBeta.c /usr/src/sys/netinet/cc % Then create a modules definition based on /usr/src/sys/modules/cc/cc_cubic (because there isn't one for newreno per se) /usr/src/sys/netinet/cc % cd /usr/src/sys/modules/cc /usr/src/sys/modules/cc % mkdir cc_newrenoVarBeta /usr/src/sys/modules/cc % cp cc_cubic/Makefile cc_newrenoVarBeta/ /usr/src/sys/modules/cc % Tweak the cc_newrenoVarBeta/Makefile to say: KMOD= cc_newrenoVarBeta SRCS= cc_newrenoVarBeta.c Made my changes to cc_newrenoVarBeta.c (including changing the module's name from 'newreno' to something else) Then built/installed the new module with: /usr/src/sys/netinet/cc % cd /usr/src/sys/modules/cc/cc_newrenoVarBeta /usr/src/sys/modules/cc % make clean && make && make install [..build and install output..] /usr/src/sys/modules/cc % All being well, cc_newrenoVarBeta.ko should now exist under /boot/kernel Then use 'kldload cc_newrenoVarBeta.ko' to load your new CC algorithm If all goes well, your new module will appear (with whatever name you gave it) in the sysctl net.inet.tcp.cc.available list. Don't forget to actually select your new module with sysctl net.inet.tcp.cc.algorithm when running experiments. cheers, gja