## 4 Proposed Approach
### Priority Assignment Unit
#### 4.3.2 Priority Assignment Protocol  
After detecting events and defining their priorities, sensors are associated to priority levels. Every \(\Delta_{t}\), a new _PS_ will be created and, if it has at least one element, the real sensors have to be notified about the new priority they must use. Actually, there are different ways to send messages to the proper sensors, with different particularities. Whatever the case, we are particularly interested in mechanisms that consume few resources and that present scalability and low-complexity characteristics.  
First, the PAA computes a _PS_ list that contains the information of zero or more sensors, using the formalisms adopted in this article. Although not explicitly defined, every sensor has a generic \"id\" that is not necessarily understood by the considered wireless sensor network, but that may be easily mapped to a valid id or network address, according to the employed MAC and routing protocols. However, how it will be performed is out of the scope of this work, making the TwitterSensing approach suitable for any communication technologies and network designs.  
An important research area of wireless sensor networks is sensors reconfiguration [7; 73]. Actually, after nodes deployment and initial operation, sensors may need to be reconfigured to perform some additional or different task. To allow reconfiguration of sensor nodes, special control messages have to be delivered over the network, informing about the requested reconfiguration. We borrow this principle to define the Priority Assignment Protocol (PAP), which is responsible to notify sensor nodes about a new priority value to be used. Although the TwitterSensing approach does not necessarily define a reconfiguration, the same principle may be employed, once a new parameter value will be assigned.  
The operation of PAP is based on broadcast of a specific control message. As _PS_ contains only the sensors that need to change their priority value, it may be transmitted on few messages (maybe only one). Message broadcasting in wireless sensor networks is often implemented and already supported by many protocols [74], since basic services such as \"querying\" are usually supported in many WSNapplications. Finally, such solution keeps the proposed approach scalable and independent of the employed MAC and routing protocols in the considered wireless sensor networks.  
The Priority Assignment Protocol defines a single message, defined as the Priority Message (PM). It is a simple message with \(N\) Priority Fields, with each of these fields composed of 4 bytes. The first two bytes is reserved for the \"id\" of the sensor, resulting in \(2^{16}\) possible values. Actually, the \"id\" field may be mapped to network addresses by the sink, but due to compatibility reasons, the operation details were left outside the definition of the Priority Assignment Protocol. The second field of PM is the \"priority\" field, which also sizes 2 bytes. Together, the \"id\" and \"priority\" fields are able to transmit all necessary information in \(PS\) for the considered WSN. Nevertheless, different strategies could also consider the values of \(s.x\) and \(s.y\) to locate sensors and assign the proper priority, according to the adopted sensors localization strategies [43; 44].  
Finally, it is worth mentioning that all sensors must to be able to process PAP PM broadcast messages, but only sensors indicated in the PAP PM message will consider the corresponding value in the \"priority\" field.