11

I am aware of the advantages of UDP, but why not allow a choice? Since since Tor requires the use of TCP, why have Ethereum developers elected not to support TCP for discovery?

Sam
  • 368
  • 2
  • 8

1 Answers1

12

UDP-based discovery is one of the main paradigms of peer discovery.

For example, Universal Plug and Play (UPnP) uses the UDP-based Simple Service Discovery Protocol (SSDP), and BitTorrent has a UDP-based Local Peer Discovery protocol.

The general method is to multicast (broadcast?) over UDP and see who responds. The fact that UDP is unreliable - i.e. in short, it doesn't care about responses, in contrast to TCP - means it's not waiting around for responses from peers that don't exist, or which had previously existed but which are no longer online.


If we poke around a little closer in Ethereum's RPLx specification - where "RLPx is a cryptographic peer-to-peer network and protocol suite" - we see that Ethereum's node discovery is based on Kademlia, "a distributed hash table for decentralized peer-to-peer computer networks", which... uses UDP.

Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144