You can start by looking at smak.cc and smak.h files. These protocols incorporate sleep /wake up cycle required for sensor networks. Also 802.15.4 implementation on ns can ne the next thing to look at.
This is a tutorial I have found very useful for deeper understanding (after reading Marc Greis' tutorial) http://nile.wpi.edu/NS/ Hope that helps Sourabh Bora