In this work, we present protocols for routing, MAC and power-control in sensor networks and jointly optimize these protocols. The joint optimization aims to capture the impact of cross-layer interaction on the efficiency and performance of the protocol stack. We model the protocol stack as a whole, rather than a collection of individually modeled layers. In our model, the protocol stack has tunable parameters that affect the operation of each layer to achieve globally specified performance and efficiency. In the paper, we begin by presenting the randomized protocols at each layer that exploit node density in order to achieve reliable communication. First, we present a region-based opportunistic routing protocol. Then, at the medium access layer, we consider an asynchronous rendezvous scheme called TICER. Third, a randomized sleep discipline is set forth that allows nodes to power down periodically. Finally, we combine the routing, MAC and power-control protocols to obtain a constrained optimization problem. Results show that it is possible to minimize energy consumption while satisfying application requirements on end-to-end delay.