## 6 Performance Evaluation
### Security Performance Analysis  
In this subsection we examine the security protection achieved by our proposed security scheme against some general security threats in sensor networks, and its performance in terms of memory requirement and scalability:  
**Defenses from outsider attacks:** Most of the outsider attacks against WMSN routing protocols can be prevented by providing confidentiality (through encryption and authentication) using the shared security keys. Even a simple scheme uses only the shared master key will prevent unauthorized nodes from joining the topology of the network and hence attacks like selective forwarding, acknowledgment spoofing, wormhole, and sinkhole attacks are disallowed. Hello-flood attacks are detected since broadcasting messages in the network done only by using the master key and unique-cluster key. Also by using the unique-node and pair-wise keys, attacks such as Sybil attack is prevented because a single node cannot present multiple identities without having the security keys. The network is also protected against replay attacks as all messages exchanged in the network are tracked by a time stamp and sequence number. Notice that a GM needs only to maintain a one counter for its CH, and a CH needs to keep counters only for its GMs and parents.  
Figure 10: Energy Consumption of Our Protocol Compared with Other Protocols.  
**Defenses from insider attacks:** Security mechanisms using only the master key cannot protect the network against insider attacks or compromised nodes. Insider attacks can disrupt the network by spoofing or altering routing information, selective forwarding, and broadcasting Hello-floods. Therefore, our proposed security scheme can protect the network against insider attacks by verifying both node identities and bidirectional link, as well as authenticating broadcast messages. Identities can be verified by sharing a symmetric unique-node key for every node with a trusted base station. Two neighboring nodes can authenticate the bidirectional link between them by using the master key to verify other identity and establish a shared pair-wise key for securing the communication between them. Broadcasting can be authenticated by using a unique-cluster key derived from the master key and shared, for example, within a cluster or group of nodes. Using those unique symmetric keys, our security scheme resists against insider attacks and minimizes their effects as a compromised node disturbs only a local part and the rest of the network remains secured.  
**Scalability:** Our security scheme scales well as it requires only local information for key management without needing of central distribution. Furthermore, the number of security keys needed to be stored at each node does not depend on the network size but only on node density (_i.e._, average number of group members within a cluster and number of neighboring cluster heads). Average number of GMs or the size of cluster can be determined by adjusting the value of Thr-High. Also it is shown in Figure 11 that the density of cluster heads in the network is decreasing with the network size and tends to be fixed at large network size.  
**Memory requirements:** The majority of nodes (_i.e._, GMs) need only to store three keys: unique-node, pair-wise, and unique-cluster keys. On the other hand, each CH needs to store the pair-wise keys it shares with its group members and parents, in addition to the unique-node and unique-cluster keys. Recall the powerful capabilities of CHs, storing N keys (\(N=K_{i}+K_{ch}+(n+m)\times K_{ij}\) where n is number of parents and m is cluster size), with an average number of parents is 6 (_i.e._, six different paths) and an average cluster size of 10, does not need considerable memory space.