Priority-based bandwidth allocation in wireless sensor networks