Building resilient low-diameter peer-to-peer topologies