1. A sensor node for operation in a sensor network, comprising: a plurality of sensors each characterized by associated sensor attributes; a memory storing computer code defining a set of cluster rules defining formation of a cluster, each cluster rule defining a set of cluster membership attributes and corresponding cluster membership attribute values required of each of the plurality of sensors for membership in the cluster and computer code defining a cluster formation function is configured to form a given cluster comprising the sensors characterized by the sensor attributes with corresponding sensor attribute values specified by at least one of the cluster rules and wherein the cluster formation function is further configured to program at least one of the plurality of sensors of the given cluster to perform a respective function associated with its sensor attribute value of a given sensor attribute that is common to all sensors in the given cluster; and a processor for executing the computer code stored in the memory, wherein the plurality of sensors and the processor are connected to a network and addressed as a single entity.