James Healy and Lawrence Stewart
Centre for Advanced Internet Architectures,
Swinburne University of Technology,
Melbourne, Australia
CRICOS number 00111D
22nd June, 2007
-----------------------
OVERVIEW
-----------------------
SIFTR_cdev is a prototype FreeBSD 6.2 kernel module that exposes basic stats on active TCP
connections to user space via a character device in /dev. Once the module is loaded into
the kernel, the stats can be viewed by typing "cat /dev/tcpstats".
To help with logging the stats to disk, there is a small logging app distributed along
with the module that will save the stats to disk at regular intervals, without maxing out
the CPU like using cat does.
Note: Being a prototype, this code was only minimally tested on FreeBSD 6.2-RELEASE.
It may have undocumented bugs that we are unaware of, which could potentially
crash your system. Please use with care.
It may well run on other FreeBSD versions as well, but we make no guarantees.
-----------------------
USAGE
-----------------------
Make sure you have the FreeBSD system sources installed under /usr/src
These can be installed using sysinstall if they are not currently installed.
To build the module, simply run:
make
To load the compiled module into the running kernel, run the following command as root:
kldload ./siftr_cdev.ko
To unload the module from the running kernel, run the following as root:
kldunload siftr_cdev
To build the logging app, run:
make siftr_cdev_logger
To run the logging app with the default polling interval of 50ms and logging
to ./tcpstats.log, use:
./siftr_cdev_logger -o tcpstats.log
To run the logging app with a user defined sample time of 1sec and logging
to ./tcpstats.log, use:
./siftr_cdev_logger -o tcpstats.log -s 1000000
To delete all artifacts created by compiling the module and logging app, run:
make clean
-----------------------
LICENCE
-----------------------
This code is released under a BSD licence.
Refer to licence headers in each file for further details.
-----------------------
RELATED READING
-----------------------
This software was developed as part of the NewTCP research project at
Swinburne University's Centre for Advanced Internet Architectures.
More information on the project is available at http://caia.swin.edu.au/urp/newtcp/.
An accompanying tech report on FreeBSD kernel hacking, which covers a range of issues, many of which
are relevant to the filewriter code. The report is titled "An Introduction to FreeBSD 6 Kernel Hacking"
and has been released as CAIA technical report 070622A.