Overlay networks are a beneficial approach to designing robust and specialized networks on top of the generic IP architecture, and have been applied to the operation of mesh and mobile ad hoc networks. Unfortunately, when routing between entities in the overlay, inefficiencies are incurred due to potential ''back tracking'' that arises because of the discrepancies between the overlay and underlay topologies. In this paper, we minimize the ''back tracking'' problem by applying physical contexts shared by the network layer with the overlay so as to efficiently guide application flow. We have devised an intelligent cluster head and path selection algorithm for our overlay routing and compared its performance with the popular Chord protocol and a baseline AODV routing protocol. Simulation results indicate that: 1) the integration between logical and physical routing gives a large improvement in the number of hops for each transmission path; and 2) the selection of a good cluster head has only a moderate increase in transmission time.