We present a distributed algorithm for localization of nodes in a discrete model of a random ad hoc communication network. We compute the expected value of the position estimate, AS, and the probability that AS = 1 cell (the perfect estimate). This leads to bounds of the average complexity of the algorithm at each node.