高性能策略路由 IPsec 网状 SD-WAN
Show HN: Ranet3 – High performance policy routed IPsec mesh SD-WAN

原始链接: https://ranet3.com/

ranet3 使用标准 IKEv2、ESP、Babel 和 SRv6,因此应能与兼容的路由器和交换机互操作,并可与 mesh VPN/SD-WAN 工具并行运行。Babel 持续测量链路 RTT 和丢包率,通过更快的中继路由,而不是更慢的直连链路。其用户态段路由允许流量经过任意、可重复的中继点和出口点,包括在 macOS 上。基准测试显示,ranet3 在六项测试中达到 8.84 Gbit/s 中的 8.39 Gbit/s,吞吐量为内核 WireGuard 的 1.6–2.1 倍、wireguard-go 的 1.2–1.5 倍;饱和状态下的 p99 延迟为 1.91–4.96 ms,而内核数据平面为 0.85–2.51 ms。内核 IPsec 受单个 NIC 接收队列限制。结果还报告了饱和状态下的 CPU 成本和延迟。

Ranet3 是一款高性能、策略路由的 IPsec 网状 SD-WAN,发布于 Hacker News。作者在多台设备(包括 MacBook)上运行它,并用它在动态 IP ISP 后获取稳定的可路由 IPv4/IPv6 地址;未来计划提供隧道代理。它旨在取代基于 WireGuard 的网状 VPN,支持与符合标准的 VPN 和路由守护进程(如 BIRD/Babel)交互、任意寻址、指定出口节点和策略路由;计划支持 NAT 打洞。经中转节点的流量会被解密并重新加密,而非完全端到端加密。许可为源码可用,并在两年后转为 Apache 2。作者还邀请投资者和 YC 的关注。
相关文章

原文

Why ranet3

Standard protocols

Peers only need standard IKEv2, ESP, Babel and SRv6.

Interoperability is checked against:

strongSwan
IKEv2 and ESP sessions with Ed25519 keys
BIRD
Babel routes with RTT metrics, matched route for route
Linux
Kernel seg6local acts on the SRv6 headers ranet3 writes

Any other router or switch that supports IKEv2 with Ed25519 keys, Babel and SRv6 should interoperate as well.

Common mesh VPN and SD-WAN tools (Tailscale, NetBird, ZeroTier, Nebula, etc.) admit only nodes that run their own agent, and ranet3 runs beside them on the same host.

Latency routing

Babel measures the round trip of every link and routes through a relay whenever the direct link is slower.

ABC40 ms40 ms265 ms
Chosen path through B, 80 msDirect link, 265 ms

RTT is measured continuously, and packet loss and outages count against a link. Traffic always takes the fastest path, moving back to the direct link once it is faster again.

Segment routing

A policy on source and destination prefix sends traffic through chosen waypoints and out at a chosen exit. Segment routing is implemented in userspace and works even on macOS, whose XNU kernel has no support for it.

WaypointEndExitEnd.DT46LaptopInternetDefault route

Waypoints can come in any order the user specifies and may repeat, e.g. A->B->C->B->D with D as the exit.

Benchmarks

95%

of the 10 GbE payload limit, 1 stream one way

8.39 of 8.84 Gbit/s

1.6-2.1x

kernel WireGuard throughput

All 6 tests

1.2-1.5x

wireguard-go throughput

All 6 tests

1.91-4.96 ms

RTT p99 under saturation

Kernel dataplanes 0.85-2.51 ms

Medians of 3 runs under saturation

Head to head

Each range is ranet3's result divided by the other dataplane's across the 6 tests below.

Kernel and userspace

Userspace dataplanes copy every packet into their own process and are usually expected to be slower than kernel ones.

* Plain TCP without tunnel

Kernel WireGuard stays at 5.1 to 5.4 Gbit/s one way.

Kernel IPsec stays at 4.0 to 4.7 Gbit/s because its single flow lands on 1 NIC receive queue.

Full results

Throughput, saturatedGbit/s receivedHigher is better
CPU cost at 3 Gbit/s offeredBusy cores per Gbit/s, both hostsLower is better

In the "both" rows kernel IPsec carried only 4.67 and 4.14 of the 6 Gbit/s offered.

Latency under saturationRTT p99, msLower is better
联系我们 contact @ memedata.com