Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. candrew/netsim

candrew/netsim

Rust

A Rust library for network simulation, isolation, and packet inspection to test networking code.

GitHubGitHub
209 stars25 forks0 contributors

What is candrew/netsim?

netsim is a Rust library for network simulation and testing that allows developers to run tests in isolated network environments, simulate network conditions, and inspect network packets. It solves the problem of testing networking code that requires specific network configurations or isolation from the host system.

Target Audience

Rust developers building networking applications, libraries, or services who need to test network behavior in isolated or simulated environments.

Value Proposition

Developers choose netsim because it provides a lightweight, programmatic way to simulate networks and isolate tests without requiring complex infrastructure or single-threaded test execution, making it ideal for validating networking code in CI/CD pipelines.

Overview

Network simulation in Rust

Use Cases

Best For

  • Testing networking code that binds to specific ports in parallel test runs
  • Simulating network conditions for UDP or TCP-based applications
  • Capturing and validating network packets in automated tests
  • Injecting malformed or unexpected packets to test error handling
  • Isolating network tests from the host system to avoid conflicts
  • Developing network protocols or libraries that require controlled testing environments

Not Ideal For

  • Projects targeting Windows or macOS development environments, due to Linux-only support
  • Simulations requiring high-throughput or real-time network performance, as containerization APIs may introduce overhead
  • Teams needing GUI-based network simulation tools for visual debugging over programmatic control

Pros & Cons

Pros

Parallel Test Isolation

Allows tests to run in isolated network threads without requiring single-threaded execution, as shown with the #[netsim::isolate] attribute in Example 1.

Programmatic Packet Inspection

Enables capturing and validating network packets directly in code, demonstrated in Example 2 where UDP packet data is asserted.

Lightweight Linux Integration

Uses Linux containerization APIs for isolation, providing a efficient simulation without heavy virtualization, per the philosophy section.

Flexible Network Configuration

Supports adding IP interfaces with customizable addresses and routes, as seen in the machine setup with ipv4_addr and ipv4_default_route.

Cons

Linux-Only Limitation

Relies exclusively on Linux containerization APIs, making it unusable on other operating systems and restricting cross-platform testing workflows.

Complex Setup for Simulations

Requires manual coding for advanced scenarios like packet injection and network routing, which can be more involved than using higher-level tools.

Sparse Built-in Features

Focuses on low-level packet handling; lacks out-of-the-box simulations for common network conditions like latency, jitter, or bandwidth throttling.

Frequently Asked Questions

Quick Stats

Stars209
Forks25
Contributors0
Open Issues5
Last commit1 year ago
CreatedSince 2017

Tags

#network-isolation#containerization#tcp#network-simulation#testing#linux#packet-capture#rust#udp

Built With

R
Rust

Included in

Rust56.6k
Auto-fetched 17 hours ago

Related Projects

HurlHurl

Hurl, run and test HTTP requests with plain text.

Stars19,092
Forks730
Last commit18 hours ago
tonictonic

A native gRPC client & server implementation with async/await support.

Stars12,382
Forks1,233
Last commit1 day ago
irohiroh

IP addresses break, dial keys instead. A library that adds QUIC + NAT Traversal to your apps.

Stars11,817
Forks609
Last commit1 day ago
quichequiche

🥧 Savoury implementation of the QUIC transport protocol and HTTP/3

Stars11,700
Forks1,038
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub