Monitoring internet traffic usage

A month ago, I got into a dispute with my Internet Service Provider (ISP). I would not go into the boring details of what transpired; suffice to say It ended with my ISP telling me to shove off. As a result of that, I found the need to monitor my internet bandwidth usage (specifically, a 3G mobile broadband connection).

In addition, I am expecting to be travelling to another country at the end of January. To decide whether I should risk using an expensive mobile broadband roaming service while overseas, I would like to get a feel of how much data was being downloading / uploading in a normal daily usage.

Network set-up

The network I would like to monitor is not quite the usual kind. I supposed if you have a home local network, the internet traffic usage would have to be tracked by the router/gateway.

However in my case, I would only track the usage of a 3G mobile broadband dial-up. My connection was via a Bluetooth adaptor to a mobilephone (which function as the dial-up modem). In this scenario, the network device appeared as “ppp0″.

vnstat

vnstat is a command line network traffic monitor. To install:

sudo apt-get install vnstat

After install, I need to create the statistic database for “ppp0″:

sudo vnstat -u -i ppp0

That’s it, simple as that. The traffic monitoring is now enabled and I could check the daily usage by:

vnstat -d

Typical daily usage

Here is the record for Dec 2008:

$ vnstat -d

 ppp0 [disabled]  /  daily

  day       rx     |    tx     | total

 05.12.  371.34 MB |  11.30 MB | 382.64 MB  %%%%%%%%%%%%%%%%%%%:
 08.12.   10.12 MB |   1.26 MB |  11.38 MB
 09.12.  351.18 MB |  13.81 MB | 364.99 MB  %%%%%%%%%%%%%%%%%%:
 10.12.  374.52 MB |   9.63 MB | 384.15 MB  %%%%%%%%%%%%%%%%%%%:
 11.12.  391.71 MB |  11.17 MB | 402.88 MB  %%%%%%%%%%%%%%%%%%%%:
 12.12.  449.74 MB |  14.29 MB | 464.03 MB  %%%%%%%%%%%%%%%%%%%%%%%%:
 13.12.  293.59 MB |   6.68 MB | 300.27 MB  %%%%%%%%%%%%%%%%
 15.12.  418.45 MB |   9.98 MB | 428.43 MB  %%%%%%%%%%%%%%%%%%%%%%:
 16.12.   19.00 MB |   5.28 MB |  24.28 MB  %
 17.12.    8.93 MB |   4.39 MB |  13.32 MB
 18.12.   18.37 MB |   2.77 MB |  21.14 MB  %
 20.12.   28.59 MB |   4.17 MB |  32.77 MB  %
 22.12.    7.77 MB |   2.30 MB |  10.07 MB
 24.12.    4.48 MB |   1.51 MB |   5.99 MB
 28.12.  401.87 MB |  10.14 MB | 412.01 MB  %%%%%%%%%%%%%%%%%%%%%:

estimated   437 MB |     10 MB |    447 MB

Noticed the two usage patterns. The first pattern of up to about 30MB, was my normal daily usage. This involved activities such as checking email, keeping the IM client connected, reading my RSS feeds (through Google Reader), surfing the internet websites and updating my blog. I avoided large file downloads, and Ubuntu package upgrades.

Incidentally, this traffic usage tells me I should be very careful when using mobile broadband roaming, else I would be slapped with astronomical charges. I am currently looking for an alternative internet access in the destination country, but it doesn’t look promising. Otherwise, it looks like I would have to deal with withdrawals from internet addiction. :P

Sticking it to the man!

The second usage pattern was my childish revenge against the ISP. Noticed the large traffic usage of a few hundreds MB. My 3G mobile broadband has a bandwidth cap of 50GB a month, beyond which, the overlimit charge would broke the bank. However, below 50GB, it’s “free”.

If I stick to normal daily usage, I would not ever come close to making the limit. But I downloaded some large Google videos to pump up the traffic.

The absurdity of December bill:

Bill

More than 3GB usage or $18,000. But it’s not chargeable, so technically I saved thousands. Was it worth it? I am sure it all for nothing, but hey, I got the childish satisfaction for sticking it to the man! :)

Post a Comment

Your email is never published nor shared. Required fields are marked *