Scripts for analysing IPv6 addresses

Here are some perl/shell/gnuplot scripts and instructions for analysing IPv6 addresses that was used in this paper. The code processes web logs and spits out various summaries. The scripts were written for my consumption, so they could do with some cleaning up.

The basic steps for running the scripts are below. Some of the code is based on IANA lists, and may be a little out of date. I can update it if anyone is interested.

  1. Grab process.pl and summary2bar.pl.
  2. Set up some workspace:
    mkdir work
    cd work
    echo 'return 1; # you can put v4 summary here' > v4summary_generic.pl
    mkdir results
    
  3. Run HTTP logs through the script:
    gzcat /var/log/httpd-log* | process.pl > summary
    
    Note, the script expects only lines with IPv6 addresses - it will skip other lines, but give a warning.
  4. Have a look at the summary file. Classifications of each address seen are in individual files in the results directory. You can generate the bar graphs using:
    summary2bar.pl summary
    
    This produces config files for Derek Bruening's bar graph's for gnuplot. If you grab his bargraph.pl file you can produce eps files by doing:
    for i in *.bar ; do
      bargraph.pl $i > `echo $i | sed -e s/.bar/.eps/`
    done
    
    You can give the "-png" flag to the bargraph.pl script if you want png files instead. If you get warnings like "WARNING: unexpected, unknown-format line" you can probably ignore them, or use this patch to bargraph.pl.

There's also my gnuplot script for the HEAnet results.

Sample bargraph

A sample bargraph generated by these scripts.