How bonavadeur/netemu works
Project type and purpose
• This is an open-source command-line network emulation tool (“netemu”) that runs entirely on a Linux host.
• Its purpose is to create fixed, variable (jitter), or trace-based latency and bandwidth limits between multiple virtual machines by invoking Linux’s “tc”/”netem” subsystem.
File structure
• Top-level scripts:
• delayfix.sh – applies a fixed delay
• delaynor.sh – applies delay ± jitter plus bandwidth limit
• netem.py – Python script that reads a CSV trace and drives netem parameters
• netem.sh – helper that actually invokes “tc qdisc” commands on an interface
• undelay.sh – cleans up all applied qdiscs
• latency.sh – (possibly an alternative entrypoint for manual testing)
• delay.sh/delayfix.sh – small variants for specific modes
• Data assets:
• B_2018.01.19_07.31.48.csv – a sample 4G data-trace used by netem.py
• Project metadata:
• LICENSE
• README.md
README
• Describes a 3-VM topology (VM1, VM2, VM3) each connected via vnet interfaces on the host.
• Usage patterns:
• Constant delay (delayfix.sh)
• Variable delay + bandwidth limit (delaynor.sh)
• Trace-based delay + bandwidth (netem.py)
a. Virtual Machines
– VM1 (vnet0)
– VM2 (vnet1)
– VM3 (vnet2)
b. Host Machine
– Script Layer
• delayfix.sh / delaynor.sh wrappers
• netem.py (trace reader)
• netem.sh (tc invoker)
• undelay.sh (cleanup)
• latency.sh (helper/test)
– Linux Kernel “tc” subsystem
• netem qdisc
• tbf or htb classes (for bandwidth)
– Data Source
• CSV file containing bandwidth trace
c. Network Interfaces
– vnet0, vnet1, vnet2 bridges connecting VMs to host
d. External dependencies
– “tc” command (from iproute2)
– Python runtime (for netem.py)
Relationships and data flows
• The user invokes one of the wrapper scripts on the host.
• Wrapper parses parameters or hands off to Python.
• netem.py reads the CSV, generates per-interval tc commands.
• netem.sh executes “tc qdisc add/change” on vnet interfaces.
• undelay.sh reverses these qdisc settings.
Architectural patterns & design principles
• Modular script layer: wrappers → generic invoker → cleanup
• Separation of concerns: parameter parsing vs. tc invocation vs. trace reading
• Lean, single-host deployment: no external orchestrator