perlin-network / noise

A decentralized P2P networking stack written in Go.
https://godoc.org/github.com/perlin-network/noise
MIT License
1.78k stars 213 forks source link

Indirect routing #297

Open elgohr opened 3 years ago

elgohr commented 3 years ago

test

The example above describes a scenario with 3 peers. One acts as a provider and two clients would like to get information from that provider. Due to network restrictions only one of the two clients is able to communicate with the provider, but both clients are able to connect to each other.

After estabilishing the network, kademlia.New().Discover() shows the correct routes.

Provider knows Allowed_Client
Allowed_Client knows Provider and Blocked_Client
Blocked_Client knows Allowed_Client

In this scenario it would be great to have a way that SendMessage would use id node.ID instead of addr string. E.g.: SendMessage(ctx context.Context, id ID, msg Serializable) error In this way Blocked_Client could send a message to Provider without knowing that it has to pass Allowed_Client.

At the moment this has to be done somehow manually. To me this is somehow strange, as the routing is already implemented and correct.