Mechanism of Immune System Based Multipath Fault Tolerant Routing Algorithm for Wireless Sensor Networks

It is significant to improve fault tolerance and transmission reliability for improving the overall performance of wireless sensor networks. Related studies on this issue become the hotspot at present. For issues that nodes fault or link quality can affect the transmission stability and reliability of the network, mechanism of immune system based multipath fault tolerant routing algorithm is presented for wireless sensor networks. Firstly, mechanism of immune system is adopted to establish the hierarchical clustering topology with superior performance of clustering compactness. Then nodes' comprehensive measurement (CM) values are calculated and the contour lines are established among cluster heads according to nodes gradient. Mechanism of immune system is applied to do the variation on the initial antibody population, namely, the multiple disjoint paths, to establish the final optimal transmission paths. Mathematical model is established to do the theoretical analysis on the performance of the algorithm. Through the simulation on the packet receiving rate, accuracy rate, and energy efficiency, the algorithm improves the transmission reliability, energy efficiency of the network, and shows superior performance of fault tolerance.


Introduction
Reliability of packet transmission is an important index to evaluate the performance of wireless sensor networks (WSNs). Stable topology based routing is established to realize reliable packet transmission which gives consideration to the balance of energy consumption and low transmission delay, and so forth [1]. However, owing to the characteristics of no center network, dynamic topology, source restriction on computing, transmission and energy, as well as the unpredictability of working scenario especially brought by vibration and electromagnetic interference, it often meets the fault of nodes or links which leads to the packet loss or retransmission. This seriously affects the network performance such as the packet receiving rate, accuracy rate, and average transmission delay. Finally, the fault lowers the transmission stability and reliability, weakens the reserved function, and brings great challenges to the existing network technologies [1].
Fault tolerance is the key technology to improve the transmission stability and reliability of the network. It attracts numerous attentions and becomes the hotspot in the study on wireless sensor networks [2]. Network with superior performance has characteristics of reliable data transmission, efficient energy consumption, and low transmission delay. When the malfunction occurs, the network can adaptively adopt the reasonable control scheme to deal with the fault and continues to provide highly credible computational service. Study on fault tolerance mainly includes the protocol design in each layer and multilayer combination optimal control [1]. Fault tolerance in the network layer is mainly achieved by the multipath transmission technology and network coding. Better performance can be obtained by the effective combination of multimethods of fault tolerance and multilayer optimization control [3].
Biological immune system has the information processing mechanisms such as memory learning, feedback regulation, and no memory distributed autonomy [4]. Artificial immune system, based on the biological immune theory, has the basic immune methods including immune recognition, immune learning, immune memory, and clonal selection. It provides no teachers learning and self-organization mechanism. So, it has the characteristics of open, distributed, dynamic, and robustness, and so forth. Similar to the distributed self-organizing wireless sensor networks, biological immune system needs to maintain its stability in the constantly changing scenario. So, the mechanism of immune system provides a novel approach to the fault-tolerant control issue for wireless sensor networks. It can overcome the defect of the traditional solution and be a significant study direction [5][6][7].
For the issue that the fault can affect the transmission stability and reliability of the network, multipath fault-tolerant routing algorithm presented in this study mainly includes two parts: immune mechanism based network clustering and the establishment of gradient multipath routing. The main contribution of this paper includes the following.
(1) Definition of the related issues of the immune system mechanism in the scenario of wireless sensor networks, such as antibody, antigen, and the affinity during the clustering process, as well as the node coding, path coding, fitness calculation, memory generation, and antibody variation rules during the process of multipath routing establishment. (2) Immune mechanism is applied to cluster the network and nodes' comprehensive measurement (CM) values are calculated to determine the nodes gradient. Immune evolutionary theory is applied to establish the gradient disjoint multipath routing to improve the performance of fault tolerance and transmission stability. (3) Mathematical model is established to do the theoretical analysis and simulation is carried out to test the performance of clustering compactness, algorithm's convergence, efficiency of energy consumption, and fault tolerance.
The rest of this paper is organized as follows. related work is in Section 2. Section 3 presents a multipath fault-tolerant routing algorithm based on the immune system mechanism. It mainly includes the establishment of clustering topology and multipath fault-tolerant routing. Section 4 is the theory analysis and simulation test. The conclusion is in Section 5.

Related Works
Multipath fault-tolerant routing algorithm mainly applies the mechanism of immune system into the establishment of clustering topology and gradient multipath routing. So this section briefly makes a survey on the study of immune mechanism in the WSNs, clustering topology based gradient routing, and multipath fault-tolerant routing.
Immune mechanism provides innovative ideas and methods to fault tolerance in wireless sensor networks and the related study shows good performance of fault tolerance [8][9][10][11][12][13]. Yongjun et al. established frequency control mathematical model and controlling method of minimum energy consumption inspired by the artificial immune theory [8]. Salmon et al. presented collaborative monitoring and intrusion detection mechanism inspired by the immune system. Salmon et al. presented an IDS framework inspired from human immune system to be applied in the context of wireless sensor network [9]. Ya-Qi and Xiao-Yuan presented the clustering topology evolution model with the function of fault tolerance based on immune mechanism [10]. Lim applied immune mechanism to diagnose and repair the failures of nodes or links in order to improve the stability. Bokareva et al., presented the fault-tolerant structure SASHA which is based on the biological immune mechanism [5]. Amir et al. applied the theory of clonal selection, immune affinity, and immune network to establish the network model by simulating self-learning, self-organization, memory, and information processing mechanism in the biological immune system or nerve immune system [6,7].
Multipath transmission technology for fault tolerance is to transmit the split fragments along multiple paths established between the source node and the destination node. Certain amount of fragments received at the destination node are reconstructed into the source data. By the mechanism of redundant transmission, load balance and transmission bandwidth are improved to realize the reliability and fault tolerance. Energy efficient reliable multipath routing using network coding (NC-EERMR) [3] is to establish the multipath routing in a distributed way through multiple hops. Subbranch multipath routing protocol (SMRP) [11], based on secure and efficient intrusion-fault-tolerant protocol (SEIF) which is DM model, improves the fault tolerance and credibility by multiple routing selection in a distributed authentication way. Self-selecting reliable path routing (SRP) [12] which is based on SSR (self-selecting routing) and SHR (self-healing routing) establishes multiple paths to realize the transmission fault tolerance. Mixed multipath mechanism H-SPREAD [13] is based on the mechanism of hybrid multipath data acquisition and adopts the key sharing and backup path for any node to improve security and reliability of data transmission. Network coding based multipath reliable transmission route (NC-RMR) [14] adopts BM mode to establish the logical backup for any path. DD (Directed Diffusion) [15] establishes the multipath transmission mode to deal with node failure and topology changes through three phases: flooding the interests, establishing the gradient, and dynamically optimizing transmission routing. DD based multipath routing algorithm [16] strengthens the multiple paths with superior quality and low transmission delay. [17] presents DM based distributed multipath routing algorithm with high energy efficiency and scalable characteristic which can adjust data flow by load balance mechanism. VR (Distance Vector Routing) [18] establishes the paths by lightweight flooding only when the data needs transmitting.
Nodes in the network are divided into different hierarchies according to gradient values defined by the distance or hops to the destination node, nodes' energy level, and transmission delay. Gradient based transmission routing is established along the gradient direction by a certain strategy. The energy balance nonuniform clustering gradient based routing (EBCAG) [19] transmits the packets along the gradient descent direction to the destination node according to the gradient value decided by the minimum hops. GBR (Gradient-Based Routing) [20], which contains competitive algorithm GBR-C and adaptive GBR-C, is to establish two forward hops to minimize the probability of data retransmission. FGS (Fine-grain Gradient Sinking) [21] introduces average weighted mechanism based on the HGS (Hop Gradient Sinking) model and converts hop count information into fine gradient information as the reference to establish data transmission strategy. DAR (Data Aggregating Ring) [22] classifies the nodes by the hops, the packets are not always transmitted along the gradient direction to the destination node through multiple hops, and they can be directly forwarded to the destination node through only one hop by load balance mechanism. In [23], nodes are divided into different hierarchical rings based on the nodes' nonuniform distribution strategy, the shortest transmission path is established among different hierarchical rings. MR2-GRADE (Gradient based maximally radio disjoint multipath routing) [24] presents GRADE-GF (Grade based greedy forwarding) and GRADE-RF (Grade based restricted flooding). [25] studies the gradient model based network's upper and lower bounds of the survival time. Gradient broadcast (GRAB) [26] allows nodes with low gradient values to forward packets simultaneously to form the multipath routing. However, it lowers the transmission reliability owing to the conflicts of twice forwarding.
Immune system mechanism is adopted to establish the mathematical model to save the energy consumption, establish intrusion detection system, cluster the network, diagnose the faults and so on. Gradient mechanism shows the advantages especially in the routing establishment and energy consumption. Multipath transmission mechanism has been proved with good performance on improving the stability and reliability of packet transmission. However, little study is mentioned to adopt immune system mechanism into the gradient multipath transmission in wireless sensor networks to improve the performance of transmission stability and fault tolerance.

Mechanism of Immune System Based Multipath Fault-Tolerant Routing Algorithm
3.1. Mechanism of Immune System. Biological immune system adopts the mechanisms of self-recognition, mutual stimulation, and restriction to constitute a dynamic balance network according to the basic immune methods such as immune recognition, immune learning, immune memory and clonal selection, and so forth. Biological immune system is a highly distributed, safe, efficient, and adaptive learning system with hierarchical topology. It has good robustness and high complexity due to the information processing mechanism such as self-learning, feedback regulation, and no-center distributed autonomy. Artificial immune system, based on the biological immune theory, has the basic immune methods including immune recognition, immune learning, immune memory, and clonal selection. It provides no teachers learning and self-organization mechanism. So, it has the distributed and dynamic characteristics as well as robustness. These can overcome the defect of traditional methods to the establishment of clustering topology and provide novel solutions to the issues.

Idea of Multipath Fault-Tolerant Routing Algorithm.
The algorithm mainly adopts immune mechanism to cluster network and establishes multipath transmission mechanism to improve reliability of data transmission and performance of fault tolerance. Immune mechanism based clustering topology uses the affinity function defined by energy and distance factor to calculate the affinity of antibody and antigen. Some excellent antibodies are selected into the memory according to the threshold value to form the new antibodies population by variation and output the optimal antibody solution, namely, the optimal clustering topology. Node' gradient is calculated according to the comprehensive measurement function; then the node and path are encoded. Finally, immune mechanism is adopted to antibodies' variation to ultimately establish multiple transmission paths.

Problem Definition
Antibody. Defined as cluster heads in wireless sensor networks, namely, the solution to the problem. Nodes in the network are divided into two categories, one is average node and another is the cluster head. Comparing cluster head, average node only concentrates on data gathering and transmission exclude taking charge of other nodes.
Antigen. Defined as the average nodes randomly deployed in the network, namely, the problems needing to be solved.
Antigen Recognition. For the issues of clustering topology optimization in the network, antigen corresponds to each node in the network, antibody corresponds to each cluster head, so the antigen recognition is defined as the process that cluster head exchanges information with its neighbor nodes within the sending power coverage.
Initial Antibody Populations. A number of average nodes are randomly selected as cluster heads and the initial antibody population is formed. Each cluster head has its location and energy information.
Affinity. Affinity reflects the matching degree between the antigen and antibody or between the antibody and antibody. The greater the affinity value is, the greater the antibody matches the antigen. The affinity function is defined as follows: where , and is the Euclidean distance from an average node to cluster head . Affinity function is related to the node's energy and distance factor. Energy factor is defined as the ratio of the current average node's energy and the average of all nodes' energy in a cluster. The distance factor is defined as the ratio of average value of the sum of distance from each node to cluster heads and the distance of the current average node to cluster heads. The farther the distance to the cluster head is, the lower the node energy is, the lower the affinity value is. Affinity value reflects the inspiration of a node joining into a cluster.
Encoding. Natural number is selected as the coding method for node's coding.
Antibody Memory. It selects the antibodies with high affinity values into the memory as the candidates for optimal cluster heads.

Clustering Algorithm Idea.
Firstly, ordinary nodes are randomly selected as the initial clusters by the probability which names the initial antibodies. Distance factor is adopted to form the initial antibody population. Then the affinity of antibody and antigen is calculated by the affinity function defined by the nodes' energy and distance. Some excellent antibodies are selected into the memory according to the threshold value to do the variation. The affinity is recalculated and the optimal antibody solution is outputted by the terminating condition. Finally, clustering topology is formed with the good performance of clustering compactness as well as giving consideration to the energy factor.

Algorithm Steps
Step 1. Initialize the parameters, set the basic parameters of immune algorithm.
Step 2 (antigen recognition). Antigen recognition reflects the communication process between the cluster head and its neighbor nodes within the power coverage.
Step 3 (establish the initial antibody population). average nodes are randomly selected as the initial cluster heads by the probability , namely, the initial antibodies. It calculates the distance from the nodes to the cluster head itself within its power coverage. Nodes nearer to the cluster head are to be selected to establish the initial antibody population, namely, where represents the node and CL represents the cluster .
Step 4 (fitness calculation). The defined affinity function is used to calculate the affinity of antibody and antigen.
Step 6 (generate new antibody population by variation).
According to the calculation of affinity between antibody and antigen, antibodies with affinity value being higher than the set threshold are selected into the next iteration. New antibody populations are generated by the variation of antibody gene. Nodes in the network are coding in natural number; for example, is the natural number code of node , ∈ (1, 2, . . . ). It adopts the variation rules in (3) to mutate the antibodies in the memory as follows: where is the natural number randomly generated in [1, ]. So, new antibody population is formed by new mutated antibodies and the former antibodies in the memory. It adopts the rules ∈ CL if min{ ( , ), = 1, 2, . . . , , = 1, 2, . . . , } to form new antibody population; then it calculates ( , ) and ∑ =1 ∑ =1 ( , ) by the affinity function.
, turn to Step 5; otherwise, go to Step 7.
Step 7 (set termination condition and output the optimal solution). When meeting the condition of iteration and min ∑ =1 ∑ =1 ( , ), it stops iteration and outputs the optimal solution; otherwise, it goes to Step 4.
Step 8 (confirm the clustering). Antibodies in the final memory library are selected as the cluster heads and they exchange packets with the member nodes to confirm the clustering.

Establishment of Node Gradient and Contour Line
(1) Definition and Calculation on Cluster Heads' CM. More packets will be lost or retransmitted due to path's poor quality. This will cause more local energy consumption and serious congestion. Path quality has direct influence on the reliability of packets forwarding. The residual energy determines the survival time of the network. Therefore, the way only using hops as a criterion to evaluate the quality of routing has failed to meet the requirements of service quality. Therefore, nodes' quality is comprehensively evaluated by the hops to the destination node, residual energy, and transmission delay. So, the nodes with higher CM are preferentially selected to establish the optimal transmission path. This has great significance to improve the transmission reliability. The node's comprehensive measurement function is defined by (4).

Immune Problem Definition
Antibody. Defined as the established optimal paths along the gradient direction from the source node to the destination node.
Antigen. Defined as the cluster heads in the static clustering topology.
Node Coding. The routing is established among the cluster heads. So, all the cluster heads with gradient values need to be encoded in binary code according to the maximum number of gradient and cluster heads in each gradient. It contains two parts: gradient code and node code; for example, the code of 6th node with gradient 5 is as follows: 1 0 1 0 1 1 0. The former three binary codes represent the gradient coding of a cluster head, namely, the gradient value being 5. The last four binary codes represent the node coding, namely, the 6th node in this gradient.
Path Coding. The destination node is coded in 000. If a path established from the source node to the destination node has four gradients, the path code can be represented by the combination of cluster heads' codes, shown as follows: 1000111 0110110 0100100 0010010 000.
Fitness Calculation. Path fitness is closely related to each cluster head's CM decided by the hops to the destination node, residual energy, and transmission delay. It is defined and calculated by Cluster Destination Memory. Among all the multiple transmission paths { 1 , 2 , 3 , . . .} from the source node to the destination node, antibodies { 1 , 2 , 3 , . . . } meeting ∑ =1 CM ( ) ≥ Θ are selected as the excellent ones into the memory to form the antibody population which is used for the next iteration variation.
Antibody Variation. Antibody variation has two scenarios as follows. (1) The established paths only have to mutate its node codes excluding its gradient codes. (2) The established paths to the destination node not always being along each gradient direction can mutate its node coding as well as its gradient coding. The variation rule is 0 randomly mutate to 0 or 1, 1 randomly mutate to 0 or 1.

Routing Algorithm Idea.
Cluster heads' CM is calculated based on the clustering topology according to the immune mechanism and the virtual gradient contour lines are to be established. Nodes on the same contour line are coded in the same hierarchical value. Source node selects the cluster head within its power coverage as the next hop along the gradient direction. Thus, multiple disjoint paths to the destination node are established as the initial antibodies. It calculates paths' affinity and selects the path with the affinity being greater than a certain threshold into the memory and does the variations. Multiple optimal disjoint paths are finally established by outputting the optimal antibodies to improve the performance of fault tolerance and transmission stability.

Algorithm Steps
Step 1. Initialization of the parameters.
Step 2. Calculate the cluster heads' CM and gradient values by (4), to determine the CM based contour lines among the cluster heads. When firstly calculating the nodes' CM, set the parameters 1 = 1, 2 = 3 = 0 due to the paths being not established.
Step 3. To code the cluster heads according to the coding rules.
Step 4 (to generate the initial antibody and establish multiple transmission path). Source node firstly selects the cluster head along the gradient direction within its power coverage as the next hop to establish the first path. Source node then selects the cluster head along the gradient direction within its power coverage with the second minimum distance but does not belong to the established paths as the next hop to establish the second path. Therefore, multiple disjoint paths to the destination node are established and each path is an antibody.
Step 5 (to calculate the fitness). Fitness of the clusters is calculated by (5).
Step 6 (to generate the memory population). According to the established transmission paths { 1 , 2 , 3 , . . .}, it selects the antibodies with ∑ =1 CM ( ) ≥ Θ to save into the memory as the excellent antibody population for the next time variation, where Θ represents the set threshold and is determined by ∑ =1 ∑ =1 CM ( )/ and is the path's number.
Step 7 (antibodies mutation). Excellent antibodies in the memory are mutated according to the variation rules and new antibodies are generated. Then, new antibody population is constituted with the original antibodies and mutated antibodies. Then, it calculates CM ( ) and ∑ =1 ∑ =1 CM ( ) according to the fitness function. If ∑ =1 ∑ =1 CM ( ) < ∑ =1 ∑ =1 CM ( ), turn to Step 6; otherwise, turn to Step 8.
Step 8 (terminate the iteration and output the optimal solution). The Optimal antibodies with minimum ∑ =1 ∑ =1 CM ( ) are selected and outputted as solutions to the issues so as to establish multiple transmission paths; otherwise, turn to Step 5.
Step 9. Source node sends the confirmation packets to the destination node along all the established paths and receives the replies from the destination node to confirm the establishment of optimal transmission paths.

Clustering Compactness.
Compactness and alienation are adopted to evaluate the clustering performance of the network. Compactness reflects the minimal sum of the distance between cluster head and member nodes. Alienation reflects the distance from one cluster to another. Compactness of a cluster is calculated by min ∑ =1 ∑ =1 .

Lemma 3. Mechanism of immune system based clustering in wireless sensor networks has better clustering effect, namely,
Proof. Because ( , ) = ( / ) + ( / ). When → 0, it has ( , ) = ( / ) = ∑ −1 =1 /( − 1) . Thus, the affinity value is only related to the distance between the current average node and cluster head. For the th ( = 1, 2, . . . , ) iteration clustering, it has represents the sum of in-cluster distance of the optimal clusters in the memory in the th iteration. These clusters will be kept in next iteration clustering. ∑ = +1 ∑ =1 represents the sum of in-cluster distance of − clusters in the current iteration. When entering ( + 1)th iteration clus- ing to the mechanism of immune algorithm, it only selects some clusters with better performance into the next iteration, it has ∑ = +1 ∑ =1 +1 ≤ ∑ = +1 ∑ =1 and +1 ≤ .

Performance of Convergence
(1) Convergence of Clustering Algorithm. It has been proved that the immune algorithm has good performance of convergence. Mechanism of immune system based clustering in wireless sensor networks needs good convergence. Good convergence reflects good calculation performance of algorithm and is of great significance to energy restrained wireless sensor networks. The convergence of immune system based clustering can be calculated by Lemma 4.

Lemma 4.
lim Proof. In Lemma 4, is the operation rounds of the network.
∑ =1 ∑ =1 2 represents distance sum of clusters which has higher value than the setting threshold when network working at a certain round. These corresponding clusters, namely, the excellent antibody population, will be kept in the memory for the next iteration. According to the algorithm' principle, it has ∑ = +1 ∑ =1 2 ≤ ∑ = +1 ∑ =1 . Thus, Compactness of network clustering based on the mechanism of immune system reflects that greater is, better compactness of clusters is. Compactness of clusters will finally converge to a fixed value.
(2) Convergence of Multipath Establishment. Multiple optimal transmission paths are established based on clustering International Journal of Distributed Sensor Networks 7 topology by the mechanism of immune system. Convergence of multiple paths establishment is to apply immune system's characteristics such as learning, memory, and variation to establish the initial multipaths as the antibodies. After the antibodies' variation, the excellent antibodies which are greater than a certain threshold are saved into the memory as the population waiting to mutate next time. Finally, multiple paths are established. Firstly, initially disjoint transmission paths { 1 , 2 , 3 , . . . , } are randomly established. 2 disjoint paths { 1 , 2 , 3 , . . . , , +1 , +2 , . . . , 2 } will be generated after each path's variation. Then, the path's quality is evaluated by the function ∑ =1 CM . Antibody population, namely, the memory library, is constituted by the optimal paths with min ∑ =1 ∑ =1 CM . Namely, the new antibody population inherits the original excellent antibodies and keeps the diversity of antibodies owing to the variation based on the most excellent antibodies.
Therefore, at the th round iteration of immune mechanism based multipath algorithm, it has the following according to the sequence of paths' quality: For antibodies selected into the memory, Among multiple paths at the th round operation, it has Among the established multiple paths at ( + 1)th round iteration, it has (10) The new antibodies quality is equal with the original antibodies quality if the variation antibodies are not optimal to the original antibodies in the worst cases. Otherwise, the new antibodies quality is better than the original antibodies if the variation antibodies contain at least a better one than the original antibody in the memory.

Performance of Energy Consumption.
Energy consumption of the algorithm mainly reflects in two aspects: immune mechanism based network clustering and multipath establishment.
(1) Energy Consumption of Network Clustering. Energy consumption model of data transmission is defined as where tx ( , ) is energy consumption of sending packets, rx ( ) is energy consumption of receiving packets, and elec is the circuit energy consumption of per bit packet transmission. fs and amp are the coefficients of transmission amplifier.
For the ordinary node sending bits packets, the residual energy is as follows: From (12) and (14), the residual energy of member nodes in one cluster is directly related to the distance between itself and the cluster head. It also has close relationship with affinity function value from (14). The greater the distance is, the less the affinity function value is, the smaller the residual energy is.
For the cluster head in the th cluster, giving the consideration on receiving the packets from member node and transmitting packets to neighbor cluster heads, the residual energy is Suppose that transmission distance between cluster heads is > 0 .

International Journal of Distributed Sensor Networks
Owing to ini = ini , the residual energy of the whole cluster after one round packets transmitting is clu res = res + res From (16), residual energy of the th cluster after one round packets transmission is related to the transmission distance 1 between current cluster head and the neighbor, as well as the distance ∑ =1 2 between the cluster head and its members. The residual energy of the whole network after one round packets transmission is From (17), the residual energy of all nodes in the network after one round packets transmission is related to two factors: cluster head's transmission distance ∑ =1 4 and network clustering performance namely the clustering compactness ∑ =1 ∑ =1 2 . The former one is directly related to clustering topology based on the transmission routing. Mechanism of immune system based network clustering has achieved the optimal clustering pattern, namely, min ∑ =1 ∑ =1 2 . It has energy consumption balance among the clusters; the difference between the maximum and minimum cluster energy consumption can be reduced to the smallest range, namely, (2) Energy Consumption on Multipath Establishment. Multipath establishment is firstly sponsored by the source node and the next gradient node is selected as the next hop to establish the connection. Now, if the energy consumption of sending the confirmation packet after receiving a packet is ignored, the energy consumption of establishing a path is as follows: 2 antibodies are created after doing the variation to the initially established paths, namely, antibodies. Therefore, Cluster Destination the total energy consumption of immune mechanism based multipath transmission routing after rounds of variation and evolution is as follows:

Performance Analysis of Fault Tolerance.
Fault tolerance reflects that the source node can find the right paths to transmit the packets to the destination node successfully when the fault of nodes or links occurs. So, packet is avoided lost at the destination node whether the nodes' fault exists in the network. Multipath routing is an effective method to solve this issue. Packets are transmitted in the form of coded or split fragments along multiple paths, and the received fragments at the destination node will be decoded or reconstructed into the source packet to avoid its loss. The multipath faulttolerant model is as follows. (

1) DM (Disjoint Mode) Based Multipath Transmission Fault
Tolerance. DM means that multiple disjoint paths are established between the source node and the destination node. However, the new mutated antibodies may have the same node with the original antibody. Variation rules are set as follows: the gradient coding does not need to be mutated on each gradient, only the node coding needs to be mutated but not equal to itself. So, the mutated antibodies are disjointed as shown in Figure 2. Among the established paths { 1 , 2 , 3 , . . . , }, the code of path is 1000111 0110110 0100100 0010010 000, where 1000111 represents the source node and 000 represents the destination node. Thus, the code of mutated is 1000111 011#### 010#### 001#### 000, where # represents 0 or 1. Furthermore, it has: { : 011#### ̸ = : 011####, : 010#### ̸ = : 010####, : 001#### ̸ = : 001####, = 1, 2, . . ., , ̸ = }. Fault tolerance embodies that any path with fault will not affect the other path during the data transmission. A certain International Journal of Distributed Sensor Networks 9 number of packets received at the destination node will be reconstructed into the source packets.

(2) BM (Braided Mode) Based Multipath Transmission Fault
Tolerance. For each node's variation in the antibody population between the source node and the destination node, elusion rules on nodes' code variation are set as follows: the gradient coding does not needed to be mutated on each gradient, only the node coding needs to be mutated. It exists the case that mutated node maybe itself. Therefore, BM based multipath transmission mode is established, as shown in Figure 3.
Among the established transmission paths { 1 , 2 , 3 , . . . , }, the code of is 1000111 0110110 0100100 0010010 000. Code 1000111 represents the source node, Code 000 represents the source node, the code of after variation is 1000111 011#### 010#### 001#### 000. # represents 0 or 1. It has the following three cases: There are also three established main paths from the source node to the destination node. However, the first path has the common node with the second. The second path also has the common node with the third. Fault tolerance embodies that if one node is faulted, it affects at most two paths' packet transmission. A certain number of packets received at the destination node will be reconstructed into source packets and it realizes the source packet successful transmission. Comparing with BM, it has been proved with better performance of fault tolerance.
(3) Primary-Backup Path Transmission Mode. The limited primary disjoint transmission paths ( = 2) are established between the source node and the destination node, represents the number of paths. The backup path is established for the node in the primary path which has lower energy than the set threshold or other fault, as shown in Figure 4.

Simulation Analysis.
Assumptions: (1) network node is static and each node' location is known; (2) the initial state of the nodes is equal, each has the same parameters and initial energy; (3) the network node in full duplex work mode; and (4) the nodes are randomly uniformly distributed in the rectangular area. Communication model is based on the clustering topology. Parameters are set as follows: probability = 0.15, the weight coefficients 1 = 0.3, 2 = 0.5, 3 = 0.2, = 0.4, = 0.6. The initial energy of the node is set with 1000 nJ. The model of the energy consumption and parameters amp , fuse , elec , tx , and rx refer to [27]. The size of source packet is set with 2000 bits. Fault node is defined as the node which energy consumption achieves the initial threshold value = 0.3 ini . ini represents the nodes' initial energy. Lifetime of the network cycle is defined as the period form the network beginning to run until the moment that 10% of the nodes in the network run out of energy. The sensor data are acquired and transmitted periodically. The node reconstructs the received coded fragments into the source packets at a certain interval Δ .

Performance and Compactness of Immune Clustering.
(1) Clustering Performance. Simulation is based on clustering topology of the network according to the immune mechanism. Figure 5 shows that 150 nodes are randomly deployed in the area [200,200]. The destination node is located in the right side of the area. Figure 6 shows the initial randomly selected cluster heads which are not based on the immune mechanism. It adopts -means algorithm to establish the clustering topology by the distance factor. Figure 7 shows the clustering topology based on the immune mechanism by repeated antibody variations. From the comparison analysis of Figures 6 and 7, clustering based on immune mechanism in Figure 7 is more uniform and optimal.
(2) Clustering Compactness. The compactness value is calculated by ∑ =1 ∑ =1 which is defined as the sum of distance within a cluster. It reflects the compact performance within a cluster and discrete performance among the clusters. min ∑ =1 ∑ =1 represents the optimal clustering result. It is shown in Figure 8. Figure 8 shows the variation tendency of clustering compactness of immune mechanism based network. The compactness values at each iteration round of antibody variation are calculated by ∑ =1 ∑ =1 . From Figure 8, it has greater values at the initial stage of clustering. After optimization by the immune mechanism, the value decreases dramatically and finally converges to a fixed value. Its variation trend reflects the performance of convergence and optimization of immune clustering.

Multipath
Routing. Before establishing multipath routing, gradient values of cluster heads should be calculated according to their CM. Cluster heads with the same gradient  values will be connected together, as shown in Figure 9. The network is divided into seven gradient areas. Figure 10 shows that three paths are established based on the gradient clustering topology. From Figure 10, the established three paths from the source node to the destination node are disjoint and along the gradient direction. The fault tolerance of multipath transmission routing reflects that the existing fault node or link quality cannot affect the stability and accuracy of the packets transmission from the source node to the destination node. A certain number of packets received at the destination node will reconstruct into the source packets to improve the receiving accuracy rate.

Performance of Fault
Tolerance. Packets receiving rate and accuracy rate are adopted to evaluate the performance of data transmission. They can reflect the link quality and performance of fault tolerance. Packet receiving rate is defined as the ratio of received packets at the destination and source packets sent at the source node. The higher the packet receiving rate is, the lower the packet loses during the transmission and the better the quality of links is. Now, the comparison is made among the following three methods: (1) immune mechanism based multipath routing algorithm presented in this paper (ISM-MR); (2) network coding based reliable disjoint and braided multipath routing (NC-MR) [14]; and (3) an energy-aware multipath routing algorithm (EA-MR) [17]. Simulation of packet receiving rate is shown in Figure 11. Figure 11 shows the comparison of packet receiving rate. Now, it gives the ratio of the received packets and all source packets when network runs at 1000-2000 times. Method 1 presented in this paper keeps a higher data receiving rate in [0.97, 1] than methods 2 and 3. Furthermore, it is relatively stable. The packet receiving rate of methods 2 and 3 varies in [0.93, 0.98], the packet receiving rates are relatively low and decline dramatically in the later operation stage.
Data accuracy is defined as the ratio of the received packet that can be reconstructed into source data and the source packets. It reflects the accuracy of data decoding or reconstruction, as shown in Figure 12. Figure 12 shows the comparison of the packet accuracy rate among these three methods. It shows that the data accuracy rate is higher than the data receiving rate at the same network operation times, because the data decoding transmission mechanism allows certain coded packets loss and does not affect the reconstruction into the source packet. This means that it still has higher data accuracy rate even if some coded packets are lost. The accuracy rate of method 1 presented in this paper varies steadily, it stays higher than methods 2 and 3, it is within [0.98, 1] when the network runs at 1000-2000 times. operation rounds. Now, the comparison is done among these three methods. Simulation on the performance of energy consumption is as shown in Figure 13. Figure 13 shows the comparison of average residual energy of all the nodes, including the cluster heads and members among these three methods when network runs at 1000-2000 times. From Figure 13, the average residual energy of the nodes among three methods appears not to be much different. At any operation rounds when network runs, Method 1 presented in this paper has more residual energy than any other method.

Conclusion
Transmission reliability and stability are important indexes to evaluate the performance of wireless sensor networks. However, node failure or link quality can affect it. So, the network protocol is needed to be with fault tolerance. Immune system has the information processing mechanism such as memory-learning, feedback regulation, and no center distributed autonomy. It provides a novel method to the issues of fault tolerance in wireless sensor networks. Immune mechanism based multipath fault-tolerant routing algorithm presented in this paper mainly includes two parts: immune mechanism based clustering and multipath gradient routing establishment. It gives the definition of related issues of immune evolutionary mechanism in the scenario of wireless sensor networks. System model is established to do the theoretical analysis and simulation test on the network performance. The result confirms the validity of immune mechanism based clustering and multipath gradient routing. Through analysis on the packet receiving rate, data accuracy rate, and efficiency of energy consumption, this algorithm has good performance of fault tolerance.

Conflict of Interests
The authors state that they ensure the scientificalness and independence of the study in the forms of paper which has no conflict of interests with other teams or schemes. They have no conflict of interests among them. Activities related to the paper including reviewing and evaluating will not be affected by factors such as interpersonal relationships, economic interests, and professional preferences. The paper can be open to the public.