Giter Site home page Giter Site logo

quantifi's Introduction

QuantiFi

Tracks total network data usage to help avoid overage fees on data-limited internet/cable plans. QuantiFi is designed to be ran on a Raspberry Pi with two wifi cards, giving it the power to fully monitor data usage. It is unique from all other data usage tracking solutions not already built into your router, as QuantiFi can measure the data-usage accross the entire network (with the notable exception of networks with network switches).

How it works

The Raspberry Pi uses one wifi card to actively monitor and measure all incoming network data, while the other hosts the local server from which you can view your current data useage. The monitoring is accomplished by putting the wifi card into promiscuous mode, allowing the network interface to passively monitor all network traffic both inbound and outbound. To avoid counting outbound packets against your data, the system keeps a running list of the MAC addresses of the devices on the network, and checks to ensure that the sender was not on the network and the receiver was.

All that is the "abstract" implementation details. The way I accomplished this was by using small wrappers around Linux networking tools. This includes interacting with and controlling the network interfaces on a lower level, turning them off and ensuring that they connect to the proper network as well as actually capturing the data (The concepts I use here have since been transformed into a far more comprehensive cross-platform network interface manager, WifiManager).

One of the issues I ran into while developing this was trying to determine which network interface was actually internet connected. This proved to be far more difficult than I expected, what with naming inconsistencies and other nonsense. Though the actual implementation varied (network.go:138), the idea was to use the platform specific route command, and then scrape the command output for the interface. While a hack, no doubt, this ended up working surprisingly well.

For the server portion, it simply serves a frontend which is powered by a JSON-api. This has the added benefit of allowing people to hook into the system and trigger, say, events as they please. Pretty straightforward and simple.

Important

This tool is not 100% accurate. The tool will miss some data here, or track more data out of each packet than your ISP. Regrettably, there isn't a lot of insight into their metrics for 'data', so this tool is more of a ballpark.

quantifi's People

Contributors

howardstark avatar oldgalileo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.