Centre for Advanced Internet Architectures, Swinburne University of Technology, Melbourne, Australia CRICOS number 00111D 30th July, 2010 ---------------------------------------------- OVERVIEW ---------------------------------------------- The CAIA Khelp (pronounced "Kelp") framework v0.1.1 provides support for generic kernel modules known as "helpers" to hook into arbitrary points within the kernel and provide service(s) to the running system. Hook points must be defined at kernel compile time using the API provided in the hhooks.h file. Once hook points are established, a helper module can be loaded to utilise the hook points for some purpose. Kernel subsystems that export helper hooks can offer helpers the ability to associate private data with objects within that subsystem. This allows helpers to provide per-object or globally relevant services. The framework has the following goals: - To increase the speed at which proof of concept ideas can be implemented, tested and refined within the kernel for the purposes of research and exploratory programming. - To increase the flexibility of kernel subsystems by adding hooks that allow Khelp modules to be developed that augment runtime behaviour. - To minimise distrubances to the Kernel Binary Interface (KBI), which will ease the adoption of and transition to new features. A concrete example of the framework in action is given by the Enhanced Round Trip Time (ERTT) Khelp module, available from: http://caia.swin.edu.au/urp/newtcp/tools.html The ERTT Khelp module utilises helper hooks provided by the TCP stack and per-connection private data stored in the TCP control block to provide a better RTT estimation service to the TCP stack. This data is then accessible, via the Khelp framework API defined in helper.h, to things like congestion control algorithms, which consume this information to make better congestion management decisions. ---------------------------------------------- LICENCE ---------------------------------------------- The Khelp framework is released under a BSD licence. The code in the hhooks.c and hhooks.h files drew inspiration from the PFIL(9) framework. Refer to licence headers in each source file for further details. ---------------------------------------------- KNOWN LIMITATIONS ---------------------------------------------- Current known limitations of the Khelp framework and any relevant workarounds are outlined below: 1. The current framework was mostly a proof of concept implementation, with minimal attention paid to making it efficient. Data structures, locking and algorithms all need to be improved to make this a production ready framework. 2. Khelp modules that utilise data blocks are not able to be unloaded until all objects storing references to the helper's data have released that data. This is currently implemented by a simple reference count, which is incrememnted when init_helper_dblocks() is called by the kernel subsystem on an object, and decremented when destroy_helper_dblocks() is called on the same object. The approach should be made more flexible as it can be extremely difficult on a busy system to ensure that no objects have helper data blocks associated with them. 3. The framework provides no locking for accesses to individual helper data blocks. It is the producer's and consumer's responsibility to properly synchronise access to the data stored by a particular helper in its data block. This may (should?) change at a later date. 4. There is currently no documentation that exists for the framework other than the code itself. This will be rectified in subsequent releases. ---------------------------------------------- ACKNOWLEDGEMENTS ---------------------------------------------- This project has been made possible in part by a grant from the FreeBSD Foundation. ---------------------------------------------- RELATED READING ---------------------------------------------- This software was developed while studying at Swinburne University's Centre for Advanced Internet Architectures, under the umbrella of the NewTCP research project. More information on the project is available at: http://caia.swin.edu.au/urp/newtcp/ A number of software tools and technical reports related to experimental TCP research in general are available respectively at: http://caia.swin.edu.au/urp/newtcp/tools.html http://caia.swin.edu.au/urp/newtcp/papers.html At the time of writing, the following software tools may be of interest: Modular TCP Congestion Control for FreeBSD Enhanced Round Trip Time (ERTT) Khelp module Statistical Information For TCP Research (SIFTR) Deterministic Packet Discard (DPD) At the time of writing, the following reports/papers may be of interest: [1] is an introduction to FreeBSD kernel programming. ---------------------------------------------- REFERENCES ---------------------------------------------- [1] L. Stewart, J. Healy, "An Introduction to FreeBSD 6 Kernel Hacking", CAIA Technical Report 070622A, June 2007. ---------------------------------------------- AUTHORS ---------------------------------------------- The Khelp framework patch was first released in 2010 by Lawrence Stewart whilst studying at Swinburne University's Centre for Advanced Internet Architectures, Melbourne, Australia. The work is released as part of the NewTCP research project. Lawrence Stewart is currently the sole maintainer and all contact regarding the Khelp framework should be directed to him via email: lastewart@swin.edu.au