1. A device node, comprising: a processor running an operating system including an application layer; and memory in communication with the processor, the processor configured to: receive by an application layer manager that tracks an index of current functions running in the device at least one rule for execution by the application layer of the device node as one or more independent software agents that are received from a first tier of a plurality of tiers of a sensor network, with the one or more software agents being one or more dynamically loaded root functions that include either a duplication of the at least one rule or a modified version of the at least one rule; transfer function control to the received at least one rule by the application layer either changing the index or asking the application layer manager to change the index and to verify that a transition to the received at least one rule is an allowed transition; and execute the at least one rule included in the independent software agent by the operating system of the end-node according to an established function priority for the device node.