This is a rust implementation of the Discovery v4 peer discovery protocol.
For comparison to Discovery v5, see discv5#comparison-with-node-discovery-v4
This is inspired by the discv5 crate and reuses its kademlia implementation.
The discovery service continuously attempts to connect to other nodes on the network until it has found enough peers. If UPnP (Universal Plug and Play) is supported by the router the service is running on, it will also accept connections from external nodes. In the discovery protocol, nodes exchange information about where the node can be reached to eventually establish RLPx sessions.
The discv4 protocol depends on the local system clock. If the clock is not accurate it can cause connectivity issues because the expiration timestamps might be wrong.