## 5 Proposed Method
### Description
#### 5.1.1 Detection of Jamming Attack on a Node Using Fuzzy Inference System  
Definition: Fuzzy Sets and Membership Functions  
[PERSON] _et al._[17] define fuzzy sets and membership functions as below.  
If \(X\) is a collection of objects, called the universe of discourse (uod) denoted generically by \(x\), then a fuzzy set \(A\) in \(X\) is defined as a set of ordered pairs:\[A = \left\{\left(x,\ \mu_{A}\left(x\right)\right):x{\in}X\right\} \tag{1}\]  
where \(\mu_{A}\left(x\right)\) is called the membership function (MF) for the fuzzy set \(A\). The MF maps each element of \(X\) to a membership grade (or membership value) between 0 and 1.  
In simple terms, fuzzy means one which cannot be quantified crisply, e.g., the set _'Tall'_ defined over the universe of discourse, _'Height'_ (measurable in cm), may mean different things for different people. Some may consider persons of height 180 cm or more to be tall, while for others a person of height 175 cm may also be tall. Therefore, the set _'Tall'_ is a fuzzy set. It must be noted that while the set 'Tall' defined over universe of discourse _'Height'_ ( which may generically be denoted by _h_), is fuzzy, the universe of discourse _'Height'_ is a crisp set because its members will assume crisp quantifiable values in cm.  
Fuzzy logic is a computational paradigm that provides a mathematical tool for representing and manipulating information in a way that resembles human communication and reasoning process [15]. We define three fuzzy sets each over the two universes of discourse (inputs), SNR and PDPT: LOW, MEDIUM, and HIGH. Four fuzzy sets are defined over the universe of discourse, JI: NO (meaning normal), LOW, MEDIUM, and HIGH. We use Mamdani model [16], where SNR and BPR (or, PDPT) are the crisp inputs to the system and JI is the crisp output obtained from the system after defuzzification using the centroid method.  
5.1.1.1. Fuzzification Process  
Multiple sets of two crisp inputs, SNR and PDPT, as generated through NS2 simulations (the simulation set up will be described in Section 6) are first mapped into fuzzy membership functions. A trapezoid shape is chosen to define fuzzy membership functions, because of two reasons: firstly, it can be mathematically manipulated to be very close to the most natural function, the Gaussian or Bell function, and secondly, it can be easily manipulated to be an unsymmetrical function (as required in the instant case) where the same cannot be done so easily with the Gaussian or Bell functions.  
We define the membership functions below:  
\[\mu_{set}\left(uod\right) = \left\{\begin{array}{ll}\frac{uod-a}{b-a},&a{\leq}uod\leq b\\ \\ \mathbb{I},&b{<}uod<c\\ \frac{d-uod}{d-c},&c{\leq}uod\leq d\\ \\ 0,&otherwise\end{array}\right. \tag{2}\]  
where the different values of the variables are as given in Table 2. The values of the variables, as shown in Table 2, have been fixed through two stages: firstly, as per the mean of the values obtained from the experts, and secondly, by the correction of these values through a feed-back factor generated by comparing the actual result (the output, JI of the system) and the expected result (the JI value, as expected by the experts). The graphical representations of these trapezoidal functions in respect of SNR, PDPT, and JI are shown in Figures 1, 2, and 3, respectively.  
**Figure 1**. Graphical representation of the trapezoidal function for the input signal-to-noise ratio (SNR).  
**Figure 2**. Graphical representation of the trapezoidal function for the input bad packet ratio (BPR) or packets dropped per terminal (PDPT).  
**Figure 1**. Graphical representation of the trapezoidal function for the input signal-to-noise ratio (SNR).