Hi,
I have a general(maybe dumb) question about how IPFS decides from which node to get a resource.
E.g:
User 1(India) adds a resource
User 2(USA, NY) gets and pins that resource
User 3(USA, Washington, D.C) wants that resource.
User 3 will get the resource from which node?
Does IPFS take into account the proximity?
Thanks.
IPFS white paper says:
IPFS nodes require a routing system that can find (a) other peersâ network addresses and (b) peers who can serve particular objects. IPFS achieves this using a DSHT based on S/Kademlia and Coral
But currently the implementation in IPFS is Kademlia.
Kademlia is a little complex, not easy to describe in short.
You can refer to https://en.wikipedia.org/wiki/Kademlia
Or video https://www.youtube.com/watch?v=WqQRQz_XYg4, it describes âPastry DHT algorithmâ, similiar to âKademlia DHT algorithmâ
In Draft 3 Juan Benet says the IPFS uses a mix of Coral and S/Kademlia but I was wondering if there are multiple eligible nodes that have the resource, it takes into account the proximity, the bandwith, etc?
The DHT is used to advertise and find peers that can provide requested pieces of content. But unless Iâm mistaken, bitswap is a significant part of determining which peers are involved in fulfilling a given request.
The bitswap spec documentation seems to be in flux, but for reference here it is.
The implementation used in go-ipfs is here:
Since itâs related to DHTâŚ
Letâs say we have node A, B, C.
âAâ looks for a hash: Aâ>Bâ>C (has this hash).
âBâ will update his own DHT with the pair (hash, NodeID_C) ?