0

I was looking at a few implementations on GitHub of Kademlia in Java, but I haven't found anything that works without manually port forwarding the routers on which the items are (whether through hole punching or UPnP) and is still actively updated. Are there any libraries for this that any of you could recommend?

If not, how would I go about implementing this myself? I'm relatively familiar with the Kademlia paper, but I'm not very familiar with networking in Java.

EDIT: I've been informed that hole punching is useless for DHT's. As such, I'm still wondering if there are any java Kademlia libraries utilizing UPnP that are maintained, or any information on how to use UPnP for a java program that I write.

Lev Knoblock
  • 611
  • 2
  • 6
  • 20

1 Answers1

0

but I haven't found anything that works without port forwarding

That is because kademlia requires port forwarding - or NATs performing endpoint independent port mappings - for proper operation. Nodes behind NATs may still work as consumers, but they are basically parasitizing the reachable nodes.

In that case, I'm asking for recommendations on Kademlia libraries utilizing UPnP, or any information on how to use UPnP for a java program.

Recommending libraries is offtopic on SO. So just google for one or implement it yourself to combine with a DHT library. You may also want to look into NAT-PMP and NAT-PCP in addition to UPnP-IGD

Community
  • 1
  • 1
the8472
  • 40,999
  • 5
  • 70
  • 122
  • Could you explain what you mean by "parasitizing" other nodes? Why are they worse than the others? – Lev Knoblock Apr 07 '18 at 10:26
  • Resources they contribute vs. resources they consume – the8472 Apr 07 '18 at 10:54
  • Could you elaborate on that? I don't understand how one node providing to the network through a NAT would be parasitizing. – Lev Knoblock Apr 07 '18 at 11:08
  • *providing to the network through a NAT* - Your question is about being behind a NAT without properly mapped ports. How is it supposed to provide resources under such circumstances? – the8472 Apr 07 '18 at 14:12
  • The same way other P2P protocols still manage to have communication and data sharing without a manual port forward? Through hole punching and/or UPnP? – Lev Knoblock Apr 07 '18 at 14:24
  • UPnP is just another form of port forwarding, so that's already excluded from the argument. Hole Punching with address-dependent mappings is nearly useless for DHTs, it only works with EIMs. – the8472 Apr 07 '18 at 14:37
  • In that case, I'm asking for recommendations on Kademlia libraries utilizing UPnP, or any information on how to use UPnP for a java program. – Lev Knoblock Apr 07 '18 at 14:42