# FarpScun: Fully Anonymous Routing Protocol with Self-Healing Capability in Unstable Sensor Networks
## 3 Fully Anonymous Routing Protocol with Self-Healing Capability
### Fully Anonymous Routing Protocol with Self-Hailing Capability
#### 3.4.3 Specific Implementation Process  
For clarity, certain examples present a detailed procedure. According to the previous assumption, route \(S-A-B-G\) is the first arrival route, and a concrete implementation process is given. In the process of route establishment, we encrypt data one by one, and finally decrypt it at the destination node. In this section, we implement the full anonymity of the entire route from the source to the destination nodes. The process is as follows:  
Assuming the route is established as \(S\to A\to B\to G\). Figure 3: Packet Structure of Encryption Route Information. (1) Anonymous route request message (RREQ) request process  
Step 1: each node enters a session key \(z_{N_{i}}\) in the encrypted part of its RREQ message to establish a symmetric encrypted connection with the destination node. Step 2: each sending node constructs an anonymous identity before each forwarding operation, which prevents the third party other than the sender and receiver from observing the communication between the two nodes. Step 3: encrypts the node location information at each new relay node, which prevents the receiving candidate node from viewing the route that data forwarding has been circulated from the sender routing. Step 4: each sending node updates its own anonymous identity after the data has been sent, which prevents long-term passive eavesdroppers extrapolating the network topology through traffic analysis. The RREQ process is shown in Figure 4.  
Conversely, the reply of the base station node (RREP message) is an \"onion\" and these layers can be \"removed\" only by using the symmetric password of the corresponding relay node. (2) Anonymous route reply message (RREP) reply process  
Based on the previous assumption that the route \(S-A-B-G\) is the first arrival route, the RREP reply process is \(G\to B\to A\to S\).The details are as follows:  
Step 1: node \(G\) computes \(E_{pk_{B}}(SessID)||HIA_{ID,G\leftrightarrow B}||E_{fast}\left(K_{B}||A||Suffix _{A},z_{B}\right)\), where \(Suffix_{A}=E_{fast}\left(K_{A}||S||Suffix_{S},z_{A}\right)\). Subsequently, node \(G\) sends \(E_{pk_{B}}(SessID)||HIA_{ID,G\leftrightarrow B}||E_{fast}\left(K_{B}||A||Suffix _{A},z_{B}\right)\) to node \(B\). At last, node \(G\) updates \(HIA_{ID,G\leftrightarrow B}\). Step 2: node \(B\) decrypts \(E_{fast}\left(K_{B}||A||Suffix_{A},z_{B}\right)\) with \(z_{B}\), gets \(K_{B}\),the address of \(A\) node and \(Suffix_{A}\). Afterwards, node \(B\) sends data \(E_{pk_{A}}(SessID)||HIA_{ID,G\leftrightarrow A}||E_{fast}\left(K_{A}||S||Suffix _{S},z_{A}\right)\) to node \(A\). At last, node \(B\) updates \(HIA_{ID,B\leftrightarrow A}\). Step 3: node \(A\) decrypts \(E_{fast}\left(K_{A}||S||Suffix_{S},z_{A}\right)\) with \(z_{A}\), gets \(K_{A}\),the address of the \(S\) node and \(Suffix_{S}\). Subsequently, node \(A\) sends data \(E_{pk_{S}}(SessID)||HIA_{ID,A\leftrightarrow S}||E_{fast}\left(K_{S}||S||R,z_{ S}\right)\) to \(S\). Figure 4: RREQ Process. At last, node \(A\) update \(HIA_{ID,A\leftrightarrow S}\). Step 4: node \(S\) decrypts \(E_{fast}\left(K_{S}||S||R,z_{S}\right)\) with \(z_{S}\), gets its own address and a random number R. The RREP process terminates. The RREP process is shown in Figure 5.  
(3) Anonymous route self-healing process  
As an example, the route reply process is \(G\to B\to A\to S\), and the destination node has found a shortcut from node \(B\) to node \(S\). The self-healing process is shown in Figure 6.  
Step 1: the destination node dispatches a key \(K_{N_{i}}\) for each node on the route. Figure 5: RREP Process. Figure 6: Self-healing Process of Anonymous Routes. Step 2: ehe destination node places the \(S\) node's information in an additional special routing packet called \(Pkt\) and encrypts it to \(E_{K_{S}}(Pkt)\), which can only be decrypted by \(K_{S}\) (where \(K_{S}\) can be the \(S\) node's ID). Step 3: \(E_{K_{S}}(Pkt)\) is encrypted with the symmetric key \(z_{B}\) of node \(B\), which forms a data block \(E_{fast}\left(E_{K_{S}}\left(Pkt\right),z_{B}\right)\).