netreg-devel: NetMon DHCP Lease Archiving

Jason Schulz js4450 at albany.edu
Tue Mar 7 13:26:36 EST 2006


Hey guys,

I was recently given a design spec for a mechanism to coalesce overlapping
leases, and I thought I'd let everyone know the code is written in case
anyone is interested.

I implemented the mechanism as a custom archive_dhcp function, instead of
just having it run std_archiver.  It will go through leases in the capture
table and combine overlapping leases into one lease (keyed by MAC and IP
addresses, and type), which is then merged into the archive table.  If
there is any overlap between entries in the archive table, considering the
entries from the capture table, they are also coalesced, deleting any merged
leases from the archive table.

To give an idea of how much space this can save, our dhcp_leases table was
about 1.4GB before running the archiver, and the resulting
dhcp_leases_archive table took up about 60MB (leaving 2 days worth of
data in dhcp_leases).

It is lossy compression since you loose the lease renewal times, but if
you're tight on space, this should be a big help.  If anyone is
interested, I've also written a script to step through the capture table,
and archive its data one day at a time (to prevent the archiver from
gorging itself on memory).  I also have a script to verify the compression
algorithm for maintenance purposes if anyone wants to modify the code.

Finally, I was curious if there were any possibility of merging the DHCP
capture engine I designed into the official NetMon distribution.  If it is
possible, what work would need to be done?

-Jason


More information about the Netreg-devel mailing list