Skip to main content
NetHang Logo

Tests

NetHang is a web-based tool designed to simulate network quality, focusing on the diversity of last-mile network conditions. For modern internet applications and services with high real-time requirements, NetHang offers a stable, reentrant, customizable, and easily extensible network quality simulation system, helping to achieve low-latency and high-quality internet services.

Add Path

Unlike traditional network impairment tools that target backbone network quality between servers and switches, NetHang is optimized for:

  • Simulating network quality from user equipment (UE) to servers, typically traversing:

    • UE <--> Lan (Wi-Fi or Wired) <--> Routers <--> ISP edge nodes <--> APP servers
    • UE <--> Cellular <--> ISP edge nodes <--> APP servers
    • UE <--> Air interface <--> Satellite <--> APP servers
  • The current network model is built and simplified based on existing network quality data modeling, while also supporting users to easily customize the network models they need for testing in YAML format. The following image shows the StarLink network simulation ( Queuing changes every 20s - 30s caused by Satellite handover ):

StarLink Simulation
  • NetHang clearly displays the differences in data traffic before and after simulation, as well as the state of the simulation conditions.
Manipulate Charts

Features

  • Configurable traffic rules and models
  • Traffic rate limiting and shaping
  • Throttle queue depth control
Throttle Settings
  • Network latency and latency variation (Jitter) simulation
  • Jitter simulation with and without reordering allowed
Latency Settings Latency Settings
  • Packet loss with random and burst support
Loss Settings
  • Support for both uplink and downlink traffic control
  • Real-time traffic statistics display

Requirements

  • Python 3.8 or higher
  • Linux system with tc and iptables support
  • Root privileges for traffic control operations

Installation

From PyPI (Recommended)

You can install NetHang from PyPI using the following command:

pip install nethang

From Source (For Developers)

You can also install NetHang from source by cloning the repository and running the following command:

pip install .

License

MIT License

Copyright (c) 2025 NetHang Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Please make sure to update tests as appropriate and adhere to the existing coding style.

Authors

NetHang Contributors

Acknowledgments

  • Thanks to all contributors who have helped with the project
  • Inspired by various network traffic control tools and utilities

Metadata

Release files for nethang 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nethang 0.2.0
File Size Uploaded
nethang-0.2.0.tar.gz 336.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nethang 0.2.0
File Interpreter ABI Platform
nethang-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 667.5 kB

Release files / nethang-0.2.0.tar.gz

Download URL nethang-0.2.0.tar.gz
Size 336.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3f5b37923427f3f58ef020fcc97c06d60023275ca4e60eb98f9fb48426be7e6f
BLAKE2b-256 checksum
How to use checksums
c1689e4d620ad21a318590ff788b189ab53f9d541bf31a5cd168c8c718d10a23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / nethang-0.2.0-py3-none-any.whl

Download URL nethang-0.2.0-py3-none-any.whl
Size 331.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac9b628109b41e2e9a1295c415aea3fade2c4149550cc3e3495f4ec03b9767d0
BLAKE2b-256 checksum
How to use checksums
69b8d361dd42b831ea4802ad094e6bbd26bf26a43cc895454f8a89c10560d9b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page