An adaptive eBPF-based router built to discourage network users from compulsive web usage
GPL-3.0 License
Nethadone is an adaptive L4 router built to discourage and train users on a network out of compulsive or addictive web usage.
It uses eBPF to efficiently monitor and dynamically adjust traffic speeds to gently nudge users off of configured sites. The goal is to get the benefit of these platforms (occasional surfing, ability to respond to messages, etc.) while avoiding the downsides of excessive use.
Nethadone is in active development and has been tested on the following devices:
Please check out doc/install.md for more details.
For development or testing on a local VM, please see doc/development.md
Nethadone leverages several eBPF programs to monitor and classify routed traffic as it passes through. Based on the configured policies, packets are slotted into a series of bandwidth classes. The default configuration corresponds roughly to:
As a user continues to compulsively use a given site, traffic to flagged IPs gradually works its way down the list above.
Nethadone currently only supports a single policy, for more details see policy/README.md.
For more details on bandwidth classes (i.e. qdisc configuration), see doc/qdisc.md.
The following diagram shows the approximate life of a packet as it flows through the nethadone router, and most of the moving parts involved:
Milestone 8: Improved overall installation experience and support for lower-end 32-bit arm devices such as Orange Pi Zero/R1.
A number of projects were invaluable reference points in trying to understand the intracies of eBPF:
While a very different technical solution, the product experience of Pi-hole from the users' persective is a huge inspiration for nethadone.
Replacing HTB with EDT and BPF
Scaling Linux Traffic Shaping with BPF