Bandwidth meter/monitor

Hello,

I wanted to toy around in creating myself a little bandwidth monitor/meter. I found someone wanting to do the same exact thing at the old arduino forums. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231644836. But I am having some trouble with how this can be configured (hardware wise) to accomplish my goal though. Ideally I would like to capture all of the data going over a network cable as the guy described in his post. Putting this device between the DSL/Cable modem and the router would obviously get all the data that any of my computers are transferring to and from the internet. The issue is getting this information without causing other issues.

Idea 1: Using some kinda pass through. 1 Wiznet type device connected to the dsl/cable modem then the counting the frames passing over the network and then passing that data along to another wiznet chip sitting on the "other side" connected to the router. The problems I could see with this is that the arduino might not be fast enough and could degrade the network. I personally don't like this as it seems that it would be problematic and overly complicated.

idea 2: Using the device almost like a "tap". My thought was to simply plug a network "hub" into the cable modem and plug the the arduino into another port on the hub and then from the Hub to the router. My thought on this was since a hub passes all data to every port on the hub the arduino board would see exactly what was coming over the wire. When I did this with my linksys hub it didn't appear that the hub was actually passing the data to all ports like I expected. I set this up and used wireshark to monitor the packets with my other network device on my computer. The network card on my PC that I was watching with wireshark that was acting as the arduino was not seeing any of the data that the normal network on my PC was seeing. I had the network card acting as the arduino in promiscuous mode as well. Obviously a big problem if the arduino never saw any data :). So my question is there any type of device that will do what I am expecting the hub to do? I was doing some reading that I could use a "switching PHY chip". I am not even real sure what that would accomplish as I haven't done much research on such chip or even if it what I am wanting. I know port mirroring is a feature on some cisco switches, so I know it is possible. I also would think it would be fairly cheap as well.

Any help or information regarding this would be greatly appreciated.

There's no way an Arduino board can do what you want.

If your network is 100Mb/s (or even 10) and your Arduino is running at 16Mhz, you can quickly do the math that proves it is impossible, even before considering that most Arduino Ethernet interfaces are serially controlled.

I didn't even think of the bus speed between the Ethernet Shield and the arduino.

What would be the cheapest alternative to accomplish such a task? Would I have to step into the realm of PC104 boards?

You could just put this $120 switch in and use a NMS (Network Management System) Cacti, MRTG, or any other, to pull bandwidth and other stats via SNMP http://www.netgear.com/products/business/switches/smart-switches/GS108T-200.aspx, doesn’t sound like an Arduino task (not that it isn’t possible). If it were, I would say it should be added to the Agentuino SNMP library.

A HUB does behave exactly the way you want. A network switch behaves differently.

That is why there are managed switches that collect statistical data. ...and dumbswitches that don't.

Will an Arduino monitor traffic at this speed? No

Can you use Arduinos to do this? Yes. It would be a good research project.

At this point I believe you guys are right and this might be out of the scope/capability of the arduino from what I am reading here and other places.

But I still would like to accomplish this task somehow and would like some suggestions on where to go from here.

Any home router is more than capable of doing such a task and you can get them for < 25 bucks these days. Which is another option I could go, I could simply buy the cheapest router possible that supported dd-wrt, setup port mirroring inside of dd-wrt with iptables or such and then figure out a way of putting a little LCD on it to show the bandwidth consumption. Obviously I would rather go with a more “home grown” solution with just a single embedded board or something. Would you guys have any suggestions for a cheap embedded SBC that runs linux (such as a router)?

The end goal is to be able to look over at a small LCD screen on such item thats next to my modem that says “Inbound Traffic: 100MB Outbound Traffic: 50MB”.

I know this is past the scope of this forum as it is only for arduino projects but would like some advice on where to continue my research.

Thanks in advance.

I wanted to collect the network usage stats for my DSL connection so what I did was write some scripts to grab the status page from the HTTP admin U/I of my DSL modem and parse out the key data. This runs in a cron job on my server, and grabs samples the data every 10 mins or so. Then I have some gnuplot scripts to draw pretty pictures of daily weekly and average volume.

There’s no Arduino at all in my solution though.

Yeah I am thinking this won't end up being an Arduino project unfortunately :(.

However I would like to have it as a "plug and play" item and don't want to really want to depend on a particular network setup. Something I can send to my parents and they can use it.