Software developed for the Network Simulation Cradle project

During the development of NSC many small programs were created to help with various activities from analysing data to performing measurements on real networks. Most are fairly simple, have no documentation, and may have had little testing.

simd

Simulation daemon program that manages replications of simulation jobs with ns-2. I use it for all my personal simulations, it has used up to 100 client machines on a scenario that took weeks to simulate in the past.

Version 1029: Initial release. Download v1029 - View README - Download web frontend v1036

heapprof

Simple memory leak debugger/heap profiler. Can produce output that looks like the graph Massif (a Vangrind tool) makes, but with a fraction of the overhead. Can also show memory leak information. Or just state the peak heap usage for a process.

Version 1.0: Initial release. Download heapprof

tcpperf

tcpperf is a small utility that can be used somewhat like iperf. It was designed to be very simple so it could be exactly modelled in simulation: this allowed for accurate testing and validation. Chances are something like iperf should be used instead; it is highly doubtful this is useful to anybody. tcpperf has been tested in FreeBSD 5 and Linux 2.4. Example usage follows:


machine1 # tcpperf

machine2 # tcpperf -c machine1 -t 30
Duration: 30 26339usec
Bytes sent: 5267456 (5144 kB 5 MB 0 GB)
Bandwdith: 1403423 b/s (1403.42 kb/s 1.40 Mb/s)
Close duration: 0s 40usec

Version 1.754 adds some minor fixes and prints statistics on the receiving end as well.

Version 1.503 adds license, fixes the typo shown in the example usage above, and adds the abiltity to specify socket buffer size.

Download version 1.754

Download version 1.503

Download source file

tcpnorm

tcpnorm is designed to normalise a pcap packet trace containing one TCP connection. It works on simple packet traces but seems very easy to break. The process of normalising involves changing the time stamp of each packet as well as changing acknowledgement and sequence numbers: all start at 0.

Version 1.737 adds support for normalising multiple TCP streams in one packet trace, understands MPLS and is now written in C++. It has also been tested using g++ 3.4 on a newer version of Linux.

Version 1.502 is a cleaned up release that fixes SACK normalisation and now understands stdin/stdout as input/output, uses getopt, and has version information.

As of version 0.1.4 it normalises SACK blocks and TCP timestamps. It may have had buggy ack normalisation in version 0.1.2. This is fixed in 0.1.4.

Download source tar for version 1.737

Download source tar for version 1.502

Download source tar for version 0.1.4

Download source tar for version 0.1.2

Memory Leak Debugger/SSS

During the development of NSC various problems were encountered with memory leaks. At the time NSC only ran in FreeBSD, and the excellent memory debugger Valgrind was not ported to FreeBSD. These days I'd advise using Valgrind over this memory leak checker any day. However, it is faster than Valgrind and ran on code Electric Fence failed to work with.

It works by replacing the libc malloc and free implementations by putting a shared library in the LD_PRELOAD environment variable. When the program finishes it ouputs the addresses of the top three functions on the call stack at the time of memory allocation and the size of the block leaked. Sample output looks like this:


0x8208823 0x81b3c86 0x81f828a : 32
0x8224f3b 0x820b97c 0x820b94c : 128
0x8224f3b 0x821834e 0x8268045 : 448

This can then be processed using addr2line and a simple Python script to the following:


TclpAlloc(??:0) Tcl_Alloc(??:0) NewVar(??:0) : 32
new_malloc(support/malloc.c:38) cblock_alloc_cblocks(kern/tty_subr.c:135)
    clist_init(kern/tty_subr.c:89) : 128
new_malloc(support/malloc.c:38) nd6_ifattach(netinet6/nd6.c:172)
    in6_update_ifa(netinet6/in6.c:1139) : 448

This simple version only works on C++ executables.

Download source tar

This software was created with Perry Lorier and he updated it to work on Linux and have several improvements which makes it quite useful. The output is quite verbose though, so beware!

This version works with C executables and has some basic documentation. Though we have yet to figure out why it was called SSS. Example output of SSS follows:


Memory Leaks:
=============

Leaked: 16384 bytes
00: [0x2822af06] /lib/libc.so.5(__smakebuf)
01: [0x2822ae7d] /lib/libc.so.5(__swsetup)
02: [0x2822113a] /lib/libc.so.5(__vfprintf)
03: [0x282210a6] /lib/libc.so.5(vfprintf)
04: [0x2820db62] /lib/libc.so.5(printf)
05: [main[/home/stj2/stj2/420/sss-0.1/sieve.c:9]] ./sieve(_init)
06: [_start[??:0]] ./sieve(_init)
07: [0x1] ???

Leaked: 1024 bytes
00: [main[/home/stj2/stj2/420/sss-0.1/sieve.c:6]] ./sieve(_init)
01: [_start[??:0]] ./sieve(_init)
02: [0x1] ???

Maximum memory allocated: 17408 bytes
Total memory allocated: 17408 bytes
Total Leaked: 17408 bytes

Download source tar

Acronyms for Markdown

During development for this site I wanted automatic acronym support somewhat like what Textile offers in Markdown. So I added some minor modifications to the Perl script to allow defining of acronyms.

The following:


TCP(Transmission Control Protocol) is an acronym. That's right, TCP is an
acronym.

Is converted to:


<acronym title="Transmission Control Protocol">TCP</acronym> is an acronym.
That's right, <acronym title="Transmission Control Protocol">TCP</acronym> is
an acronym.

Download patch for Markdown 1.0fc1