Wireless sensor networks (WSNs) are increasingly gaining impact in our day to day lives. They are finding a wide range of applications in various domains, including health care, assisted and enhanced-living scenarios, industrial and production monitoring, control networks, and many other fields. In future, WSNs are expected to be integrated into the Internet of Things , where sensor nodes join the Internet dynamically, and use it to collaborate and accomplish their tasks.