## 4 Simulations and Analysis
### Storage Effectiveness Analysis
#### 4.2.2 Establishing a Communication Link with Multi-Hops  
The method discussed above will reduce the connectivity of the network to some extent. In order to improve the connectivity, we introduce a tree-based path key establishment method to make as many nodes as possible connect to the tree with the sink node. It defines \(p(n)\) as the probability that any sensor node \(S_{i}\) establishes a communication link with MS within \(n\) hops, so \(p(n-1)-p(n-2)\) will signify the probability that sensor nodes can establish communication link with MS within \(n\)-1 hops. If we define the probability that any two sensor nodes \(S_{i}\) and \(S_{j}\) can directly establish a communication link as \(p_{ss}\), thus the probability of establishing communication link with MS in only \(n\) hops is \(p_{ss}\times(p(n-1)-p(n-2))\). Suppose that there are \(d\) sensor nodes in the communication range of the sink node, then the probability that sensor nodes cannot establish a communication link with the MS in \(n\) hops is \((1-p_{ss}\times(p(n-1)-p(n-2)))^{d}\). The probability that nodes cannot establish a communication link within \(n-1\) hops is \(1-p(n-1)\). Thus the probability of failing to establish communication link within \(n\) hops can be expressed as Equation (6):  
\[(1-p(n-1))\cdot(1-p_{ss}\cdot(p(n-1)-p(n-2)))^{d} \tag{6}\]  
The probability that a sensor node can establish a communication link with MS within \(n\) hops can be derived as Equation (7):  
Figure 7: The probability that MS and sensor nodes directly establish the communication link with different schemes.  
\[p(n)=1-(1-p(n-1))\cdot\left(1-p_{ss}\cdot\left(p(n-1)-p(n-2)\right)\right)^{d} \tag{7}\]  
For simulation convenience, this article discusses the establishment of a communication link within two hops, so Equation (7) can be simplified as Equation (8):  
\[p_{d}=1-(1-p)\cdot\left(1-p_{ss}\cdot p\right)^{d} \tag{8}\]  
where, \(p_{ss}=(1-\dfrac{\left(\begin{array}{c}S_{p}-N\\ N\end{array}\right)}{\left(\begin{array}{c}S_{p}\\ N\end{array}\right)})\cdot\left(1-\dfrac{\left(\begin{array}{c}S_{k}-n\\ n\end{array}\right)}{\left(\begin{array}{c}S_{k}\\ n\end{array}\right)}\right)\), \(S_{p}\) and \(S_{k}\) and denote the size of polynomials pool and keys pool respectively, \(N\) and \(n\) are the size of polynomial ring and key ring stored in the sensor nodes, respectively.  
In Figure 8, when the number of neighbor nodes \(d=10\), the probability of establishing a communications link within two hops between sensor nodes and MS will reduce with the increasing of the size of polynomial pool, and the probability of establishing a communications link within two hops for the proposed scheme will be higher than that in the Amar scheme, Liu scheme and the modified Liu scheme, respectively. Comparing Figures 8 and 9 the probability of establishing a communication link within two hops will increase with the increasing number of neighbor nodes within the communication range of a MS. As analyzed from the simulation result, the proposed tree-based path key establishment method improves the probability of establishing a communication link significantly. The reason is that it forms a dendroid local network structure within the communication range of mobile nodes. The tree-based structure allows the sensor nodes which cannot directly establish session keys with the MS to more easily establish session key with the MS via the intermediate nodes by multi-hops, whereas the other schemes establish communication links only based on the probability, which cannot better solve the problem of lower connectivity probability.  
Figure 8: The probability that a MS and sensor nodes establish a communication link within two hops when the number of neighbor nodes \(d=10\).