TREnD: A timely, reliable, energy-efficient and dynamic wsn protocol for control applications