Coder Social home page Coder Social logo

uw-ictd / haulage Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 5.0 7.4 MB

A single-node tool for measuring and logging network usage to allow billing and analysis

License: Mozilla Public License 2.0

Makefile 2.22% Python 10.81% Shell 1.61% Rust 85.35%
logging network-monitoring networking rust

haulage's People

Contributors

matt9j avatar spencersevilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haulage's Issues

feature request: reporting around aggregate intervals?

If I understand haulage correctly, it logs all the bytes sent/received by a user and updates the customer table every (interval) seconds. I think it'd be super useful to enable some way for us to tease out aggregate information (e.g. bytes consumed in last 5mins/10mins/30mins/hour); both for individual users as well as the whole system. Not the most urgent thing on earth but definitely a "nice to have" item.

Current queue classification system does not correctly differentiate local and remote traffic

Due to the location of the enforcement rateliming queues and the current simple matching approach, local download traffic receives the same ratelimiting as remote downloading traffic when ratelimiting is enabled, and local traffic which does not leave the routing host is not ratelimited at all if a ratelimit is configured.

Addressing this will require a pretty large change to the ratelimiting architecture to correctly classify and police/limit all 4 types of traffic UL/DL X Backhaul/Local.

Ensure a clean shutdown

Currently the packet processing subsystem is shutdown violently, leading to data loss during the last interval. A clean shutdown could ensure all packets are appropriately logged to disk before terminating.

Support multiple IPs per user

Right now haulage assumes each user is represented by only a single IP. This could allow "double spending" across the IPs before the database synchronization period. Multiple IP addresses per-user is important for supporting dual IPv4/IPv6 connectivity.

Fails to detect new users and create new qdiscs on demand when ratelimiting configured

The current code assumes that all users will be in the database on startup, and fails to create new qdiscs for users that are later added to the system while operating. As a temporary workaround you can add new users and then restarting haulage to pick up the changes. The system does respond correctly to changes in the user configuration, and will successfully pick up changes to existing users without a restart.

currencies database table conflicts with the main CoLTE project

With uw-ictd/colte#106, the colte database model is responsible for the currencies table in the shared database. Unfortunately, I made a rookie mistake and re-used the same table name in the colte project, which is expected in many legacy deployments to connect to the same database as haulage. This creates an issue where the currencies table may already be present in the database if any of the colte services have run, causing the early haulage migrations to fail. Since sqlx applies all migrations iteratively, the early migrations creating the currencies table, which is later dropped by haulage, will conflict and cause the migration chain to fail. If all haulage migrations are run first there is no issue, but this cannot be guaranteed in real world deployment.

haulage requires libpcap-dev

Haulage requires libpcap-dev to compile; for some reason this package is not included on the standard Debian and Ubuntu packages. We should add it to a build dependencies target (preferable) or note it in README (less preferable).

Fails on node 10

Node 10 is the default system node version in the recommended debian buster platform, but the webgui fails to run with it. We should either suggest an alternative way to install an up-to-date version of node, or fix the backwards compatibility issue.

Accouting process can fail if a subscriber is manually added to the DB

Error log:

Jun 11 13:58:11 cobble haulage[29636]: thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: UserLookupError', haulage/src/accounter.rs:100:65
Jun 11 13:58:11 cobble haulage[29636]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jun 11 13:58:11 cobble haulage[29636]:   aggregator: user
Jun 11 13:58:11 cobble haulage[29636]:    aggregation: 10.45.1.8
Jun 11 13:58:11 cobble haulage[29636]:     Jun 11 20:58:11.998 ERRO Failed to initialize reporter, error: Failed to lookup user, id: 10.45.1.8
Jun 11 13:58:12 cobble haulage[29636]:   accounter: user
Jun 11 13:58:12 cobble haulage[29636]:    Jun 11 20:58:12.004 ERRO Failed to dispatch, error: channel closed

feature request: monthly membership model?

One of the communities outside Oaxaca apparently uses a monthly membership model, and I think it'd be a good feature to add to haulage. Generally speaking I don't want to make haulage too feature-heavy, would prefer integrate with existing WISP management tools than race them. Compared to these tools, the biggest value-adds haulage provides are (1) it supports prepaid customers (2) its simple and (3) its free. I think/hope we could implement this with minimal logic - a database field to mark whether the user is on a monthly or data plan, and then some logic to automatically draw-down from their $ balance every month, mark how long they're paid through, and cut them off if they ever go below 0.

Create a rust-based admin tool

There are several aministrative tasks like updating the database schema or adding new users that could benefit from a standalone scriptable admin tool. Right now some of this functionality is implemented with python scripts, but it would be good for all functionality that touches the database to use the same underlying SQLX definitions.

Need to better document the config file

Comments in the config file should explain how the file is structured and what typical values are of the configuration options themselves. This will make it easier to understand what's going on in the file and for users to make the changes they need to make!

Higher Performance Packet Monitoring

Right now haulage uses a naive userspace packet monitoring approach that involves additional packet copying. This has the benefit of placing few dependencies on the underlying system, but comes at the cost of performance. With LEO satellite use-cases looming for network-in-a-box community networks, it would be good to support an alternative traffic monitor more tightly integrated with something like dpdk/vpp, or the kernel conntrack system for performance up to the ~1gpbs range.

failed start of app

haulage

INFO[0000] Starting haulage
INFO[0000] Parsed parameters Parameters="{20m0s 1m0s enp1s0 {5s colte_db colte_db colte_db}}"
INFO[0000] Initializing context
ERRO[0000] Unable to query initial bridged state error="Error 1146: Table 'colte_db.customers' doesn't exist"

Backhaul uplink rate limiting does not work with NAT

When nat is enabled, the source ip address seen by the tc egress qdisc is already updated to be the local address, meaning simple matching rules based on the source IP are not sufficient to map egress flows to queues.

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.