Updated discovery protocol. Ported  to Python3.3