Latency-constrained aggregation in sensor networks