关于 DERP 的运行策略的相关问题,为了避免给大家造成错误的解释,就相关问题咨询了 Tailscale 官方。
以下是来自官方的回复:
1,如果 DERP 服务器不可用,是否可以自动切换到另一个 DERP 服务器?
这是 Tailscale 默认设计的工作方式,如果与 DERP 的连接断开,客户端将选择下一个最近的 DERP 并使用它。您可以运行一些诊断,例如 tailscale debug derp-map,以显示客户端可见的完整 DERP 地图,以及 tailscale netcheck,以查看客户端当前认为最接近的 DERP 服务器,即“主” DERP。当 DERP 不可用时,检查客户端日志应该会显示客户端选择新的主 DERP 的日志行。
原文:This is how Tailscale is designed to work by default, if the connection to a DERP goes offline, the client will choose the next closest DERP and use that instead. You can run some diagnostics, like tailscale debug derp-map to show the full DERP map visible to the client, and tailscale netcheck to see which DERP server the client currently consider's it's closest, AKA "home", DERP. Checking the clients logs when a DERP goes offline should show log lines indicating the client choosing a new home DERP.
2,自己编译的 DERPPER 与官方的有何不同?如何调试?
我们在 GitHub 上公开提供的 DERP 软件与我们官方 DERP 服务器上编译和运行的软件相同,因此软件本身不应该出现任何问题。我建议在您遇到此问题时检查客户端的 Tailscale 日志,以查看它们是否报告了与您的自定义 DERP 服务器有关的任何连接问题。从客户端运行 tailscale debug derp <derpID> 也可能会揭示后台发生的情况。
原文:The DERP software that is publicly available on our GitHub is the same software that we compile and run on our official DERP servers, so there shouldn't be any issue with the software itself. I would recommend checking the Tailscale logs from clients while you are seeing this issue to see if they are reporting any connectivity issues with your custom DERP servers. Running tailscale debug derp <derpID> from a client may also shed some light on what is occurring in the background.
微林提供的 DERP 服务也是从 Github 上编译的官方 Derpper,未作任何修改,我们仅仅是完成了自动化的环节以节约大家的时间。
Tailscale 的策略是使用 DERP 来打洞,极端情况下,如果两个点没办法直接打洞连通,那么就会采用 DERP 服务器来中继。
官方服务器未能考虑中国地区的使用体验,因此才有了我们的自定义 DERP 网络。极大改善体验。鉴于此,这项服务被归纳到了流量优化服务中。