Fleshed out the discovery protocol.