You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
magicsock: don't report derp home to control until derp connected #212
Currently magicsock measures its distance to the DERPs, makes a decision as its DERP home, and then reports it to the control plane concurrently with connecting to that DERP node.
That leaves a small window where control might think a node is on a certain DERP node (and tell peers) but it's not yet.
We should probably delay the netinfo update until after we're actually connected.
Alternatively, stop telling control about DERP homes entirely, and let control get that from the DERP nodes directly. If each DERP node had, say, 10,000 concurrent connections * 32 byte public keys, that's just 320 kB of network transfer from derp->control on control start-up, followed by a long-poll stream if changes. For auth, control can identify itself the same way nodes do: with the naclbox proof. To get control's public key, derp nodes could just ask for it from https://login.tailscale.com/your-pub-key.
I don't know that the race condition matters much. What's the adverse side-effect that's addressed by fixing it?
delaying lgtm in principle, but it's going to be threading more synchronization into LocalBackend, which is already quite hairy and in need of less complex state management. That's why I'm asking about what we expect to benefit.
Re: polling derp state from derp nodes: standard worry about coupling our servers to each other. No specific complaint, just that the second we have them talking to each other, we introduce the potential for coordinated or cascading failures. But we need derp to talk to control anyway, so we're just talking about degrees.
Can we make control the upstream? derp dials into control and pushes updates, rather than control dialing out? Gets around the discovery problem (how many derps where - control is the well-known point of our universe)
How do we support self-hosted derp for enterprise, or derp bundled into tailscaled? Have to be careful to not box ourselves out of that with the protocol to control. All the trickiness is going to be in the auth handshake, and knowing what keys derp is allowed to claim it's hosting (maybe end-host provides a proof using control's pubkey, which derper relays as evidence?).
This is not specific to DERP. We actually send an empty list of endpoints to the control server at startup, then immediately replace it. This is completely useless and actually causes a double-churn of the netmap every time a node starts, even if it would get exactly the same NAT mappings next time it starts.
This is not specific to DERP. We actually send an empty list of endpoints to the control server at startup, then immediately replace it. This is completely useless and actually causes a double-churn of the netmap every time a node starts, even if it would get exactly the same NAT mappings next time it starts.
I'm not sure this is something we need to do any more. #150 makes the system much less sensitive to whether the home DERP is connected or is in the process of connecting, other nodes will still be able to establish connections.
I'm not sure this is something we need to do any more. The work to fix #150 makes the system much less sensitive to whether the home DERP is connected or is in the process of connecting, other nodes will still be able to establish connections by using the return path through the same DERP.
Barring further comment, we'll expect to close this during the next regular bug scrub.
Activity
danderson commentedon Mar 24, 2020
I don't know that the race condition matters much. What's the adverse side-effect that's addressed by fixing it?
delaying lgtm in principle, but it's going to be threading more synchronization into LocalBackend, which is already quite hairy and in need of less complex state management. That's why I'm asking about what we expect to benefit.
Re: polling derp state from derp nodes: standard worry about coupling our servers to each other. No specific complaint, just that the second we have them talking to each other, we introduce the potential for coordinated or cascading failures. But we need derp to talk to control anyway, so we're just talking about degrees.
Can we make control the upstream? derp dials into control and pushes updates, rather than control dialing out? Gets around the discovery problem (how many derps where - control is the well-known point of our universe)
How do we support self-hosted derp for enterprise, or derp bundled into tailscaled? Have to be careful to not box ourselves out of that with the protocol to control. All the trickiness is going to be in the auth handshake, and knowing what keys derp is allowed to claim it's hosting (maybe end-host provides a proof using control's pubkey, which derper relays as evidence?).
apenwarr commentedon Apr 22, 2020
This is not specific to DERP. We actually send an empty list of endpoints to the control server at startup, then immediately replace it. This is completely useless and actually causes a double-churn of the netmap every time a node starts, even if it would get exactly the same NAT mappings next time it starts.
bradfitz commentedon Nov 17, 2020
FWIW, this is now fixed in 1.2.x.
DentonGentry commentedon Mar 11, 2022
I'm not sure this is something we need to do any more. #150 makes the system much less sensitive to whether the home DERP is connected or is in the process of connecting, other nodes will still be able to establish connections.
DentonGentry commentedon Aug 27, 2022
I'm not sure this is something we need to do any more. The work to fix #150 makes the system much less sensitive to whether the home DERP is connected or is in the process of connecting, other nodes will still be able to establish connections by using the return path through the same DERP.
Barring further comment, we'll expect to close this during the next regular bug scrub.
DentonGentry commentedon Oct 30, 2022
Closing as sufficiently addressed.