What Zypher was saying about rrdtool (and anything else that uses it as a backend - MRTG, Cacti etc) is probably correct. RRDTool is designed to be an 'averaged' historical trending analysis tool. It averages and stores counters in increasingly non-resolute increments increments the further back in time it goes.
This is, however, configurable by setting up the RRAs approriately. I confess to knowing absolutely nothing about configuring these, however, and have never personally had luck getting them right beyond my standard set (15 minutes, 8 hours, 1 week, 1 month, 1 year). I would recommend looking into configuring the RRAs to expect daily input and feed it your bandwidth counter from netstat. You'll get some very nice historical data and insight into your usage patterns.
To answer your current problem, about making sure you don't exceed a daily bandwidth limit; I would recommend grabbing the netstat counters daily for the interface in question. You can compare yesterday's traffic at time t with today's counters at time t and find out how much was transferred. A simple script with a flat text-file storage of the previous value would probably suffice. You could then disable the interface if you detect exceeded bandwidth or monitor it throughout the day and notify an admin if you are approaching your limit.
To get the input bytes on an OSX system you can use the following set of commands:
netstat -ib | grep -e "$INTERFACE" -m 1 | awk '{print $7}'
Conversely, output can be obtained with:
netstat -ib | grep -e "$INTERFACE" -m 1 | awk '{print $10}'
You could pop the relevant counters into a flat file stored somewhere and compare it with:
#!/bin/bash
set -e # exit if any error occurs
previous_days_bytes_xferred=`cat $flatfile_storage`
todays_bytes_xferred=`netstat -ib | grep -e "$INTERFACE" -m 1 | awk '{print $10}'`
if [ $((todays_bytes_xferred - previous_days_bytes_xferred)) -gt $threshold ]; then
DO SOME STUFF
fi
echo $todays_bytes_xferred > $flatfile_storage
Just adjust the netstat processing to match your system (since I know you're not running OSX).
Yes, iPerf can easily max out even Gb connections. The example above by mkudlacek is, in fact, a maxed out connection, minus losses to TCP overhead.
------------------------------------------------------------
Client connecting to proton.cw, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.2.0.16 port 40045 connected with 10.2.0.2 port 5001
[ 3] 0.0-10.0 sec 1.09 GBytes 940 Mbits/sec
Best Answer
Use ping. You can script it to run random floods, and do all kinda of cool stuff. I'm not a MacOS expert but I'm pretty sure it is very similar to the Linux CLI options...
So to push the ports to the link speed limit run a flood ping (note must be root to do this, I'm running mine for 100,000 packets here):
$ping -f -c 100000 <destination IP>