Summary
ML_DERP_REGION is hardcoded to 9 (Dallas) in microlink_internal.h. Every deployment outside North America that depends on relayed traffic (CGNAT peers, i.e. most cellular clients) pays intercontinental RTT on every relayed byte. Real Tailscale clients pick the home DERP region by measured STUN latency; microlink takes the compile-time constant.
Measured impact (deployment in Southeast Asia)
- Via region 9 (Dallas): ~750 ms relay RTT → with a ~14 KB effective TCP window, ~9 KB/s throughput. A 645 KB transfer = ~71 s of pure transfer, ~4 min end-to-end.
- Recompiled with region 3 (Singapore): ~230 ms RTT, same transfer completes in ~25 s — ~10x.
Notes for a proper fix
- The constant feeds
Hostinfo.NetInfo.PreferredDERP at all four report sites in ml_coord.c, and the control plane republishes it as the node's HomeDERP — so peers re-route automatically once it changes; no asymmetric-relay problem.
- The runtime DERP node is already picked from the live DERPMap by region id (
ml_derp.c); the hardcoded hostnames are only fallbacks.
- Suggested fix: STUN-probe a few regions from the DERPMap at startup and pick the lowest-latency one (what the official client does). Interim cheaper fix: make the region a
Kconfig option instead of a #define, so users don't have to patch a header.
Happy to provide the measurements or test a patch on hardware (ESP32-S3, ESP-IDF v5.3).
Summary
ML_DERP_REGIONis hardcoded to9(Dallas) inmicrolink_internal.h. Every deployment outside North America that depends on relayed traffic (CGNAT peers, i.e. most cellular clients) pays intercontinental RTT on every relayed byte. Real Tailscale clients pick the home DERP region by measured STUN latency; microlink takes the compile-time constant.Measured impact (deployment in Southeast Asia)
Notes for a proper fix
Hostinfo.NetInfo.PreferredDERPat all four report sites inml_coord.c, and the control plane republishes it as the node's HomeDERP — so peers re-route automatically once it changes; no asymmetric-relay problem.ml_derp.c); the hardcoded hostnames are only fallbacks.Kconfigoption instead of a#define, so users don't have to patch a header.Happy to provide the measurements or test a patch on hardware (ESP32-S3, ESP-IDF v5.3).