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
Currently DERP does asymmetric routing. If A and B have different home nodes (say, SF and NY), then A sends to B via NY and B sends to A via SF.
But there's an optimization we could do:
One of the packets has to arrive first. When A (connected to its home node SF), gets a packet from B via DERP SF, it can add a "DERP routing table entry" for that public key to go via that specific DERP TCP connection, keeping that routing entry alive until either: a) the TCP connection dies (for whatever reason), or b) the server sends a "previous sender disconnected" frame.
So then the server would just need to keep track of all the public keys that have sent a node a message, and upon a TCP connection, the DERP SF server can tell A that B is disconnected, and A can remove its routing table entry.
So now, when A wants to send a reply packet (or any packet) to B, it first looks to see if it has an explicit DERP route for B, otherwise it falls back to using B's DERP home node. That also means less latency on the first reply, since it doesn't need to do the TCP+TLS+DERP round trips to set up the connection. And it minimizes overall connections & memory use.
Again, this is just an optimization (that should trigger a lot; we could add varz) and the fallback behavior would be the same as today.
Note that this might not be optimal at all: in general (and to way overgeneralize, sigh), packets leaving a cloud provider we get charged for, while packets entering a cloud provider we don't. If someone wants to run their own DERP server inside their own network, we'd like to use that whenever possible for incoming packets - it (in theory) won't cost anything to retransmit them to machines on the same LAN. Whereas a DERP relay hosted elsewhere, even colocated with the transmitter, might pay extra fees.
Activity
derp: rename pkt to sendMsg, in prep for other types of writes
derp: send new "peer gone" frames with a previous sender disconnects
derp: send new "peer gone" frames with a previous sender disconnects
derp: send new "peer gone" frames when previous sender disconnects
[-]derp: possible protocol change to reduce visiting DERP conns[/-][+]derp: DERP Return Path Optimization (DRPO)[/+]derp, magicsock: send new "peer gone" frames when previous sender dis…
derp, magicsock: send new "peer gone" frames when previous sender dis…
derp, magicsock: send new "peer gone" frames when previous sender dis…
derp, magicsock: send new "peer gone" frames when previous sender dis…
derp, magicsock: send new "peer gone" frames when previous sender dis…
derp, magicsock: send new "peer gone" frames when previous sender dis…
apenwarr commentedon Apr 21, 2020
Note that this might not be optimal at all: in general (and to way overgeneralize, sigh), packets leaving a cloud provider we get charged for, while packets entering a cloud provider we don't. If someone wants to run their own DERP server inside their own network, we'd like to use that whenever possible for incoming packets - it (in theory) won't cost anything to retransmit them to machines on the same LAN. Whereas a DERP relay hosted elsewhere, even colocated with the transmitter, might pay extra fees.
13 remaining items
wgengine/magicsock: remove a per-DERP-packet map lookup in common case
DentonGentry commentedon Mar 11, 2022
Fixed in 1.22.0 by #3730
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff …
derp: refactor DERP server's peer-gone watch mechanism
derp: refactor DERP server's peer-gone watch mechanism
derp: refactor DERP server's peer-gone watch mechanism
derp: refactor DERP server's peer-gone watch mechanism
derp: refactor DERP server's peer-gone watch mechanism
derp: refactor DERP server's peer-gone watch mechanism