Distributed detection of node replication attacks in sensor networks