Peer-to-Peer computing is mainly based on the virtual overlay network constructed in the application layer. Often, there is topology mismatching between the overlay network and the physical network, which may cause great traffic overhead. In this paper, we study the topology mismatching problem and its impact on communication in wireless ad hoc networks. We present an efficient, fully distributed algorithm, named D-TAOC, for constructing the overlay network. By qualitative analysis and simulation experiments, we show that D-TAOC can significantly reduce the traffic overhead while slightly sacrificing the routing efficiency. We also prove that D-TAOC works well in a dynamic peer-to-peer environment.