Revert "Revert "dht protocol extension""

This reverts commit 8195b7ce3530c2694d7c52e95e79434e9caac1d3.
DHT refactoring