Garnet: A Middleware Architecture for Distributing Data Streams Originating in Wireless Sensor Networks