Improving the Accuracy Rate of Link Quality Estimation Using Fuzzy Logic in Mobile Wireless Sensor Network

Link quality estimation is essential for improving the performance of a routing protocol in awireless sensor network.Manymethods have been proposed to increase the performance of the link quality estimation; however, most of them are not able to evaluate link quality accurately. In this study, a method that uses fuzzy logic to combine both hardware-based and software-based metrics is proposed to improve the accuracy rate for evaluating a link quality. This proposed method consists of three types of modules, the Fuzzifiermodule, the Inferencemodule, and the Defuzzifier module.The Fuzzifiermodule is used to determine the degree to which input link quality metrics belong to each fuzzy set through proposedmembership functions.The Inferencemodule obtains the rule outputs based on the proposed fuzzy rules and the given inputs acquired from the Fuzzifiermodule.TheDefuzzifier module is used to aggregate the rule outputs inferred from the Inference module. The result from the Defuzzifier module is then used to evaluate the link quality. A simulation conducted to compare the accuracy rates of the proposed method and those found in related works showed that the proposed method had higher accuracy rates for evaluating a link quality.


Introduction
A wireless sensor network (WSN) is a wireless network that is composed of a group of spatially dispersed sensor nodes with a radio transceiver [1].These sensor nodes are used to monitor the physical conditions of the environment and transmit the collected data to a sink [2].WSN is widely applied in many sectors such as in military, industry, and environmental monitoring [3,4].WSN relies on the sensor nodes to transmit packets.These sensor nodes normally have limited power supply due to their small sizes, and their transmission rates are affected by many factors [5,6].
Link quality is a significant factor that affects transmission rates of sensor nodes and link quality metrics are used to evaluate a link quality [7].There are two types of link quality metrics: hardware-based and software-based [8].Hardwarebased metrics are acquired directly from radio transceivers, with some examples being Received Signal Strength Indicator (RSSI), Link Quality Indicator (LQI), and Signal to Noise Ratio (SNR).Software-based metrics are obtained through a calculation that is made in accordance with the received packet statistics, for instance, Packet Reception Ratio (PRR).Different types of link quality metrics have different characteristics.For example, hardware-based metrics evaluations can reflect changes in link quality in real time [9].On the other hand, software-based metrics can evaluate the link quality more accurately than hardware-based metrics [10].However, using only software-based metrics to evaluate a link quality cannot capture link quality changes in real time [11].Therefore any proposed method ought to take into account the varying characteristics of hardware-and software-based metrics.
In this paper, we propose a link quality estimation method that uses fuzzy logic to evaluate both hardwarebased and software-based metrics.This method is different from common link quality estimation methods that use only the same one type of link quality metrics.The crucial innovation of our proposed method is that we use fuzzy 2 Advances in Fuzzy Systems logic to combine hardware-based and software-based metrics to improve accuracy rates when estimating a link quality.The rest of this article is organised in the following way.In Section 2, existing link quality estimation methods are reviewed.Then the architecture and details of the proposed method are discussed in Section 3. The methodology used and the simulation settings are explained in Section 4. The simulation results of the proposed method compared with other methods are illustrated in Section 5. Finally a conclusion is given in Section 6.

Literature Review
A significant number of link quality estimation methods have been developed over the years.However, most of the current link quality estimation methods display low accuracy rates for evaluating link quality [10,12].Thus because the link quality metrics are usually imprecisely estimated, it can be a challenge to distinguish the link quality around thresholds [13].Here, several selected link quality estimation methods are analysed in terms of their strengths and shortcomings, including Window Mean with Exponentially Weighted Moving Average (WMEWMA) Channel State Information (CSI), Triangle Metric, effective-Signal to Noise Ratio (SNR), improved-Link Quality Indicator (LQI), Fuzzy-Link Quality Estimator (F-LQE), Optimised-Fuzzy Link Quality Estimator (Opt-FLQE), Link Quality Estimation-node (LQE-node), and End-to-End Data Delivery Reliability (E2E-DDR).
Window Mean with Exponentially Weighted Moving Average (WMEWMA) is a link quality estimation method that was proposed by [14].In this method, PRR is computed according to link measurements, and this computed PRR is filtered using the Exponentially Weighted Moving Average (EWMA) filter to avoid transient fluctuations of PRR.However, WMEWMA is not able to evaluate a link quality accurately because it cannot account for the changes in link quality quickly enough.
Channel State Information (CSI) was proposed by [15] in 2008.In this method, two hardware-based metrics, RSSI and LQI, are used to evaluate a link quality as RSSI can show good links, and LQI, bad links.The RSSI and LQI are normalised after extraction from transceivers.These normalised RSSI and LQI are then combined with the evaluated link quality for further calculation.Although CSI is simple and easy to calculate, the resultant link quality evaluations are not accurate because hardware-based metrics do not consider packet lost information.
Reference [11] suggested the Triangle Metric method to evaluate link quality.This method uses hardware-based metrics (LQI and SNR) and includes the packet lost information.The LQI and SNR are acquired from the transceiver of each receiver node.The mean values of the LQI and SNR are calculated based on the number of packets from the receiver node and the sender node.The Pythagorean theorem is then used to combine the mean values of the LQI and SNR to evaluate a link quality.The worth of this method, which considers both received packets and packet lost information, is in its capacity to evaluate a link quality more accurately when compared to other methods that use only the same type of link quality metrics.However, its shortcoming is that the link quality metrics may not be able to be estimated precisely because the link quality around thresholds is not distinguished.
Effective-Signal to Noise Ratio (SNR) is a link quality estimation method proposed by [16].The Kalman filter is used to combine SNR and LQI to obtain the effective-SNR value for evaluating a link quality.This method is able to reduce overhead problems.However, it cannot evaluate a link quality accurately because it uses only hardware-based metrics and does not consider packet lost information.
Improved-Link Quality Indicator (LQI) was suggested by [17].The LQI values of both successful and unsuccessful received packets are used to calculate the mean values of overall LQI.This method is able to improve the accuracy and efficiency of evaluating a link quality when compared to a method that only considers the successfully received packets in calculating the mean values of the LQI.However, it needs additional resources to calculate LQI values of unsuccessful received packets.Furthermore, the improved-LQI cannot evaluate a link quality between two mobile nodes accurately because it does not consider the situation where mobile nodes are not inside the transmission range of the other party.
In 2015, [13] proposed the Fuzzy-Link Quality Estimator (F-LQE) method.This method uses fuzzy logic to combine four factors that are related to link quality-packet delivery, stability, asymmetry, and channel quality.A software-based metric, PRR, is the elementary metric used to calculate the packet delivery, stability, and asymmetry while channel quality is represented by SNR, a hardware-based metric.F-LQE can improve the end-to-end packet delivery and topology stability and, at the same time, reduce the number of packet retransmissions and the hop count.However, F-LQE can only be used to determine a good link quality.Moreover, F-LQE may become unreliable because it cannot react quickly to a change of link quality when the link is in a harsh environment or under a mobile wireless sensor network.Thus, F-LQE method cannot evaluate a link quality accurately.
Optimised-Fuzzy Link Quality Estimator (Opt-FLQE) has been recommended for the evaluation of extremely unreliable links by replacing stability factor with packet retransmission [18].This method also uses fuzzy logic to combine four factors that are related to link quality, namely, packet delivery, packet retransmission, asymmetry, and channel quality.Thus this method can overcome problems that are imposed by link unreliability.However, this method cannot evaluate a link quality accurately because it can only be used to determine the good link quality.
A dedicated node, Link Quality Estimation-node (LQEnode), was proposed by [19] to evaluate link quality in 2017.This LQE-node uses hardware-based metrics (RSSI) to evaluate a link quality with the consideration of the influence and interference in multipath.The sensor nodes do not need to send broadcast probe packets or stop their operations to monitor link quality.However, this method is not able to evaluate a link quality accurately because hardware-based metrics do not consider packet lost information.
End-to-End Data Delivery Reliability (E2E-DDR) uses four metrics-the distance between nodes, the background noise, the environmental conditions, and the hardware states-to evaluate link quality.This method was proposed by [20] in 2018.It can evaluate the link quality accurately in a static wireless sensor network.However, the nodes in the mobile wireless sensor network are movable, and the distances between mobile nodes are difficult to measure.Because of this, E2E-DDR is not able to evaluate a link quality accurately in the mobile wireless sensor network.
In the above, several link quality estimation methods were analysed in terms of their strengths and shortcomings.Most of these link quality estimation methods were not able to evaluate a link quality accurately because they could not account for changes in link quality quickly enough.In addition, some of the methods used only hardware-based metrics to evaluate a link quality and did not consider the packet lost information; hence the link quality around thresholds could not be distinguished.Ideally then, improving the accuracy rate for evaluating a link quality requires a method that is able to both account for change of link quality quickly enough and reflect the packet lost information.The present study is conducted to fill this gap in the research.

The Proposed Method
This section presents the design and implementation of the proposed method, which comprises the link quality metrics, the method's architecture, and the details of the modules used.
3.1.Link Quality Metrics.Three metrics, either hardwarebased or software-based, are used in this study.These are Link Quality Indicator (LQI), Signal to Noise Ratio (SNR), and Packet Reception Ratio (PRR).Each was selected for its different characteristics.LQI can be used to distinguish a link that is bad, medium, or good [21].However, it cannot differentiate between a good link and a very good link.According to [2], SNR can be used to distinguish a link that is in either good or very good condition.In contrast with LQI, SNR cannot determine whether a link is in bad, medium, or good condition.Therefore, by combining both LQI and SNR metrics, the link quality can be categorised into bad, medium, good, or very good categories.However, LQI and SNR are hardware-based metrics, and these metrics do not consider packet lost information.Hence this might cause an overestimation of a link quality.As such, there is a need to use PRR (software-based metric) to overcome the lost packet information problem.

3.2.
The Architecture of the Proposed Method.Three types of modules, the Fuzzifier module, the Inference module, and the Defuzzifier module, are used in this study.The architecture of the proposed method is shown in Figure 1.

The Fuzzifier Module.
The Fuzzifier module is used to convert the input link quality metrics to their respective fuzzy sets based on several proposed membership functions.
There are two inputs in this module, SNR  and LQI  .The following equations are used to calculate the two inputs.
SNR  is the average value of SNR and LQI  is the average value of LQI.To overcome the inherent drawback of hardware-based metrics mentioned earlier, the proposed method uses PRR multiplied by the hardware-based metric in the calculation, where the PRR value is calculated based on the division of the number of received packets at the receiverside by the number of sent packets at the sender-side.
The classic way to evaluate a link quality is by using bad, medium, and good categories.However, recently, this classification was extended to bad, medium, good, and very good categories by [11].According to the authors, good quality links might still encounter packet lost problems.Therefore, the very good quality link was introduced to ensure a 100% successful packet transmission.We considered this distinction a significant one and, as a result, we adopted the extended classification in our work.
There are four different quality ranks of fuzzy sets in the Fuzzifier module.These are bad quality, medium quality, good quality, and very good quality.Each fuzzy set has a unique membership function to address each input metric.According to [22], a membership function is a mapping method that is derived from a space of points in the interval [0, 1].In classical logic theory, there are only two options (either 0 or 1), where the input metric either belongs to or does not belong to the set.By using a fuzzy logic approach, the parameter range can be extended.A value within the range of 0 to 1 can be used as an indicator of the degree to which the input metric belongs to the fuzzy set.In this Fuzzifier module, a fuzzy set A of a universe of discourse X = {x} is defined as A = {x; A(x) | ∀x ∈ X}, where X is a space of points and A (x) is a membership function of x ∈ X being an element of A.
We conducted preliminary experiments to obtain the thresholds of the membership functions in the Fuzzifier module.Figure 2 shows the membership function of the bad quality fuzzy set.This is determined by two thresholds-min-(medium, good, very good) and max-bad.The min-(medium, good, very good) is the minimum value of an "Input" in medium quality, good quality, and very good quality.The max-bad is the maximum value of the "Input" in bad quality."Input" is referred to as either SNR  or LQI  .
If the values of the "Input" are greater than max-bad, then the link is not of bad quality, and the value of the membership function of the bad quality fuzzy set is 0. On the other hand, if the values of the "Input" are less than min-(medium, good, very good), the link is confirmed as being of bad quality, and the value of the membership function of the bad quality fuzzy set is 1.When the values of the "Input" are within min-(medium, good, very good) and max-bad, it means that the link partially belongs to the bad quality fuzzy set and the membership function of the bad quality fuzzy set is between 0 and 1.
From the preliminary experiments that we conducted, the max-bad of SNR  was found to be 5.01 (see Figure 3(a)).The link is not a bad link if the SNR  value is greater than or equal to 5.01.The threshold of SNR  that completely belongs to the bad quality fuzzy set is 3.20.If the SNR  value is less than or equal to 3.20, the link is a bad link.Therefore, a bad link is assigned a membership function of 1 and a link that is not bad has a membership function of 0. The membership function is between 0 and 1 when the SNR  values are between 3.20 and 5.01.The max-bad of LQI  was found to be 30.11(see Figure 3(b)).The link is not a bad quality link if the LQI  value of a link is greater than or equal to 30.11.The threshold of LQI  that completely belongs to the bad quality fuzzy set is 24.77.If the LQI  value is less than or equal to 24.77, the link is a bad link.Therefore, a bad link is assigned a membership function of 1 and a link that is not bad has a membership function of 0. The membership function is between 0 and 1 if the LQI  values are between 24.77 and 30.
Figure 4 shows the membership function of the medium quality fuzzy set.The min-medium and max-medium are used to determine the range of an "Input" of the medium quality fuzzy set.The min-medium and max-medium are the minimum and maximum values of an "Input" in medium quality, respectively.If the values of the "Input" are less than the min-medium or greater than the max-medium, the link is not medium quality, and the value of the membership function of the medium quality fuzzy set is 0.
There are two cases that are used to determine whether the values of the "Input" fall within the min-medium and the max-medium.
Case 1 (max-bad is less than min-(good, very good)).If the values of the "Input" fall between max-bad and min-(good, very good), the link is confirmed as being of medium quality, and the value of the membership function of the medium quality fuzzy set is 1.On the other hand, if the values of the "Input" fall between min-medium and max-bad or min-(good, very good) and max-medium, it means that the link does not completely belong to the medium quality fuzzy set, and the membership function of the medium quality fuzzy set is between 0 and 1 (see Figure 4(a)).
Case 2 (max-bad is greater than min-(good, very good)).In this case, the average values of the "Input" (i.e., mean "Input") are computed as being between the min-medium and the max-medium of the membership function (see Figure 4(b)).If the values of the "Input" are mean, then the value of the membership function of the medium quality fuzzy set is 1.On the other hand, if the values of the "Input" fall between min-medium and mean or mean and max-medium, the membership function of the medium quality fuzzy set is between 0 and 1.
From the preliminary experiments that we conducted, the min-medium and the max-medium of SNR  were found to be 3.20 and 13.67, respectively (see Figure 5(a)).The link is not a medium link if the SNR  value of a link is less than or equal to 3.20, or greater than or equal to 13.67.Thus, the membership function of SNR  is 0 when the link is not a medium link.The thresholds of SNR  that completely belongs to the medium quality fuzzy set are 5.01 and 7.44.If the SNR  value of a link is in the range from 5.01 to 7.44, the link is a medium link.Herein, a medium link is assigned a membership function of 1.Those SNR  values that are within the range 3.20 to 5.01 or 7.44 to 13.67 are assigned membership functions between 0 and 1.
The min-medium and the max-medium of LQI  were 24.77 and 69.66, respectively (see Figure 5(b)).The link is not a medium link if the LQI  value of a link is less than or equal to 24.77, or greater than or equal to 69.66.The membership function of LQI  is 0 when the link is not a medium link.The thresholds of LQI  that completely belong to the medium quality fuzzy set are 30.11and 55.14.If the LQI  value of a link is within the range of 30.11 to 55.14, the link is a medium link, and it is assigned a membership function of 1.The LQI  values that are within the range of 24.77 to 30.11 or 55.14 to 69.66 are assigned membership functions between 0 and 1.
Figure 6 shows the membership function of the good quality fuzzy set.The min-good and max-good are used to determine the range of an "Input" of the good quality fuzzy set.The min-good and max-good are the minimum and maximum values of an "Input" of good quality, respectively.If the values of the "Input" are less than the min-good or greater than the max-good, the link is not good quality, and the value of the membership function of good quality fuzzy set is 0. There are two cases that are used to determine whether the values of the "Input" fall within min-good and max-good.
Case 1 (max-(bad, medium) is less than min-very good).If the values of the "Input" fall between max-(bad, medium) and min-very good, then the link is confirmed as being of good quality and the value of the membership function of the good quality fuzzy set is 1.On the other hand, if the values of the "Input" fall between min-good and max-(bad, medium) or min-very good and max-good, it means that the link does not completely belong to the good quality fuzzy set and the membership function of the good quality fuzzy set is between 0 and 1 (see Figure 6(a)).
Case 2 (max-(bad, medium) is greater than min-very good).In this case, the average values of the "Input" (i.e., mean "Input") are computed to be between the min-good and the max-good of the membership function (see Figure 6(b)).If the values of the "Input" are mean, the value of the membership function of the good quality fuzzy set is 1.On the other hand, if the values of the "Input" fall between min-good and mean or mean and max-good, the membership function of the good quality fuzzy set is between 0 and 1.From the preliminary experiments that we conducted, the min-good and the max-good of SNR  were found to be 7.44 and 23.91, respectively (see Figure 7(a)).If the SNR  value of a link is less than or equal to 7.44, or greater than or equal to 23.91, the link is not a good link.The membership function of SNR  is 0 when the link is not a good link.The SNR  values that are between 7.44 and 23.91 are assigned the membership function between 0 and 1.

Advances in Fuzzy Systems
The min-good and the max-good of LQI  were 55.14 and 97.87, respectively (see Figure 7(b)).If the LQI  value of a link is less than or equal to 55.14, or greater than or equal to 97.87, the link is not a good link.The membership function of LQI  is 0 when the link is not a good link.The thresholds of LQI  that completely belong to the good quality fuzzy set are 69.66 and 73.88.If the LQI  value of a link is within the range of 69.66 and 73.88, the link is a good link, and it is assigned a membership function of 1.The LQI  values that are within the ranges 55.14 to 69.66 and 73.88 to 97.87 are assigned membership functions between 0 and 1.
Figure 8 shows the membership function of the very good quality fuzzy set.The membership function of the very good quality fuzzy set is determined by two thresholds-min-very good and max-(bad, medium, good).The min-very good is the minimum value of an "Input" in very good quality.The max-(bad, medium, good) is the maximum value of the "Input" in bad quality, medium quality, and good quality.If the values of the "Input" are greater than max-(bad, medium, good), the link is confirmed as being of very good quality, and the value of the membership function of the very good quality fuzzy set is 1.On the other hand, if the values of the "Input" are less than min-very good, the link is not of very good quality, and the value of the membership function of  the very good quality fuzzy set is 0. When the values of the "Input" are within min-very good and max-(bad, medium, good), the link partially belongs to the very good quality fuzzy set and the membership function of the very good quality fuzzy set is between 0 and 1.
From the preliminary experiments that we conducted, the min-very good of SNR  was found to be 10.35 (see Figure 9(a)).If the SNR  value of a link is less than or equal to 10.35, the link is not a very good link.The threshold of SNR  that completely belongs to the very good quality fuzzy set is 23.91.Herein, the link is a very good link if the SNR  value is greater than or equal to 23.91.Such a very good link is then assigned a membership function of 1.A link that is not a very good link is assigned a membership function of 0. SNR  values that are within the range of 10.35 to 23.91 are assigned membership functions between 0 and 1.
The min-very good of LQI  was found to be 73.88 (see Figure 9(b)).A link is not a very good link if the LQI  value of a link is less than or equal to 73.88.The threshold of LQI  that completely belongs to the very good quality fuzzy set is 97.87.If the LQI  value is greater than or equal to 97.87, the link is a very good link.This link is then assigned a membership function of 1 while a not very good link is assigned a membership function of 0. The LQI  values between 73.88 and 97.87 are assigned membership functions between 0 and 1.

The Inference Module.
The Inference module is used to simulate the process of human reasoning.This module derives the rule outputs based on the proposed fuzzy rules and the given inputs obtained from the Fuzzifier module.The proposed fuzzy rules are the rules based on fuzzy sets, and they can assist the Inference module to complete reasoning.
There are two "Inputs" used (SNR  and LQI  ), but the final result of the link quality produced by both "Inputs" can only belong to one of the four qualities (very good, good, medium, or bad quality).As a result, we only need four fuzzy rules to cater for all possible combinations.The four proposed fuzzy rules are as follows: the final result of both SNR   LQI  falls within the threshold of the very good quality f uzzy set,  the link quality is very good.

Rule 2.
the final result of both SNR   LQI  falls within the threshold of the good quality f uzzy set,  the link quality is good.

Rule 3.
the final result of both SNR   LQI  falls within the threshold of the medium quality f uzzy set,  the link quality is medium.

Rule 4.
final result of both SNR   LQI  falls within the threshold of the bad quality f uzzy set,  the link quality is bad.This proposed method is based on [23], which used "andlike" and "or-like" operators instead of using the min-max logic proposed by [24] to translate fuzzy rules into mathematical expressions.The min-max logic translated AND (OR) into min (max) operator, and the result of the expression is determined using only a single value.For example, AND can only take the smallest fuzzy set value, and OR takes the largest fuzzy set value.Therefore, "and-like" and "or-like" operators can consider all values in each fuzzy set based on a weight factor .
verygood (i),  good (i),  medium (i), and  bad (i) are the membership functions values of link i for very good quality, good quality, medium quality, and bad quality fuzzy sets, respectively. lqi−verygood (i),  lqi−good (i),  lqi−medium (i), and  lqi−bad (i) are the membership functions values of LQI  for the different quality fuzzy sets. snr−verygood (i),  snr−good (i),  snr−medium (i), and  snr−bad (i) are the membership functions values of SNR  for different quality fuzzy sets.Weight factor  is a constant value between 0 and 1.The recommended value for  is between 0.5 and 0.8 [25].Therefore, the  value that is used in this study is 0.6.

The Defuzzifier Module.
The Defuzzifier module is designed to aggregate the rule outputs inferred from the Inference module.The centre of gravity (COG), one of the most commonly found methods used by many fuzzy logic systems in previous studies [26][27][28][29][30], is used to aggregate the membership function of different fuzzy sets [31].The calculation of COG used in the Defuzzifier module is stated in the equation below.

Result
bad (i),  medium (i),  good (i), and  verygood (i) are the membership functions of link i for bad quality, medium quality, good quality, and very good quality fuzzy sets, respectively.The sample points of the bad quality, medium quality, good quality, and very good quality fuzzy sets are 17.5%, 40%, 87.5%, and 100%, respectively.These sample points were calculated in accordance with the average threshold found for each of the different link qualities.Table 1 shows the results of the membership function values of both SNR  and LQI  .
After calculating the membership function values of both SNR  and LQI  , each link quality is then classified based on the rules adopted from the study of [11].The following are the classification rules and the results of the classification can be viewed in Table 2.
(i) A link is classified as a bad quality link if 0% ≤ Result < 35% (ii) A link is classified as a medium quality link if 35% ≤ Result < 75% (iii) A link is classified as a good quality link if 75% ≤ Result < 100% (iv) A link is classified as a very good quality link if Result = 100%.

Simulation Experiments
The simulation setup and initial deployment for evaluating the proposed method are shown in Table 3.We used OMNeT++ and MiXiM to simulate the packets transmission.OMNeT++ is a modular and open network simulator platform based on components.MiXiM is an extended simulator in OMNeT++.We used BaseNetwork as the environment module and Host802154 2400MHz as the node module.Host802154 2400MHz uses a transceiver based on IEEE802.15.4 standard at 2.4 GHz for wireless transmission.This setup of the experiment and its initial deployment were adapted from the study of [11] for determining better link quality criteria.The area of deployment is 240 m x 240 m.The distance between each node is 30 m.There are two types of nodes used in the simulation, the sending node and the receiving node.The sending node is responsible for broadcasting packets.The receiving node is responsible for receiving the packet and recording the data in the log file.The number of nodes used in the simulation is 81.The broadcast node or sending node is set as node[0].Other nodes are set as the receiving nodes.The transmission power of the sending node is 1 mW.The radio transceiver of nodes is 2.4 GHz Chipcon CC2420.The mobility model is Random Waypoint.The speed of the receiving nodes is 1 m/s.The speed of the sending node is 0 m/s.The total number of sending packets is 100,000, and the frequency of broadcast packets is one packet per second.After deployment, the receiving nodes are constantly moving randomly (see Figure 10).
There are two types of nodes used in the simulation-the sending node and the receiving node.The sending node is responsible for broadcasting packets while the receiving node is responsible for receiving the packet and recording the data of the received packet into the log file.According to [11], the purpose of having only one broadcast node and a sending node that does not move is to simplify the process of obtaining the required data.Although the sending node does not move, the distance between the sending node and the receiving node is changing dynamically after the initial deployment.The simulation setting and deployment are different from the real packet transmission process, but the proposed method can be used to evaluate link quality in real networks.This is because the link quality is evaluated based on the data of the received packets.Many of the benchmark methods adopt this simulation setting and deployment to evaluate a link quality.

Results and Discussion
Two evaluations are conducted in this study.These are (i) comparison of the proposed method, PRR, SNR, and LQI and Advances in Fuzzy Systems The Triangle Metric method had the second highest accuracy rates compared to the other related works except for packet sizes 1, 2, and 3.This Triangle Metric method uses the Pythagorean theorem to combine hardware-based metrics (SNR and LQI) and software-based metrics (PRR) to evaluate link quality.Nevertheless, the proposed method with its inclusion of fuzzy logic had better outcomes.
At packet sizes 1, 2, and 3, WMEWMA had the second highest accuracy rates compared to the other methods.The ranking of the accuracy rates for WMEWMA dropped from third place (at packet sizes 4, 5, and 6) to fourth (at packet sizes 7 to 19) and finally to fifth place at packet size 20.Notably, although WMEWMA used the Exponentially Weighted Moving Average (EWMA) filter to calculate PRR, its accuracy rates were still lower than those of the methods that contain both hardware-based and software-based metrics.
Improved-LQI had the lowest accuracy rate compared to those of the other methods at packet size 1.However, the accuracy rates for improved-LQI increased from packet sizes 2 up to 6 and were consistently ranked in third place from packet size 7 to 20.This improved-LQI method used both successfully and unsuccessfully received packets to calculate the mean value of LQI.It had higher accuracy rates than other hardware-based metric methods that only considered the LQI value of the successfully received packets.
The CSI method had the lowest accuracy rates when compared with the proposed method and other methods (Triangle Metric, WMEWMA, improved-LQI, effective-SNR, and LQE-node) except for packet size 1.The LQE-node and the effective-SNR methods also had lower accuracy rates when compared with the proposed method and other related works.The CSI method used normalising RSSI (hardwarebased metric) and LQI to evaluate link quality.The LQEnode also used RSSI, in which it considered the influence of the multipath and interference, to evaluate a link quality.The effective-SNR method used the Kalman filter to combine SNR and LQI to evaluate link quality.These three methods had lower accuracy rates than the proposed method and other related works as they only considered multiple hardwarebased metrics to evaluate the link quality.

Conclusion
A method that used fuzzy logic to evaluate the hardwarebased and software-based metrics was proposed to improve the accuracy rate for evaluating a link quality.The proposed method consisted of three types of modules, the Fuzzifier module, the Inference module, and the Defuzzifier module.
The Fuzzifier module was used to determine the degree to which input link quality metrics belonged to each fuzzy set using proposed membership functions.The Inference module obtained the rule outputs based on the proposed fuzzy rules and the given inputs acquired from the Fuzzifier module.A set of proposed fuzzy rules translated into the equation using "and-like" and "or-like" operators were used to calculate the rule output.Finally, the Defuzzifier module was used to aggregate the rule outputs inferred from the Inference module.The result from the Defuzzifier module was then used to evaluate the link quality.A simulation was conducted to evaluate the accuracy rates of the proposed method and those found in the selected related works.
The results showed that the proposed method had higher accuracy rates than the selected related works for evaluating a link quality.
For future work, we intend to investigate whether it is practical to evaluate the link quality at receiver nodes.As far as we know, most recent studies are only focused on the evaluation of the link quality at receiver nodes.However, since communication between sensor nodes is bidirectional, the link quality should ideally be evaluated at both sender nodes and receiver nodes.We believe that by doing so, the accuracy rate for evaluating a link quality can be further improved.

Figure 1 :Figure 2 :
Figure 1: The architecture of the proposed method.

Figure 3 :Figure 4 :
Figure 3: The SNR  and LQI  membership functions for the bad quality fuzzy set.

Figure 5 :Figure 6 :
Figure 5: The SNR  and LQI  membership functions for the medium quality fuzzy set.

Figure 7 :Figure 8 :
Figure 7: The SNR  and LQI  membership functions for the good quality fuzzy set.

Figure 9 :
Figure 9: The SNR  and LQI  membership functions for the very good quality fuzzy set.

Figure 10 :Figure 11 :
Figure 10: The position of nodes before and after deployment.

Figure 12 :
Figure 12: Accuracy rates of the proposed method and other related works.

Table 1 :
Results of the membership function values of both SNR  and LQI  .

Table 2 :
The classification results.

Table 3 :
The simulation setup and initial deployment.To conclude, the proposed method, by combining the hardwarebased and software-based metrics together, can evaluate the link quality better than each individual hardware-based and software-based metric.
except for packet sizes 1 and 2. For these packet sizes, the accuracy rate of SNR is higher than PRR.This means that PRR is not suitable for evaluating a link quality when the packet size is too small.However, it can evaluate the link quality better than hardware-based metrics if the number of packages is large enough.LQI has the lowest accuracy rates in comparison to the proposed method, PRR, and SNR.