Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reroute Around Dead Links #787

Open
dnwiebe opened this issue Apr 26, 2024 · 0 comments
Open

Reroute Around Dead Links #787

dnwiebe opened this issue Apr 26, 2024 · 0 comments

Comments

@dnwiebe
Copy link

dnwiebe commented Apr 26, 2024

The ProxyServer contains three hash maps keyed by StreamKey that contain information about persistent routes through the MASQ network: virtual connections between the browser and a server. When either the browser or the server shuts down the TCP connection it has with its Node, the corresponding StreamKey becomes worthless and is removed from all three of these hash maps.

When a Node receives Gossip showing that a neighborship in the network has disappeared, it's possible that some of the persistent routes held by the ProxyServer are invalidated. However, there is no mechanism for informing the ProxyServer of destroyed neighborships, so the ProxyServer keeps those (now inoperative) persistent routes in its hash maps, and user traffic over them will suddenly start timing out (after two minutes, for most browsers).

Modify the code so that:

  • When an existing neighborship disappears from the NeighborhoodDatabase, a message about that fact is sent to the ProxyServer.
  • The ProxyServer will look through its stream_key_routes hash map for routes (use the ExpectedServices) that involve that neighborship. Any routes that are identified should be removed from stream_key_routes and keys_and_addrs.
  • For each route removed, a new route to the same exit Node is demanded from the Neighborhood.
  • If the Neighborhood can make such a route, it is entered in stream_key_routes and keys_and_addrs under the same StreamKey as before, so that future traffic will follow the new route without interruption.
  • If the Neighorhood cannot make such a route, the StreamKey should be retired from the tunneled_hosts hash map as well, and the TCP stream to the browser explicitly closed.
  • Of course, if the Node that disappeared or went routes_data = false is an exit Node in any of the ProxyServer's stored routes, those routes are worthless and should be discarded and their connections closed, so that the browser can revive them and start new TLS sessions.

Note: Be sure to find all the ways a neighborship can disappear. Gossip is a very common way (don't forget that Nodes can not only completely drop neighborships, but they can also set their routes_data flag to false, whereupon their neighborships become just as useless for routing or exiting as if they had been completely dropped), but there's also the RemoveNeighborMessage. There may be other ways as well.

@kauri-hero kauri-hero moved this to Ready for Development in MASQ Node v2 May 19, 2024
@github-project-automation github-project-automation bot moved this to Ready for Development in MASQNode Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Status: Ready for Development
Development

No branches or pull requests

1 participant