Build An In Line Network Bandwidth Monitor

[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!

25 thoughts on “Build An In Line Network Bandwidth Monitor

  1. 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.

  2. 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.

    1. 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.

      1. 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.

  3. 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.

  4. 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.

  5. 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

    1. 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.

      1. 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.

  6. 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.

  7. 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

  8. 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?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.