Underwater sensor networks will find applications in oceanographic data collection, pollution monitoring, offshore exploration, disaster prevention, assisted navigation, and tactical surveillance applications. In this paper, the problem of data gathering in a 3D underwater acoustic sensor network is investigated at the network layer, by considering the interactions between the routing functions and the characteristics of the underwater channel. Two routing algorithms are proposed for delay-insensitive and delay-sensitive sensor network applications, respectively. The proposed distributed algorithm for delay-insensitive applications allows each node to select its next hop, with the objective of minimizing the energy consumption taking into account the varying condition of the underwater channel. A centralized algorithm for delay-sensitive routing in an underwater environment is proposed. The solution relies on topology information gathered by a surface station, which optimally config...