How to measur total Monthly internet traffic on machine.

Hi,

My problem, and I am sure the problem of many more, is the following one:
My ADSL account has a cap limit above which the price becames astronomical!

That means I must control how much data I have exchanged with machines Outside my LAN (internet traffic).

I need a Command Line program to make this calculation.
I also looked at the output of netstat -s but this gives total packets since first PC boot. I am right on this?
Also How can I know the packet size ?

I also have looked for something like vnStat … this is a already a great help.
But something morespecific would be great … if someone knows how to do it it would be even better.

Regards,
Pedro

I can put you in the right direction but you’ll have to google a bit more have a look at

cat /proc/net/dev you have plenty of things in /proc/net exactly what and whether the one I pointed to is exactly right I can’t answer.

You’re going to have to collect that info and parse it to a file on shutdown. As for when/where not got a clue but there is a shutdown /etc/sysconfig/shutdown which seems to have a place for a hook. Hopefully you still have that info at that point.

Edit
Also have some bits when you iptable -L -n -v which gives you packets and bytes for each chain.

Hi
Is your DSL router bridged and your connecting direct to the internet
with the PC, or is your router performing the connection? If it’s your
router, then does it have snmp capability? If it your PC, then obtain
the data via snmp by installing net-snmp.

Else, if your ISP has a data counter, then it’s best to use this and
err on the side of caution.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 (i586) Kernel 2.6.27.21-0.1-pae
up 4:22, 1 user, load average: 0.39, 0.15, 0.16
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Hi,

I had exactly your thought, use the modem/router.
But that is a big problem.
The modem is a Thomsom ST 516 V6 but the firmware is highly customized by the provider (Vodafone).
I googled the net in order to know how it was possible to access the modem snmp capabilities, to no avail.
The installed firmware does not allow it, or at least I see no way to access the modem in order to make that possible, which would be the ideal situation as I have several machines on my lan.
The isp uses a very sophisticated EthoA (yup folks Ethernet over ATM, **** fast!) so I can not even configure it to became bridge only as my Asus w500gl does not support EthoA protocol …
That would be very good!
But even that would be difficult as I see no option in the web interface to change the operation mode of the modem … good friends … Vodafone is all about as close as you can get … note: the other ISP’s are all alike …

So I really have to stick to measure the most “internet-intensive” (aka p2p machine :slight_smile: ) machine I have around, a OpenSuSE 11.1 box.

I would not be asking for a command line program if it was not for that reason …

No go … not with this modem.

Else, if your ISP has a data counter, then it’s best to use this and
err on the side of caution.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 (i586) Kernel 2.6.27.21-0.1-pae
up 4:22, 1 user, load average: 0.39, 0.15, 0.16
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Yup, that is problem number one!

The isp does not have a counter available.
I think this is because it may be more difficult to implement on a EthoA network as the modem IP change a lot … (this is just me guessing)

And the Thonsom st 516 V6 web interface is always reseting the transfered data, so after a day or so it becames zero again.

I also thought about making a program to access the web page of the modem, and them reading the the data transfered and always adding that data to a database record …

This way the cumulative data would be present by adding the overall data collected in the specified time period …

Well … it is a beginning …

the problem are the "losses " if many resets are done between countings …

Regards,
Pedro

Hi
Very familiar with atm dsl… :wink:

Have you tried to telnet to the device? Can you run nmap to your
gateway address to see what ports are open?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 (i586) Kernel 2.6.27.21-0.1-pae
up 10:37, 2 users, load average: 0.09, 0.09, 0.07
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Hi Malcolm,

Yup, tried to telnet but the admim password is nothing obvious. And it is no where around so …
Today I phoned a tech rep to ask for that “small” detail of the password.
Answer … I do not know. I can send you and email with the password but then we will not take responsibility over the modem and if something happens with your setup we will not exchange bla bla bla … you guys figure out the stuff.
I thought this was something of the past but … sometimes we all get bad surprises …

About nmap Malcolm … humm … cof cof … How can I say this to all watching eagerly this forum … the thing with OpenSuSE and Linux is the outstanding ability to adapt … so the first thing I do when I install a new OpenSuSE box is to put on the disk my favorite Virtual Machines.
I use VMWare Server (free) and several images made from iso’s or even from VMWare’s own VMWare converter … neat, very neat.
One of those VM is …
you guess it !

→ Back Track Linux … 8) …

Remote-Exploit.org - Supplying offensive security products to the world

For those in the security business … well the name says it all … just go to the link download the VMWare image (check the sig or md5 hash :slight_smile: … and you get your hands in a massively cool hacking distro … and for those who get caught … doing it… you can alway wipe out your vm from disk … 8) … clean the evidences 8) …
tss tss … There I go again wondering absurdities …

I used some tools but with no promising results … the thing is really tight … dumb modem! And quite frankly, I do not wish to waste more time on it.

The web interface contains a place to change the admin password … as soon as I get the passwd … I go in.

Anyway … if for some reason I feel :slight_smile: fear, uncertanty or doubt :slight_smile: … I will make a program in the other Linux box, that arrived two weeks and I am using now, to check the web page of the modem and retrieve the transfered data back to the local Mysql Database. Some code will be necessary to make sense of how much data is indeed transfered, but it will be no problem.

Oh, and this Very Small box is simply: The_Ultimate peer to peer Weapon for the net today, check this out:
eXcito | Your files anywhere, anytime… run at 9W (Maximum) energy consumption of pure peer to peer power … (check Bubba 2 on the site) … and it looks super cool … enough said …

Regards,
Pedro

If the ISP is charging you for excess usage, then surely they know how much you have used.

I would think that if your ISP has excess usage charges or shaping, then it’s the law that they should show the customer how much the customer has used, otherwise who is to say the ISP didn’t make up a number and bill you at the end of the month. Or do you not have consumer protection laws like that in your country?

Malcolm has already given you some suggestions, eth stats, iptable chain stats and so forth. Ideally you should do this at your gateway, otherwise LAN traffic gets counted in eth stats.

Hi,

Of course they know Ken.
The limit is 250GB, they just do not show that to the customer for a reason I will explain bellow. I was just mentioning that obtaining this value and making it available for every customer is a big application … ip change all the time multiple accesses … that stuff …
But that is in my opinion illegal.
But in the country where I live this is usually not a problem for big companies …

I would think that if your ISP has excess usage charges or shaping, then it’s the law that they should show the customer how much the customer has used, otherwise who is to say the ISP didn’t make up a number and bill you at the end of the month. Or do you not have consumer protection laws like that in your country?

Ken, you do not imagine how Stupid a Judge can be when the issue is technology related! How slow and costfull a court process can be and usually how pointless court sentences are as Judges systematically favour the big enterpries. (Specially this last issue).
Trust me on that one.
I once went to court against another isp (my former isp) because, although I did never surpassed the limit, they all make an even bigger illegality:
They charge you a fixed monthly amount. And that amount has a data (byte) limit, a cap.
If you do not use that cap they Reset the limit counter on the next Month!

The Law Clearly States that every good or service Must be charged Just for the amount used or served to the customer.
Usually this is the same in every country and it kind of is a long rational point on the exchanges in the market economy for countless Centuries.
If you fill you car with 1.5L of fuel the teller at the gas station is not going to charge you 2L or 5L. Same for every thing else.

Well guess what: ISP’s Do Not comply with this rule …

They charge you 250GB /Month and no matter if you use that or not they will reset the 250GB USAGE to the same cap next month!

There can be only two Legal scenarios for invoicing this:
Option One:
Either they return the money payed for the unused data … (this is the reason why they do Not show How much you have used … get it … subtil isn’t it … )

Or

Option two: Next Month limit grows by the Total Amount not used on the previous Months … (that stuff is already payed for! )

The thing is, my invoice shows the detailed excess usage … but only After day 14 of March … and that amounts to 156GB above the limit of 250GB in the Month of March.

There is No Record whatsoever of usage Before the 14 of March they claim to be the day where the cap of 250GB was surpassed.

All ISP’s around here charge a fixed amount of money for a limited amount of data transfer, and they all resort to this dirty trick to Rob their Customers.

Nobody does nothing, there is even a State Department to deal with telecommunications regulation and customer complaints and they do nothing even After systematically warned …
My court sentence was, and I tell this to every one for a good laugh has that is ridiculous: → The ISP part won the case and his customer is proceeding according to the law because, and I quote: “Mr … had other choices of internet access other then the service selected” …

Suffice to say that for this Judge the basic process of the Law is unknown:
Meaning: Someone points a gun to somebody and tell him/her to enter the car or get shot, they refuse to do so, victim gets a bullet. Court decision: the victim had the possibility to enter the car, which is legal, and not get shot … therefore the process is correct … no harm done.

Or: Someone sells cars, all of them do not even start the engines: Customer complaints about car not working … court rule: customer had the option to choose another car … all legal there!

Amazing!

Malcolm has already given you some suggestions, eth stats, iptable chain stats and so forth. Ideally you should do this at your gateway, otherwise LAN traffic gets counted in eth stats.

Yeah. I know. He’s been helpful. Great ideas there. But this issue for me is outstanding disturbing Ken. Like I told you, I once went to court against the major ISP in here …
I think I can manage to just read the values on the web interface of the modem. And the excito hdd will keep the data.
Hence the value obtained will approximate to a very high degree of accuracy the actual internet usage.

Regards,
Pedro

Sorry to hear that the law is not on your side where you live. It sounds like a sucky situation. Hope your idea works out.

and that amounts to 156GB above the limit of 250GB

That’s a serious under estimation on your part. Surely even a mental track couldn’t get it that wrong?

250GB is a fair amount. I have a 30GB peak time limit which is plenty for me, otherwise Unlimited. But usually this ISP business is more down to terms and conditions and not so much the law or what seems right or wrong.

Maybe that’s the situation for the OP, but it’s still against consumer law, at least where I live, and hopefully where you live also.

An ISP feed is a service, like other services. Imagine getting into a taxi and the driver says, sorry you can’t view the meter. I’ll tell you at the end of the trip how much you have to pay. And the court says, oh stop complaining and go get another taxi. But all the taxis do the same thing because there’s no law to stop this practice. I’d be up in arms at that, and so should you.

Yes. Well I get a full graphical display of my usage in real time from my ISP. But there are still some ISP’s trying to make a mock of consumer protection laws here in the UK. Many consumers have no idea of their rights.
Fortunately I’m very happy at my end. Many ISP’s here throttle Bittorrent and put high users in a restricted pipe. But very few get the speed they think they will get. Most Broadband here is still on the old BT exchange and is mostly ADSL upto 8mb/s (800k actually). But you need to be close to an exchange to get that, happily I am. many buy what they think will be 8mb but they might only get 2mb if they are lucky.

Hi,

I am not complaining about the value.
I knew this was going to happen has I made some home Backups of servers in data-centers (one of the servers is closed to you … in UK :). So when there is a server change a lot of Traffic comes down the line … usually I do this near the end of the month in order to take advantage of the 250GB limit.
This time it was not possible.
I actually changed for this ADSL system has the other option ISP’s give is a complete scam, they charge access by time !!! (do not even try to comment this… it is absurd)

OH, about the mental count … my bandwidth is 11.4Mbps … and it is a very good connection, if the other end sustains the bandwidth it stays at top bandwidth 11.4Mbps always.I can not complaint about that.
So under this load it takes only 2 days to reach the 250GB.
You go out on the weekend and … boom … ops …

250GB is a fair amount. I have a 30GB peak time limit which is plenty for me, otherwise Unlimited. But usually this ISP business is more down to terms and conditions and not so much the law or what seems right or wrong.

The problem is not the amount. And my system is different for what I can see: 250GB is not “peak” time limit, it is Total Transfer Amount on a month.
(This is not the right forum for this issue as this is not a technical issue, but this issue may affect more people so please let this be discussed even in here.)

The issue is simple:
My service terms are like this: You get a total of 250GB/Month and after that limit is reached the isp charges a high rate for each new 10MB of data. (Price soars).

In this scenario customers are Paying 250GB every Month.
So if they Do Not Use the amount of data the ISP Should, by the Law, either return the money to the user or add the Unused data to the next months.
And: They do not do this. They always reset the monthly data counter to the default 250GB.
(This of course apart from the fact that they do not even show the customer the current data transfered…)

Imagine your electricity supplier charging you a fixed amount and then Not making the invoice adjustment for Energy not consumed!
Same for your home Gas provider?

These Utilities all do the same:

They charge a fixed amount agreed with the customer on the basis of a reasonable price for the installation at home (based on Power installed/ Flow capacity etc).
Then they Measure the Actual consumption and make Adjustments to the invoicing taking in to consideration the difference between base price payed for the customer and Actual spending (usually always more then the base charge).

Imagine your electricity bill: Lets say you pay a basic say 25euros per months, you go on vacation/work for say two months.
When you return home the Electric company Has to Pay you back 50euros, adjusting the next invoices!
ISP do not do this. It is a scam.

Regards,
Pedro

Traffic Counter is an easy-to-use tool to display and count network traffic of your computer. If you have limited monthly Internet traffic and always run P2P software such as BitTorrent, you may be in risk to be fined by your ISP because of your huge traffic consuming. It allows you to set monthly traffic limit, alerts you when the amount of the traffic is used ,traffic Counter reports daily and monthly traffic.It displays current download rate and upload rate also.