## 3 QoS Management Architecture  
In a WSAN, as shown in Figure 1, there are typically lots of sensors coexisting with multiple actuators. Sensors collect information about the state of physical environment, such as the temperature and light inside a room, the occurrence of a fire, and the velocity of a mobile robot, and send corresponding messages to actuators via the wireless channel. Upon receipt of the sensed data, actuators make a decision on how to react and perform the actions on the physical world accordingly. The data transmission from a sensor to an actuator can be in a single-hop or multi-hop style. A sensor that generates original measurement data characterizing the state of physical world is called a _source_ (sensor) node. In a multi-hop transmission, all other sensors except for the source node are _intermediate_ nodes. In practice, a source node can also serve as an intermediate node for transmitting messages from other nodes. For simplicity, it is assumed that a source node needs to send its measurements to only one specific actuator. In addition to sensors and actuators, a base station, also referred to as sink, may be used for network management and node coordination (particularly actuator coordination). The QoS of a WSAN can be affected by many factors. In the case of node movement, node removal or addition, or system update or reconfiguration, it is most likely that the network topology, routing, and node traffic load will change. This can then result in variations in network QoS attributes such as transmission delay, packet loss rate, and utilization. In some situations, the QoS of WSANs may become unsatisfactory when delay and/or packet loss rate are too large. Therefore, QoS management paradigms are needed to enhance the flexibility and adaptability of WSANs with respect to the changing network conditions. To meet this requirement, a fuzzy logic control based QoS management (FLC-QM) scheme is proposed in this section. The basic idea of the FLC-QM scheme is to adapt the sampling period of each source sensor at run time such that the deadline miss ratio associated with the real-time data transmission from the source node to the actuator is maintained at a pre-determined desired level. Practically, both a delay larger than the deadline and a loss of packet can be regarded as deadline misses. When the sampling periods of sensors decrease, the traffic load on the network will increase. As a result, the probability of node collisions increases, leading to potential increases in both delay and packet loss rate. Therefore, increasing sampling periods can normally reduce deadline misses [16]. However, too large sampling periods will adversely cause low utilization of the network bandwidth resource. In some applications such as sampled-data control [17], smaller sampling periods may be preferable because the system performance will degrade with increasing sampling periods. For these reasons, this paper proposes to control the deadline miss ratio at a non-zero level. This can achieve high utilization of network resource while limiting the magnitudes of delay and packet loss rate within an acceptable range. In FLC-QM, a separate QoS manager will be designed for each source sensor node to adjust its sampling period with respect to the deadline miss ratio associated with the transmission of its measurements to the actuator, as shown in Figure 2. Consider a wireless connection from source sensor \(s_{i}\) to actuator \(a_{j}\). There could be some or no intermediate sensors between \(s_{i}\) and \(a_{j}\). The QoS manager exploits the fuzzy logic control technique and operates in a time-triggered manner. Let \(T_{FLC}\) denote the invocation interval of the fuzzy logic controller. During each invocation interval, the actuator \(a_{j}\) records the deadline misses related to data packets from \(s_{i}\). A deadline miss occurs if \(a_{j}\) does not receive a data packet by its deadline. At the end of each invocation interval, the deadline miss ratio D  
Figure 1: Topology of a WSAN.