An Energy-Aware Framework for Reliable and Secure End-to-End Ubiquitous Data Communications