## 4 Fuzzy Logic Controller Design  
In this section, the fuzzy logic controller in the proposed FLC-QM scheme (Figure 2) will be designed. For simplicity, the subscript \(i\) in variables will be omitted wherever possible. As mentioned above, the role of the fuzzy logic controller is to determine the sampling period based on current deadline miss ratio and its setpoint. Figure 3 shows the inner structure of the fuzzy logic controller. There are two inputs, the deadline miss ratio control error \(e(k)\) and the change in error \(de(k)=e(k)-e(k\)-1). Let \(DMR_{R}\) be the desired deadline miss ratio, then \(e(k)=DMR_{R}-DMR(k)\). The output of the fuzzy logic controller is the change in sampling period \(dh(k)=h(k\)+1) - \(h(k)\).  
The fuzzy logic controller is composed of four main components [25]: fuzzification interface, rule base, inference mechanism, and defuzzification interface. Once activated at the \(k\)-th instant, the fuzzification interface translates numeric inputs \(e(k)\) and \(de(k)\) into fuzzy sets characterizing linguistic variables \(E\) and \(DE\). The inference mechanism then applies a predetermined set of linguistic rules in the rule-base with respect to these linguistic variables, and produces the fuzzy sets of the output linguistic variable \(DH\). Finally, the defuzzification interface converts the fuzzy conclusions the inference mechanism reaches to a numeric value \(dh(k)\).  
In this paper, the universes of discourse for \(e\), \(de\), and \(dh\) are chosen to be [-0.2, 0.1], [-0.2, 0.2], and [-1.5, 3] (in ms), respectively. Both sets of the linguistic values for the linguistic variables \(E\) and \(DE\) are {NB, NS, ZE, PS, PB}, and the set of linguistic values for DH is {NB, NM, NS, ZE, PS, PM, PB}, where NB, NM, NS, ZE, PS, PM, and PB represent _negative big_, _negative medium_, _negative small_, _zero_, _positive small_, _positive medium_, and _positive big_, respectively. Figure 4 depicts the membership functions used in this paper for all linguistic values for both input and output linguistic variables. As shown in Table 1, 25 linguistic rules are built altogether.  
Figure 3: Inner structure of fuzzy logic controller.  
Figure 4: Input and output membership functions.  
Figure 5: Input-output surface.  
\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multirow{2}{*}{DH} & \multicolumn{6}{c}{DE} \\ \cline{3-8}  & \multicolumn{1}{c}{NB} & \multicolumn{1}{c}{NS} & \multicolumn{1}{c}{ZE} & \multicolumn{1}{c}{PS} & \multicolumn{1}{c}{PB} \\ \hline  & NB & PB & PB & PB & PM & PS \\  & NS & PM & PS & PS & ZE & ZE \\ E & ZE & PS & ZE & ZE & ZE & NS \\  & PS & ZE & ZE & NS & NS & NM \\  & PB & NS & NS & NM & NB & NB \\ \hline \hline \end{tabular}
\end{table}
Table 1: Linguistic rules.  
For the inference mechanism, the max-min method is adopted. In the defuzzification interface, the most popular _centre of gravity_ method is used to produce a real number in the universe of discourse of the output. The input-output surface of the fuzzy logic controller is depicted in Figure 5, which describes more straightforwardly the mapping between the inputs to the output conceived by Figure 4 and Table 1.  
With FLC-QM, different fuzzy logic controllers can be used in different source nodes. In particular, the deadline miss ratio setpoint and the invocation interval may be different from one another. In this way, multiple types of traffic with different QoS requirements can be supported simultaneously. For simplicity, this paper uses the same values of \(DMR_{R}\) and \(T_{FLC}\) in all QoS managers.