Network architecture documents the key differences between ad hoc and sensor networks. Ad hoc networks allow nodes to communicate directly with each other in a peer-to-peer fashion, while sensor networks have dedicated source nodes that sense data and sink nodes that receive the data. Sensor networks also employ in-network processing techniques like data aggregation to reduce energy costs of transmitting all raw data. Routing in wireless sensor networks faces challenges from limited node resources, topology changes, and energy constraints that require routing protocols to be scalable, fault-tolerant and energy-efficient.