Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 2015 07:30:30 +0300
From:      Karlis Laivins <karlis.laivins@gmail.com>
To:        grenville armitage <garmitage@swin.edu.au>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Congestion Control Modification
Message-ID:  <CAF4H_7nOJP=Wy7LJSBi2PGupnMMvZu0xYeT2iYjhKDg-DPC6fw@mail.gmail.com>
In-Reply-To: <5535945F.90504@swin.edu.au>
References:  <CAF4H_7mSGp_GZGaDBx8xq47FY1j85xLHq%2BZY1jMzprbzp%2Bg9zw@mail.gmail.com> <5535945F.90504@swin.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Thank you very much for such a comprehensive description of how to properly
create a loadable Kernel module, this does the trick - I was able to create
the module successfully, load it into Kernel and set it as the congestion
control algorithm used via sysctl net.inet.tcp.cc.algorithm=new (new - the
name of my test module).

Best Regards,
Karlis

On Tue, Apr 21, 2015 at 3:05 AM, grenville armitage <garmitage@swin.edu.au>
wrote:

> 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
>
>
>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF4H_7nOJP=Wy7LJSBi2PGupnMMvZu0xYeT2iYjhKDg-DPC6fw>