ThreeFold Network Performance: Mycelium vs WireGuard vs Public IPv4

:globe_with_meridians: ThreeFold Network Performance: Mycelium vs WireGuard vs Public IPv4


Introduction

:wave: As we push toward a decentralized internet, network performance is critical — especially for edge computing, storage, and peer-to-peer applications. I ran latency tests comparing Mycelium (an open-source IPv6 overlay network) and WireGuard (an open-source VPN) to see how they perform inside and outside a cluster. The results highlight why protocol choice matters for resilience and speed in distributed systems like the ThreeFold Grid. Let’s break it down!

:warning: Important Note: This is a limited-scope experiment under specific network conditions. Results reflect performance in this particular cluster configuration and may not represent the technologies’ full capabilities. Variables like geographic distance, network congestion, hardware specs, and configuration tuning can drastically impact outcomes. Always validate benchmarks against your own use case.


:mag: Full Analysis & Data


:earth_africa: External Connections (Outside the Cluster)

WireGuard struggles with instability, while Mycelium thrives:

Node Target Packet Loss Min (ms) Avg (ms) Max (ms) Std Dev (ms)
node_0 Mycelium 0% 95.76 98.11 105.26 3.59
node_0 WireGuard 20% 155.02 196.58 257.76 38.15
node_1 Mycelium 0% 93.85 94.34 95.28 0.50
node_1 WireGuard 20% 155.92 198.70 242.12 31.47
node_2 Mycelium 0% 94.36 96.88 101.46 2.85
node_2 WireGuard 0% 165.46 216.75 253.34 32.20
node_3 Mycelium 0% 95.49 97.96 101.98 2.25
node_3 WireGuard 0% 154.58 156.13 158.07 1.16
node_3 Public IP 0% 154.14 183.02 264.54 42.11
node_4 Mycelium 0% 94.08 96.71 101.99 2.80
node_4 WireGuard 20% 155.12 199.17 317.19 68.33
node_4 Public IP 20% 155.23 199.66 255.70 44.80
node_5 Mycelium 0% 93.98 95.05 95.75 0.66
node_5 WireGuard 40% 153.91 175.95 217.55 29.43
node_5 Public IP 0% 154.14 167.60 200.00 N/A

Key Issues for WireGuard:

  • 20–40% packet loss on external connections (nodes 0,1,4,5)
  • Latency spikes up to 317 ms (vs Mycelium’s max 105 ms)
  • High standard deviation (68 ms on node_4) → Unpredictable performance

:house: Internal Cluster Performance

Both protocols excel here, but WireGuard slightly edges out Mycelium:

Node Target Packet Loss Min (ms) Avg (ms) Max (ms) Std Dev (ms)
node_0 Mycelium 0% 2.33 3.68 7.88 2.11
node_0 WireGuard 0% 1.01 1.08 1.22 0.07
node_1 Mycelium 0% 2.31 2.79 3.45 0.46
node_1 WireGuard 0% 0.97 1.04 1.11 0.06
node_2 Mycelium 0% 2.43 5.80 18.34 6.27
node_2 WireGuard 0% 1.02 1.08 1.16 0.05
node_3 Mycelium 0% 0.05 0.06 0.09 0.01
node_3 WireGuard 0% 0.03 0.04 0.04 0.00
node_3 Public IP 0% 0.03 0.04 0.05 0.01
node_4 Mycelium 0% 2.31 4.34 11.62 3.64
node_4 WireGuard 0% 1.05 1.18 1.24 0.07
node_4 Public IP 0% 0.63 0.68 0.74 0.04
node_5 Mycelium 0% 2.87 4.83 9.03 2.49
node_5 WireGuard 0% 1.08 1.15 1.23 0.06
node_5 Public IP 0% 0.42 0.57 0.67 0.09

Why This Matters for ThreeFold Nodes:

  • Mycelium’s sub-5ms avg latency is stellar for internal microservices.
  • WireGuard’s sub-1ms consistency could benefit real-time workloads.
  • Public IPs internally? Near-zero latency (0.03 ms) → Likely optimized routing.

:chart_with_upwards_trend: Key Observations

  1. Mycelium Wins Externally: 2x faster than WireGuard, zero packet loss.
  2. WireGuard Better Internally: Slightly faster, but both are excellent.
  3. Public IPs ≠ Optimization: Performed no better than WireGuard externally.

:bulb: ThreeFold-Specific Takeaways

  1. Edge Deployment: Use Mycelium for external traffic to edge nodes — critical for low-latency apps (e.g., gaming, IoT).
  2. Internal Security: Pair WireGuard with Mycelium for secure, fast intra-grid communication.
  3. Farm Optimization: Clusters benefit from both protocols’ internal performance — ideal for distributed storage/compute.

:rocket: Reproduce, Test, and Build!
Want to run your own benchmarks or adapt this setup? Dive into the open-source Terraform/OpenTofu) repository used for this 6-node deployment:
:point_right: github.com/mik-tf/tfgrid_6nodes

This repo lets you:
:white_check_mark: Validate these latency results in your own environment
:white_check_mark: Stress-test hybrid Mycelium/WireGuard configurations
:white_check_mark: Contribute improvements back to the ThreeFold community

Decentralized infrastructure thrives on transparency — the more we test, the stronger the grid becomes!


:question: Let’s Discuss!

  • Have you tested these networks on the ThreeFold Grid?
  • Would a hybrid Mycelium/WireGuard setup make sense for your use case?
  • What other metrics should we prioritize? (Bandwidth? Encryption overhead?)
1 Like