What are the distance functions so far implemented to find the distance between two nodes in distributed networks like p2p? i mean if each leaf node in a p2p tree network represents some data, there should be some defined ways to find distance between these nodes. I want to know the general practices and the distributed functions that help us to determine the similarity between these nodes. If my question itself is wrong please forgive me.
I can think of a few distance functions like this. It depends on what your application cares about. What are you using this distance function for?
- Latency. When nodes talk to each other they directly measure the Round Trip Time (RTT).
- Bandwidth. When nodes talk to each other they directly measure their bytes/sec transfer rate.
- IP prefix. Nodes with very similar IPs are probably close together, so 149.89.1.24 and 149.89.1.100 are probably very close together. This is a very coarse heuristic.
My advice is to directly and continuously measure whatever you pick as your distance metric. The distance metric will change over time, so measure it continuously. Any estimate that isn't based on the individual nodes taking measurements is likely to be wildly inaccurate. You should also remember that network distances are asymmetric. Packets the flow from node A to node B might take an entirely different route than those flowing from B to A.
What are the distance functions so far implemented to find the distance between two nodes in distributed networks like p2p?
It depends of the method you are using (see CAN, Kademlia, Pastry (DHT), Tapestry (DHT), Koorde). But keep in mind that these distances are theoretical and not necessarily pratical.
In a real P2P implementation on ipv4, all NAT-ed peers only need a reachable peer with a public address. Meaning the 'distance' between two private peers is at most 2.
精彩评论