In this paper, we introduce topology-based distributed hash tables (T-DHT) as an infrastructure for data-centric storage, information processing, and routing in ad hoc and sensor networks. T-DHTs do not rely on location information and work even in the presence of voids in the network. Using a virtual coordinate system, we construct a distributed hash table which is strongly oriented to the underlying network topology. Thus, adjacent areas in the hash table commonly have a direct link in the network. Routing in the T-DHT guarantees reachability and introduces low hop-overhead compared with the shortest path.