[Kurt] likes to know what’s going on with his network. He already uses bandwidth checking software on his DD-WRT capable router, but he wanted a second opinion. So he built his own network monitor. [Kurt] started by building a passive Ethernet tap. He then needed a network interface chip that would serve his purposes. The common Wiznet chips used with Arduinos didn’t allow enough manipulation of raw packet data, so he switched to a Microchip ENC624J600 (PDF). The Microchip controller allowed him to count the bytes in the raw Ethernet packets.
With the Ethernet interface complete, [Kurt] turned his attention to a microcontroller to run the show. He started with an Arduino, but the lack of debugging quickly sent him to an Atmega128 in Atmel Studio. After getting the basic circuit working, [Kurt] switched over to a PIC24F chip. With data finally coming out of the circuit, he was able to tell that his original back-of-the-napkin calculations for bandwidth were wrong. [Kurt] created a PCB to hold the microcontroller, then wrote a Python program to plot the data output from his circuit. The bandwidth plot matched up well with the plot from DD-WRT. Now he just needs a giant LED matrix to show off his current network stats!
Thanks for the heads up for this ENC624J600 (10/100) chip.
This is an interesting way of looking at the stats, he would only get
either the transmitted or the received stats as he could only have 1
receiver on the chip to snoop data.
Ethernet switches inside the routers usually have (hardware) statistics
on packet counts and byte counts on received/transmitted data on each of
its ports. The router firmware could also be keeping its own stats while
it is routing. Very unlikely the router is wrong as lots of people
relies on that on parts of the world that have Internet usage quotas.
@tekkieneet, you’re correct about needing two NICs to monitor upload and download. In my next revision I plan on using two of the ENC624J600 chips. I’ll use the chip selects to switch between them.
<3 my Kurg!
I’d like to see a comparison between the router data and the dedicated monitor’s data. Also, why go serial? The router is right there? A simple ethernet interface and you can collect your data from inside your LAN.
I have a comparision with the DD-WRT plots here: https://www.bonafidegeek.com/media/bw_meter_plot_labels.png
The goal for this project was to have a stand-alone device that wouldn’t require any special software or a specific router. I wanted to make a device that anyone could plug in between their router and cable modem and get data. I should not that the Python plot in the link above is temporary, I’d ultimately like to use something like an analog gauge or as hackaday recommened, a giant LED matrix.
Yes, I commented to soon, I did come across them just now. Pretty good match that.
For the readout, I meant an additional ethernet port with a service behind it that reports back the data when queried. Plug in in the LAN part and it would be out of the loop itself.
He didn’t actually build the LAN tap, you can buy the exact same ones shown in the pic above over at: http://hakshop.myshopify.com/
I did build a ghetto version for my early development: https://www.bonafidegeek.com/Bandwidth/passive_tap.jpg . The one I used in the prototype is from Mike Ossman (one of the guys behind HackRF). He uses them out as business cards. http://greatscottgadgets.com/throwingstar/
He doesn’t claim he did, the article suggests it, which is wrong.
On his blog he clearly states that he uses this product.
He built his own before he switched to the throwing star.
In case anyone else wonders why a “lack” of debugging capability necessitates the need to move from the ATmega 328 chips, It doesn’t. The 328’s do indeed have debugging capability!
It appears his programmer (Olimex AVR-JTAG-USB-A) only supports JTAG programming and debug methods, not the debugWire protocol offered by the ATMEGA 328.
Tom, thanks for the feedback, I haven’t used debugWire before. I guess a better description of why I went away from Arduino was laziness/code reuse. I had previously built a robot around this board, http://www.bdmicro.com/mavric-iib/ , and as such I was more confident in my ability to debug it. I’ll have to checkout debugWire for future projects.
It’s a neat setup, especially if you like fiddling with ethernet chips and microcontrollers. I considered a similar setup for my own bandwidth monitoring purposes. But ultimately, I settled on putting an old hub between my modem and my router, then connecting it to my PC running Wireshark. A single port can capture upload and download in that case, as well.
Being a pedant won’t this technically measure the traffic between the router and the modem (I’m assuming you don’t have CAT5 to your ISP)? The modem could add its own extra overheads
Being a pedant on my own post – replace CAT5 with Ethernet
You were generally right the first time. Cat5 is within 802.3, 802.3 is not within Cat5.
That’s just data between his modem and the one at the other end. It’s a certain amount of overhead on top of the data, but who needs to know that? Between the modems they aren’t speaking Ethernet anyway. It’s the domain of modem makers and the people who maintain the copper wire. Irrelevant overhead. The “Internet” as it is spoken starts at his modem’s link socket to the network, which is where the tap is.
I was working a project a few years back to tap into the cable side of the modem, primarily because I wanted to see what exactly was going over the wire. It drives me insane that despite owning the device, there is a small chunk of the board controlled purely by the ISP (some firmware that controls communication to the CMTS, performs rate-limiting and can disable your connection, amongst other things)
I stopped working on it due to some extreme cost over-runs with the high cost of 5.8-Ghz RF components, a 5.8 Ghz Oscilloscope and a microcontroller that can handle the load of decoding the signal properly. I might pick this project up again now that I got my hands on a Zync-7000 dev kit and the prices on RF components has dropped significantly in the past few years.
This is a great little device for excellent plotting. This keeps a good track on network usage. There is just one problem. Well, this is throughput… not bandwidth. He did mention the frequencies for a bit, but then he went on to check the throughput. Maybe I’m wrong, but this is a bit more significant problem than the baud vs bps confusion. Anyways this is an excellent development, and I look forward to future posts.
Every time I see where someone finds the limitations of ardunio and moves to a PIC, which smokes arduino in just about every respect, I feel a little more hope for humanity :D
LOL @ your ignorance.
Reblogged this on Science and Technology Today.
Bandwith is the area of frequency used by a radio signal being transmitted. Say 14.100.005 Hz to 14.099.996 Hz giving a 10 Hz spread or width.
What you describe is a network speed recording device and has nothing to do with bandwidth . Why do people insist on improperly using this term ? And this from someone who has been recently educated at a University and should know better?
The term bandwidth is a bit ambiguous in networking, however the term is commonly used to describe the throughput or bit rate.
https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Bandwidth_%28signal_processing%29.html
https://en.wikipedia.org/wiki/Bandwidth_%28computing%29
@adamfabio Thanks for the LED matrix idea, it’s not giant, but it looks pretty cool.
https://www.bonafidegeek.com/Bandwidth/#LED%20Matrix