testbed: add Docker router-based testbed#51
Draft
srene wants to merge 1 commit into
Draft
Conversation
The previous Docker mode used a per-node bridge network (one /24 per
node) which required N docker network create calls plus a host-level
iptables --flush of DOCKER-ISOLATION-STAGE-1. Setup time scaled with
node count, the iptables flush needed sudo, and the NAT machinery
served no purpose now that NAT-class simulation is out of scope.
Replace it with a single user-defined bridge (10.100.0.0/16) where each
node container gets its actual configured IP via 'docker run --ip'.
Nodes communicate directly through the bridge with no NAT and no router.
IPs are laid out so each node falls in a distinct /24 (node N ->
10.100.N.1), exercising regBucketSubnet=24 in the discv5 IP cap.
Per-node bandwidth and latency, when configured via min/max ranges in
the run config, are sampled and applied inside each container via
'tc htb' + 'tc netem' on eth0. Nothing is shared on the host.
Adds:
testbed/docker/node/Dockerfile build context = project root
testbed/docker/node/entrypoint.sh tc shaping + exec devp2p
testbed/discv5-docker-config.json example config with bw/latency
testbed/README.md Docker-mode section
Network.prepare(params) hook so subclasses see params
before start_node is called
Removes from NetworkDocker:
per-node bridge creation
iptables --flush hook in start_nodes
config_network() docker exec tc rules
This was referenced May 3, 2026
srene
added a commit
that referenced
this pull request
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the existing Docker testbed in PR #18 with a simpler design that drops NAT entirely. Each node container has its actual configured IP on a single Docker bridge — no router, no virtual public IPs, no NAT classes.
Design
10.100.0.0/16)docker run --iptc neteminside each containertc htbinside each containerdocker run --cap-add=NET_ADMINper containerIPs are laid out across distinct
/24s (node N →10.100.N.1), so the per-bucket IP-subnet cap (regBucketSubnet=24) is exercised meaningfully.Files
testbed/docker/node/Dockerfile— Alpine + iproute2 + the devp2p binary built from project root.testbed/docker/node/entrypoint.sh— appliestc htb+tc netemifNODE_BW_MBIT/NODE_LATENCY_MSenv vars are set, thenexecs devp2p.testbed/discv5-docker-config.json— example 100-node config withmin/maxLatencyMsandmin/maxBandwidthMbitranges.testbed/testbed/network.py—NetworkDockerrewritten;Network.prepare(params)hook added so subclasses see config params beforestart_nodeis called.testbed/README.md— Docker-mode section added.What this PR does NOT include
[min, max]per run. A follow-up will integrate the MarcoPolo/ethereum-network-latencies dataset for true pairwise predicted RTTs (will likely live alongside a parallelsimnet-based testbed).Test plan
docker build -t discv5-testbed-node -f testbed/docker/node/Dockerfile .testbed/run.py --docker --config testbed/discv5-docker-config.json --no-analysis --name docker-smoketcshaping:docker exec discv5-node-1 tc qdisc show dev eth0testbed/analyse.py discv5_test_logs/docker-smoke/Marking as draft until I've validated the smoke run on a Linux host.