Implementation of the SLEEP protocol.