An Authentication Protocol for Future Sensor Networks

Authentication is one of the essential security services in Wireless Sensor Networks (WSNs) for ensuring secure data sessions. Sensor node authentication ensures the confidentiality and validity of data collected by the sensor node, whereas user authentication guarantees that only legitimate users can access the sensor data. In a mobile WSN, sensor and user nodes move across the network and exchange data with multiple nodes, thus experiencing the authentication process multiple times. The integration of WSNs with Internet of Things (IoT) brings forth a new kind of WSN architecture along with stricter security requirements; for instance, a sensor node or a user node may need to establish multiple concurrent secure data sessions. With concurrent data sessions, the frequency of the re-authentication process increases in proportion to the number of concurrent connections. Moreover, to establish multiple data sessions, it is essential that a protocol participant have the capability of running multiple instances of the protocol run, which makes the security issue even more challenging. The currently available authentication protocols were designed for the autonomous WSN and do not account for the above requirements. Hence, ensuring a lightweight and efficient authentication protocol has become more crucial. In this paper, we present a novel, lightweight and efficient key exchange and authentication protocol suite called the Secure Mobile Sensor Network (SMSN) Authentication Protocol. In the SMSN a mobile node goes through an initial authentication procedure and receives a re-authentication ticket from the base station. Later a mobile node can use this re-authentication ticket when establishing multiple data exchange sessions and/or when moving across the network. This scheme reduces the communication and computational complexity of the authentication process. We proved the strength of our protocol with rigorous security analysis (including formal analysis using the BAN-logic) and simulated the SMSN and previously proposed schemes in an automated protocol verifier tool. Finally, we compared the computational complexity and communication cost against well-known authentication protocols.

the asymmetric cryptography when an authentication responder already verified the initiator and wants to share secret information. If the responder does not authenticate the initiator and the initiator uses the asymmetric cryptography to exchange a message, the network becomes vulnerable to DOS attacks [5,6]. The WSN related contraints mentioned above are known to the research community. The currently available authentication protocols are designed for the autonomous WSN from the perspective of the above constraints. Moreover, in the near future in the realization of the vision of emerging technologies such as IoT, D2D, smart home and smart cities, WSNs will provide an invaluable service by acting as a virtual layer between the physical world and the computational devices [7][8][9]. However, integration of WSNs with IoT will bring forth a new kind of WSN architecture and stricter security requirements; for instance, in a smart hospital (as shown in Figure 1b) a sensor node or a user node may require the establishment of multiple concurrent secure data sessions. To establish a secure data session, authentication is the first step. In a dynamic, mobile WSN environment, where sensors and user nodes can establish multiple concurrent connections, a node moving across the network undergoes the authentication check multiple times and the frequency of the re-authentication process increases in proportion to the number of concurrent connections. Moreover, to establish multiple data sessions, it is essential that a protocol participant has the capability of running multiple instances of the protocol run, which makes the security issue even more challenging. Thus, it is essential to adopt a secure yet lightweight authentication procedure that especially reduces the computational time and communication at the mobile sensor node. The currently available authentication protocols were designed for the autonomous WSN and do not account for these new emerging challenges. This work presents a novel authentication protocol suite called the Secure Mobile Sensor Network (SMSN) Authentication Protocol. The SMSN protocol suite consists of six protocols: three protocols deal with mobile sensor node authentication with sink nodes and the other three deal with user node activation and authentication with the base station, sink nodes, and sensor nodes. In the SMSN, mobile sensors and user nodes can join and leave the system dynamically and can establish secure multiple concurrent connections. After the initial authentication, a mobile sensor or a user node can move across the network and get re-authenticated by a simple ticket-based re-authentication protocol; for instance, a user node can establish concurrent connections with multiple sink and sensor nodes using a re-authentication ticket issued during the initial-authentication protocol run. To establish multiple connections, a node is allowed to run multiple instances of the protocol; consequently, we introduce extra design requirements to meet the goals of a secure authentication protocol. In this paper, we also present an efficient and lightweight key generation and distribution mechanism. In the key generation protocol, a commitment key is generated by a group of participants (the base station and sink nodes) using an irreversible function; the key agreement and key retrieval protocol are the same as that employed in [10]. The commitment key is further applied to drive multiple time-based encryption keys, for example, the ticket encryption key and session key between the sink and user/sensor are derived from the commitment key. The time dimension in the protocol increases the security of the protocol; although the group members do not need to be tightly or loosely time synchronized.
To determine the security of the protocol in this study, we performed a rigorous security analysis and also simulated the SMSN and previously proposed schemes [11][12][13][14][15][16] in an automated security protocol analysis tool called Scyther [17,18], which is a powerful state-of-art tool that finds attacks for defined protocol properties. We observed that our authentication protocol is secure, and it achieves all the objectives of an authentication protocol, which are defined as protocol claims in Section 5.3; for a detailed description of protocol claims, please refer to [19,20]. We also compared the efficiency of the SMSN in terms of computational time and communication complexities as discussed in [11][12][13][14][15][16]. The remainder of this paper is organized as follows. Section 2 presents the related work. In Section 3, we present a brief system overview and problem statement. Section 4 describes the proposed scheme with a detailed discussion. In Section 5, we assess the strength of our scheme against the known attacks. Section 6 presents an efficiency analysis that compares a few interesting schemes with our scheme. Finally, we provide concluding remarks in Section 7.

Related Work
Typically, WSNs are comprised of distributed devices with limited resources. Most of the conventional cryptographic mechanisms and security protocols are computationally expensive and are not suitable for resource-limited WSNs. In the recent past, the research community proposed several authentication protocols [11][12][13][14][15][16][21][22][23][24][25][26][27] that provide security in a WSN environment. Since the sensor nodes have low computational time, storage and communication capabilities, it is essential to design an efficient and lightweight yet secure authentication mechanism. From the point of view of computational and communication complexity, the authentication procedure in a wireless network with a mobile sensor and user node is an expensive task. A node moving across the network undergoes multiple authentication checks. Thus, it is essential to adopt a secure yet lightweight authentication procedure that especially reduces the computational and communication resources at the mobile sensor node. In [28] the authors discussed various anomaly detection techniques for flat and hierarchical wireless sensor networks, but detection techniques are not sufficient for several security threats. However, for a secure system together with detection methods, prevention techniques such as authentication is also vital; various authentication protocols for WSNs were proposed in [11][12][13][14][15][16][21][22][23][24][25][26][27]. In 2006, Wong [21] proposed a user authentication scheme for a dynamic WSN. The scheme is password based and employs lightweight cryptographic hash and XOR operations. Later on, Tesng et al. [11] and Das [22] identified that the Wong [21] scheme had various weaknesses and was vulnerable to replay attacks and forgery attacks, and the user password is known to the sensor node and can be revealed by any sensor node. Tesng et al. [11] proposed an improved version to mitigate the weaknesses that posed security threats in the Wong [21] scheme. The scheme of Tesng et al. [11] is also a password-based scheme, but the password is not revealed to the sensor nodes, and they also introduced a new phase of password change. Nevertheless, the scheme of Tesng et al. [11] is weak against replay attacks, impersonation attacks and forgery attacks [29]. Moreover, the scheme does not provide a mutual authentication between the gateway (GW) and sensor node (SN). In 2009, Das [22] proposed a two-factor user authentication scheme in which legitimate users can register and log in to the remotely deployed sensor nodes to access the collected data. From the point of view of computational and communication complexity, the scheme is reasonably efficient. The author claimed the scheme was secure against various kinds of attacks. However, later work [30][31][32] suggested that the scheme was vulnerable to different types of attacks, including impersonation, password guessing, insider, and parallel session attacks. Moreover, it did not provide the mutual authentication between the GW and sensor nodes. In 2010, Yoo et al. [12] proposed a user authentication scheme for WSNs and analyzed the protocol using BAN logic [33]. However, the BAN logic provided a foundation for the formal analysis of security protocols, but in the case of authentication, various attacks could slip through the BAN logic [34,35]. The scheme of Yoo et al. provided mutual authentication between the GW and the user and established a session key between the GW and SN. The authors claimed that the scheme was safe against insider attacks, impersonation attacks, and parallel session attacks. However, in [27] the authors provided a detailed analysis of the scheme of Yoo et al. and proved that the scheme is susceptible to various attacks, including insider attacks, impersonation attacks, parallel session attacks, password guessing attacks, fake registration attacks, and DOS attacks. Kumar et al. [36] proposed an authentication protocol for WSNs and claimed it could satisfy all the security requirements of the WSN; however, He et al. [37] proved that the scheme was weak against insider attacks and offline password guessing attacks and could not provide user anonymity. Kumar proposed another enhanced scheme in [13] and once again claimed that the scheme could withstand most of the known attacks and provide user privacy. However, with the Scyther implementation, given in Section 5.3, we found that the improved scheme presented in [13] was still vulnerable to insider attacks, parallel session attacks, and impersonation attacks. Farash et al. [15] proposed a key agreement and authentication protocol for WSNs in the Internet of Things (IoT) environment. The scheme was well designed and provided security against several well-known attacks. The author proved the strength of the protocol with BAN logic and further confirmed the theoretical analysis results by implementing the protocol in the AVISPA [38] tool. However, similar to other schemes discussed above, Farash et al. [15] did not consider the requirement of concurrent sessions, which are more likely to occur in an IoT environment. Moreover, our implementation of the scheme of Farash et al. [15] in Scyther revealed that the GW was vulnerable against insider attacks and impersonation attacks. The scheme was insecure in the presence of an intruder as discussed in Section 5.3, which assumed that the initial knowledge set of intruders included the identities of all sensor and user nodes. With known identities, an intruder can impersonate the user node and deceive the GW to falsify the authentication properties. Similarly, the Scyther implementation of the recently published work of Y. Lu et al. [16] and Quan et al. [14] revealed that at least two protocol participants falsified the authentication properties. The majority of the schemes discussed above provided the GW and user authentication schemes; however, Farash et al. [15] and Y. Lu et al. [16] also considered the GW and sensor node authentication, while Farash et al. [15] also allowed the user to access the data from sensor nodes directly. Li et al. [39] proposed an authentication protocol for sensor and user nodes. However, the proposed scheme requires time synchronization among protocol participants, and also employs the asymmetric elliptic curve cryptography, which is not a good design choice for resource limited WSN applications. For instance, very efficient public key algorithms, such as ECC [1], need a fraction of a second to execute the encryption/decryption procedures, while a symmetric key algorithm , such as RC5 [2], needs only a fraction of a millisecond to perform encryption and decryption procedures [3][4][5]. Unlike all the schemes discussed above, our proposed scheme, the SMSN authentication protocol suite, allows the sensor and user nodes to establish multiple concurrent connections with different sensor and sink nodes, which makes our scheme suitable for deploying it in the future to support IoT and related emerging technologies. Moreover, the SMSN authentication protocol suite provides several kinds of mutual authentications; for instance, after the initial authentication, a sensor or the user node receives an authentication ticket issued by the base station. The ticket can be further used for sensor-sink, user-sink, and user-sensor mutual authentication. The SMSN protocol suite consists of six protocols: three protocols deal with mobile sensor node authentication with sink nodes, and the other three deal with user node activation and authentication with the base station, sink nodes, and sensor nodes.

System Overview and Problem Statement
A typical WSN consists of the base station (BS), sink node (S), sensor node (N) and user node (U i ). We assume that the BS knows the public keys of the sink (S), sensor (N) and user (U) nodes.

System Architecture
An IoT smart service provider deploys the WSN with various base stations connected to the internet through a service center (SC). In the WSN, each BS j forms a group G j consisting of neighbor base stations and associated sink nodes. All group members share a symmetric group key K j G , which is controlled by the group master BS j using a group key agreement protocol such as discussed in [40]. Furthermore, the base station can access and download the profile of the mobile Sensor (N) and User (U) nodes. Each profile has a unique secret number n i s ; besides being know to the base station, this secret number is also known to the corresponding Sensor (N) and User (U) nodes. The profile and unique secret number n i s of all legitimate users and sensor nodes are accessible to the base station through the service center.
An example of the overall system architecture is depicted in Figure 1a. BS 1 creates a group consisting of neighbor BS 0 and BS 2 and associated sinks (S 1 , S 3 ). BS 1 generates a group key K 1 G and shares it among all group members. The profiles and the associated unique secret number of U 1 , N 1 , and N 2 are accessible to BS 0 , BS 1 , and BS 2 via the service center. An application scenario is given in Figure 1b. In a smart hospital, the health status of a hospitalized patient is continuously monitored by the several sensors mounted over the patient's body. For the secrecy of patients' health data it is essential that only authorized users be able to access the data. When a patient takes a walk in the hospital, all the mounted sensors continuously transfer the different sets of data to the nearby sinks.
With the SMSN, the sensors do not need to follow the full authentication procedure for each data session; instead, the session continues by sharing a simple re-authentication ticket that provides the sensor-sink mutual authentication. Similarly, when an authorized doctor or nursing staff visits patients, he or she can access the sensor data in real time via a user device by establishing multiple data sessions with various sinks and sensor nodes. While he moves from patient to patient, his device does not need to follow a complete authentication procedure for each data session; rather, a simple re-authentication ticket can be used for re-authentication. From outside of the hospital, an authorized person can log into the hospital system and access the necessary data from sink and base stations by using the same re-authentication ticket. . Sensor node N 1 is initially authenticated by BS 1 ; while moving across the network it is re-authenticated by the re-authentication ticket. At the final destination N 1 shares data with multiple sink nodes while user node U 1 collects data from sensor node N 2 and sink node S 3 . (b) An application scenario of Secure Mobile Sensor Network (SMSN) in a smart hospital. Authorised doctors and nursing staff can access the data from sensor nodes using a user device.

Problem Statement
As described earlier, in IoT and other related emerging technologies, a mobile sensor or user node may need to exchange data with multiple nodes and so will experience the authentication process multiple times. With multiple concurrent connections, the authentication process becomes even more expensive while a node moves across the network. As shown in Figure 1a, sensor node N 1 is communicating with sink nodes S 5 and S 6 simultaneously. Likewise, user node U 1 is communicating with sink node S 3 and sensor node N 2 simultaneously. In such an application scenario, when a sensor or the user node moves across the network the frequency of the re-authentication process increases in proportion to the number of concurrent connections. Moreover, to establish multiple data sessions, it is essential that a protocol participant run multiple instances of the protocol run, which makes the security issue even more challenging. To perform multiple parallel re-authentications, it is evident that the protocol participants run multiple instances of the protocol. With the multiple protocol runs, the assurance of security of the protocol becomes more challenging. Therefore, for seamless services, lightweight yet secure re-authentication is vital.
According to our knowledge, we are the first to propose an authentication protocol for concurrent secure connections. To perform multiple parallel re-authentications, the protocol participants must run multiple instances of the protocol. With multiple protocol runs, the assurance of security of the protocol becomes more challenging. We developed our scheme, the SMSN, considering the following constraints: (1) the communication channels are insecure; (2) an intruder with the capabilities as described in Section-5-C is present in the network to launch various attacks; (3) due to the requirements for a WSN deployed in an IoT environment, the protocol participants are allowed to run multiple instances of the protocol; and (4) user and sensor nodes can dynamiclly leave and join the network and can move across the network.

Notations
• BS j = The jth base station

Proposed Scheme
The SMSN protocol suite consists of two protocol suites, the Keying Protocol suite and an Authentication Protocol suite. The Keying Protocol suit further comprises a key agreement protocol, a key retrieval protocol (which is the same as the one employed in [10]), and a key management protocol; likewise, the authentication protocol further comprises six protocols, three dealing with mobile sensor node authentication with sink nodes and the other three dealing with user node activation and authentication with a base station, sink nodes, and sensor nodes in different scenarios. In subsequent sections, the SMSN protocol suite is described in detail.

Keying Protocol Suite
In key generation protocol a 'commitment key' is generated by group participants (the base station and sink nodes) using an irreversible function similar to that as used in [10,41]. The 'commitment key' is further used to drive multiple time-based keys; for instance, the ticket encryption key and session key between the sink and user/sensor are derived from the 'commitment key'.

Key Agreement Protocol
The key generation and distribution mechanism is shown in Figure 2 and consists of the following steps: (1) After every time interval T d , BS j broadcasts the key generation information (Key MSG ) to all members of G j . (2) Using the key generation information (KEY MSG ), all members generate a Commitment Key Generator ζ All members of G j can now generate a " Chain of Key Generators" of length L by using an irreversible one-way function: k+i . (4) Each generator (ζ) in the chain is used by function gat specific intervals to derive indexes and a ticket encryption key pair. For instance, at interval k for any sensor or user node i, which is requesting the BS j to join the network, the function g(ζ j k ) = H(ζ j k , H(n i 0 ))||H(k) generates ticket encryption key K j k and index V k value. In function g the value n i 0 is a secret nonce sent by node i in a network join message. (5) Furthermore, BS j issues a session key based upon the ticket encryption key K j k and secret nonce n i 0 , i.e., K i S = H(K j k , n i S ) where n i S is the secret random number assigned to legitimate sensor and user node. All the symmetric keys generated in the above discussion have a size of 256 bits (32 bytes); hence, in the subsequent section of authentication protocols any symmetric encryption supporting the 256-bit key can be used, e.g., RC5/6 [2]; Rijndael [42], Twofish [43], MARS [44], and Blowfish [45].

The Key Retrieval Protocol
After initial authentication, BS j issues a ticket to the requesting node. The ticket consists of two parts: (1) The first half consists of the sensor node identity (id) N i , the session key K i s , secret nonce n i 0 , and the profile. This part of the ticket is encrypted with time-based key K i l .
(2) The second half consists of sensor node id N i , the hash of group id H(G j ) , and the required information to retrieve the time-based key K i l . The hash of group id H(G j ) is an optional field used only if sink nodes can join multiple base stations; in that case, it is used to identify the group and to select the correct keychain.
In the key retrieval, information depends on the selected mode and can be the scrambled index value V, index vector V Hash , or index value i; the modes of a ticket are explained below.

Mode-01:
In mode-01, the ticket retrieval information comprises the index value (V i ), requesting node id N k , and the hash of the user's private key. The ticket verifier searches the appended index value (V i ) within its generated vector (V). A search hit at the ith place means that key K j i can decrypt the ticket.

Mode-02:
If the group members are in a fully secure environment, the SMSN employs a simple ticket retrieval strategy. Instead of using a scrambled index value V in mode-02 in the ticket retrieval, the information contains the interval value. In this mode, the ticket verifier does not need to run a search algorithm.

Mode-03:
In mode-03, the ticket retrieval information is the same as in mode-01 except it includes a hash vector of size log 2 |V| − 2. These hash values are carefully chosen nodes of the binary hash tree, which is generated such that the leaf nodes are indexed vector (V) values as shown in Figure 3.
Search Algorithm: • Start from the root and move down • Ignore appended values and follow the path of the reconstructed node • Continue until level log 2 |V| − 1 is reached • At level log 2 |V|, select the appended value that is the index value.
Mode-03 is suitable if the Chain of the Key Generator is very long. The tree "root node" is included in T k (optionally), which ensures that a trusted group member generated T k .

Key Management Protocol for the Sink Node
At the start of the Chain of the Key Generator, the sink node reissues the ticket and session keys to associated nodes. To spread out the workload in the time dimension the sink node keeps the history of the previous key chain and issues a ticket/session key based on the moving window algorithm. Let us consider a chain with a length of 3; Figure 4 shows how the sink node spread the workload throughout the chain by adopting the moving window approach. Step 1: The sink node discards the previous chain C 0 and generates the commitment key generator G j 0 for the next chain C 2 .
Step 2: The sink node reissues the ticket and session key to all sensor nodes authenticated at interval 1.
Step 3: The sink node reissues the ticket and session key to all sensor nodes authenticated at interval 2.
Step 4: The sink node reissues the ticket and session key to all sensor nodes authenticated at interval 3 and discards the previous chain and generates the commitment key generator G j 0 for the next chain.

Authentication Protocol Suite
When a sensor node joins the system, it goes through the Sensor Activation and Authentication Protocol (SAAP). After SAAP, N i can establish multiple concurrent secure connections with sink nodes using the authentication ticket (T k ); similarly, N i uses the T k for re-authentication while moving across the network. Likewise, when a user node U i joins the system, it goes through User Activation and Authentication Protocol (UAAP); subsequently, U i can use the authentication ticket (T k ) for authorization to collect data from multiple sink and sensor nodes. In a concurrent run of multiple instances of the protocol, the message authentication plays a critical part in preventing the replay attack and to achieve the objectives of the authentication protocol as defined in [19,20]. In an SMSN message, authentication is accomplished by a secure exchange of a randomly generated nonce challenge. Moreover, in all the protocols discussed below, if the protocol initiator (user or sensor node) does not hear the response to an authentication/switch request, the protocol initiator resends the authentication/switch request including a new nonce and 'resend' flag. This step helps detect the impersonation, replay, and parallel session attack.

Sensor Activation and Authentication Protocol (SAAP)
Sink node S j periodically broadcasts a Hello message (BS j ||S j ). If a node N i wants to join the WSN, upon hearing the Hellomessage, N i generates an encryption key K i TS = H(BS j ⊕ n i S ), encrypts the joining message with the generated key, and continues as follows:  Figure 5, N i sends a JOIN message to sink S j enclosing n 0 and encrypted with the generated encryption key K i TS . M2 Upon receiving the request from N i , the S j forwards the request in conjunction with its identity and challenge n 2 to base station BS j . M3 BS j retrieves the profile from the database, and if N i isa legitimate sensor node, BS j generates the key K i TS = H(BS j ⊕ n i S ), and sends u 0 = E i TS (n 0 + 1||n 1 ||T k ||T R ||K i s ) to S j in M3. M3 also includes ticket T k , n 1 (a challenge for N i ), and n 2 (challenge response for the sink node), all encrypted with K j G . The sink node S j verifies the challenge n 2 , stores n 1 and retrieves the profile and K i s from the ticket. M4 S j forwards the u 0 to N i . After a challenge (n 0 + 1) verification, N i accepts T k and may start sending data to S j . M5 S j sends the challenge response (n 1 + 1) to BS j for the confirmation of a successful protocol run.

M1 As shown in
M6 After challenge (n 1 + 1) confirmation, S j starts accepting sensor data; otherwise, it marks T k as an invalid ticket.
In the SAAP, a secure exchange of n 0 ensures the message authentication between the sensor node and the base station, n 2 between the sink node and base station, and n 1 between the base station and the sink node, while message authentication between the sensor and sink nodes is established by session key encryption and n 1 . If N i is already registered with BS j , in M1 n 0 can be replaced with the hash of the password value.

Sensor Re-Authentication Protocol -1 (SRP1)
If sensor node N i wants to establish multiple secure connections with sinks S j ∈ G i or when a N i moves from S k → S j such that {S k , S j } ∈ G i , the Re-Authentication Protocol -1 continues as follows:  Figure 6, N i sends Switch Req = E i S (N i ||H(n i 0 ))||T k to S j . The sink S j decrypts the ticket, retrieves K i s , calculates the hash of n i 0 , and makes a comparison with H(n i 0 ) received in the switch message. If the value H(n i 0 ) does not match, the S j will ignore the request and otherwise proceed as follows. M2 S j sends a challenge response along with the new challenge encrypted with session key K i s . M3 N i sends the challenge response n 1 . After challenge confirmation, S j starts accepting data; otherwise, it marks T k as an invalid ticket.

M1 As shown in
In the above procedure, secure exchange of n i 0 ensures the message authentication between the sensor node and the sink node. With this feature, a sensor node can establish multiple secure sessions with various sink nodes as shown in Figure 1.

Sensor Re-Authentication Protocol -2 (SRP2)
If sensor node N i wants to establish another secure connection with sinks S j ∈ G o k or when a N i moves from S k → S j such that S j ∈ G o k , the re-authentication procedure proceeds as follows:  Figure 7, N i sends Switch Req = E i S (N i ||H(n i 0 ))||T k to S j . The sink S j decrypts the second half of T k and verifies the identities of N i and ticket granting base station.

M1 As shown in
M2 After identities verification the sink S j forwards the request in conjunction with a challenge n 2 to base station BS j . M3 BS j retrieves the profile from T k , and if N i isa legitimate sensor node, the BS j generates the key K i TS = H(BS j ⊕ n i S ), and sends u new M3 also includes ticket T k , n 1 (a challenge for N i ), and n 2 (challenge response for the sink node), all encrypted with K j G . The sink node S j verifies the challenge n 2 , stores n 1 and retrieves the profile and K i s from the ticket. M4 S j forwards u new 0 to N i . After challenge (n 0 + 1) verification N i accepts T k and start sending data to S j . M5 S j sends the challenge response (n 1 + 1) to BS j ; it confirms a successful protocol run. M6 After challenge (n 1 + 1) confirmation S j start accepting data; otherwise, it marks T k as an invalid ticket.
In the SRP2, a secure exchange of n 0 ensures the message authentication between the sensor node and the base station, n 2 between the sink node and base station, and n 1 between the base station and the sink node, while message authentication between the sensor and sink nodes is established by session key encryption and n 1 . If N i wants to share data in a secret mode, both N j and S j generate a private session key K j sp = H(K i s , n i 0 , n 1 ). With this feature, a sensor node can establish multiple secure sessions with various sink nodes as shown in Figure 1.

User Activation and Authentication Protocol (UAAP)
In some scenarios a user may desire to access data from the sensor network, for example, in IoT applications such as smart homes and smart buildings, a smartphone user may want to get sensor node data. In SMSN authentication protocol suites, an authenticated user (holding a valid ticket) can access data directly from sensor nodes and/or can collect from the sink node. The ticket structure for U i is the same as the ticket structure discussed above for N i where the sensor node identity and profile are replaced with the user node identity and profile. The user profile information includes the permissible accessibility information. In the User Activation and Authentication Protocol (UAAP) a user can acquire a ticket from BS j in two different ways. If the user is not in the communication range of BS j it routes the joining message via the nearest sink node S j ; the protocol proceeds exactly as in the SAAP. However, if the user is in the communication range of BS j , the user U i generates an encryption key K i TS = H(BS j ⊕ n i S ), encrypts the joining message with the generated key, and proceeds as follows: M1 As shown in Figure 8, U i sends a JOIN message enclosing n 0 and the user identity to base station BS j . M2 BS j retrieves profile from the database, and if U i is a legitimate user, the BS j generates authentication ticket, and send along with, n 1 ( a challenge for U i ), and n 0 (challenge response), all encrypted with K i TS = H(BS j ⊕ n i S ). The ticket structure is same except the secret nonce n 1 enclosed inside ticket is generated by BS j . M3 The user node U i verifies the challenge n 0 , stores T k and n 1 . U i sends the challenge response (n 1 + 1) to BS j ; it confirms a successful protocol run . After receiving a challenge response (n 1 + 1) the BS j updates the status of U i from idle to active user.
In User Activation and Authentication Protocol, secure exchange of n 0 ensures the message authentication between user node and base station and n 1 between the base station and user node.

User-Sink Authentication Protocol (USiAP)
After acquiring the authentication ticket, if user U k wants to retrieve data from sink nodes S j , it sends a JOIN request in conjunction with a ticket to S j and then follows the same procedure as discussed in Sensor Re-Authentication Protocols 1 and 2; except after ticket verification, S j can piggyback data with the rest of the messages. Using the authentication ticket, user U k can also establish multiple concurrent connections with various sink nodes.

User-Sensor Authentication Protocol (USeAP)
After acquiring the authentication ticket, if user U k wants to access data directly from sensor nodes N i , it sends a JOIN request in conjunction with a ticket to N i and the procedure proceeds as follows:  Figure 9, U k sends a JOIN message in conjunction with ticket and challenge n 0 encrypted with its ticket centered session key. M2 Upon receiving the request from U k the N i forward the ticket and encrypted challenge n 1 to sink node s j . M3 Sink decrypts the ticket and retrieves U k s profile and session key K k S , and if U i is a legitimate user node, S j sends K k S and challenge response (n 1 + 1) to N i . M4 After challenge verification, N i generates a private session key K k ps = H(K k s , n 0 ) and sends a challenge response encrypted with the private session key. U k also generates the private session key and verifies the challenge response.

M1 As shown in
In User-Sensor Authentication Protocol suite, secure exchange of n 0 ensures the message authentication between users and sensor node, while the secure exchange of n 1 ensures the message authentication between sensor node and sink node.

Security Analysis
This section presents the comprehensive security analysis of the SMSN protocol, including an informal security analysis and discussion of a formal security analysis using BAN logic [32], and finally presents the Scyther [17,18] implementation result of the SMSN and previously proposed schemes [11][12][13][14][15][16].

Informal Analysis and Discussion
To verify the strength of the SMSN protocol against known attacks we introduce an intruder in the network with capabilities as follows: It has an initial information set that contains the IDs of all users, sensor nodes, sink nodes and base stations. It can intercept and record message exchanges between participating entities. It can redirect, spoof, and replay the messages. The subsequent sections show that the intruders, with all the above-mentioned capabilities, fail to launch a successful replay, parallel session, man-in-middle , impersonation, and several other attacks against the SMSN protocol suite.

Replay, Multiplicity, Parallel and Man in Middle Attacks Against the SMSN
We introduce an intruder, as discussed above, in the network and launch replay, multiplicity, parallel session, and man-in-middle attacks against the SMSN for three different scenarios, as shown in Figures 10-12. The intruder Zimpersonates a protocol participant, intercepts the messages, and replays them to deceive other protocol participants. Replay, multiplicity, parallel, and man-in-middle attacks against the SAAP for three different scenarios are given below.

Scenario 1:
For the given scenario in Figure 10, let us suppose a sensor node N i sends a request for authentication to sink S j ∼ BS j . During the protocol run an intruder Z(N i ) intercepts the messages and replays them to another sink S i ∼ BS j ; the attack proceeds as follows: The intruder Z(N i ) intercepts M1 and replays it to S i . The attack is detected immediately when BS j receives two M2 messages enclosing the same M1. BS j sends M3 to both sinks comprising the 'Alert' flag and a different n 1 nonce challenge. Z(N i ) intercepts M6 and replays it to S i ; note that the intercepted message M6 comprises a different n 1 which is the only valid response for a sink S j . Upon receiving the wrong challenge response, the sink S i identifies the intruder node. The SAAP not only detects the replay attack but also identifies the intruder. Figure 10. The intruder Z impersonates the protocol initiator N 1 (can be a sensor or user node). Intruder Z(N 1 ) intercepts the messages between N 1 and sink S1 and replays them to sink S2. Both sinks are associated with base station 1 and share the same keychain.

Scenario 2:
For the given scenario in Figure 11, let us suppose a sensor node N i sends a request for authentication to sink S j ∼ BS j . During the protocol run an intruder Z(N i ) intercepts the messages and replays them to another sink S i ∼ BS i ; the attack proceeds as follows: The intruder Z(N i ) intercepts M1 and replays it to S i . Unlike in scenario 1, neither base station BS j and BS i can detect the attack at this stage and replies with a normal M3 to associated sink nodes S i and S j , respectively. However, both M3 messages comprise a different n 1 nonce challenge. Z(N i ) intercepts the M6 and replays it to S i ; note that the intercepted message M6 contains a different n 1 which is the only valid response for the sink S j . Upon receiving the wrong challenge response, the sink S i identifies the intruder. Figure 11. The intruder Z impersonates the protocol initiator N 1 (can be a sensor or user node). Intruder Z(N 1 ) intercepts the messages between N 1 and sink S2 and replays them to sink S3. Sink S2 is associated with base station 1 , and Sink S3 is associated with base station 2.

Scenario 3:
For the given scenario in Figure 12, let us suppose two intruders impersonate the sink S j ∼ BS j and sensor node N i ; the intruder Z(N i ) is within the region of S i ∼ BS i , and intruder Z(S j ) is outside somewhere close to node N i . Furthermore, both intruders can communicate through a private link with zero delay. During the protocol run intruder Z(S j ) intercepts the messages sent by sensor node N i and replays it to BS j ; also Z(S j ) shares all the intercepted messages with fellow intruder Z(N i ) via a private secure channel; the attack proceeds as follows: The intruder Z(S j ) intercepts M1 sent by N i and shares the intercepted message with Z(N i ). The intruder Z(N i ) sends the intercepted message to S i ∼ BS i ; the protocol proceeds normally and upon receiving M4 the intruder Z(N i ) sends the message M4 to Z(S j ). The intruder Z(S j ) sends M4 to sensor node N i ; upon receiving M6 the intruder Z(S j ) shares the message M6 with Z(N i ). The intruder Z(N i ) sends M6 to S i ∼ BS i and the attack is completed. The attack is only successful if the replay of M6 is delivered to S j within a time interval of Td/L where L is the length of the keychain. Moreover, in practice when the private link between fellow intruders adds a communication delay, N i can detect the attack by comparing the TR (registration time sent in u 0 ) with the local time. Figure 12. Two intruders impersonate the sink node S 1 BS 1 and sensor node N 1 ; the intruder Z(N 1 ) is within the region of S 1 BS 1 , and intruder Z(S 1 ) is outside somewhere close to node N 1 . Both intruders can communicate with zero communication delay via a private link.
As the outcome of the above attack, N i considers that the authentication process was completed successfully. However, the intruders cannot get any useful information during a protocol run: Z(S j ) does not know the session key delivered to N i , so Z(S j ) cannot further communicate with N i . Due to the unavailability of a data link, N i uses the ticket to run SRP1/2. However, a problem exists on the other side: sink S i and base station BS i consider that they authenticated a legitimate sensor N i successfully; from their point of view, the sensor N i is within the region of BS i but in reality, N i is in the region of BS j . Similarly, in the case of SRP1, SRP2, UAAP, USiAP, and USeAP the intruder Z fails to launch successful attacks for scenarios 1 and 2; however, the intruder Zcompletes the attack in scenario 3.
In a nutshell, replay, multiplicity, parallel and man-in-middle attacks against the SMSN protocol are not successful. Even though in scenario 3 the intruders completed the attack, they could not cause a serious security issue because after the completion of the protocol run, the intruder could not get useful information such as the session key, ticket, or partial session key. Furthermore, the attack can be avoided by introducing a timestamp in each message exchange. For illustration, the intruders need to wait for a significantly longer time to replay M4 and M6, and this significant delay can be detected with the time stamp, which reveals the existence of the intruder in the network.

Black Hole Attack
In a black hole attack [46][47][48] the intruder impersonates a node and blocks or drops the messages upon receiving them. In the SMSN, the sensor and user nodes can connect to multiple sink nodes simultaneously; hence, failure of data exchange on one route does not block the data delivery towards the base station. Moreover, the black hole attack is detectable in our scheme because the SMSN ensures binding by employing an exchange of secret nonce between N i ↔ S j , N i ↔ BS j , and B j ↔ B. Consecutive failures of exchange of challenge detects the black hole attack. Once the black hole is detected, the sensor node can send data via another sink node.

Wormhole Attack
In a wormhole attack [49,50], the intruder captures the messages in one location and tunnel to another location to a fellow intruder who replays the tunneled messages in another location area. The attack discussed in scenario 3 can be regarded as a wormhole attack. From the point of view of replay, multiplicity, parallel and man-in-middle attacks, the attack in scenario 3 did not achieve its objectives, but from the point of view of the wormhole attack, the attack is successful. The solution for the problem is similar to the one we discussed earlier: the attack can be avoided by introducing a timestamp in each message exchange.

Analytical Attacks
In an analytic attack [31,51], the intruder intercepts the messages and using cryptanalysis tries to recover a cryptographic key. With the inclusion of a time-based key, our scheme inherits the freshness property, which defies the capability of the intruder to launch analytical attacks, as it has a max time of T d to acquire the time-based key, which makes it difficult to launch analytical attacks.

Topological Centered Attacks
In [52,53] the authors presented an authentication protocol for a sensor network in which the sink issues a re-authentication ticket that includes a list of neighbor sink nodes. This information can lead to topological centered attacks [27,28] such as identity replication attacks. In our scheme, the topological information is entirely obscured from the sink and sensor nodes.

Formal Analysis Using BAN Logic
The BAN logic [32] is a widely used formal method for the formal analysis of security protocols. To prove the security of the SMSN protocol suite it is sufficient to demonstrate the security of the SAAP and UAAP protocols; the rest of the protocols are extensions of the SAAP and UAAP and use the ticket and session key established in the SAAP and UAAP protocols run. Hence, proof of SAAP and UAAP protocols concludes the security of the SMSN protocol suite.
The three basic objects of BAN logic are principals, formula/statements, and encryption keys. The principals, the protocol participants, are represented by symbols P and Q. The formula/statements are symbolized by X and Y and represents the content of the message exchanged. The encryption keys are symbolized by K. The logical notations of BAN-logic used for our analysis is given below: • P |= X : P believes X, or P would be enabled to believe X; in conclusion, P can take X as true.
• P ≺ X : P sees/receives X. P initially has or received a message X and P can see the contents of the message and is capable of repeating X. • P| ∼ X : P once said X. P has sent a message including the statement X. However, the freshness of message is unknown. • P ⇒ X : P controls X and should be trusted for formula/statement X.
• #(X) : X is fresh; it says, X never sent by any principal before.
• P K ← → Q : P and Q shares a key K to communicate in a secure way and K is only known to P, Q and a trusted principal. • (X) K : The statement X is encrypted by key K. • {X} Y : It stand for X combined with Y. Y is anticipated to be secret and its implicit or explicit presence proves the identity of a principal who completes the {X} Y .
Some primary BAN-logic postulates used in the analysis of the SMSN are given below: • Message meaning rules: The SAAP protocol should achieve the following goals: Let us analyze the protocol to show that N i and S j share a session key: From I1, we have The (1), A6 and message meaning rule infers that The A1 and freshness conjuncatenation comprehends that The (2), (3) and nonce verification rule deduces that The (4) and believe rule infers that From A2, (5) and jurisdiction rule, it concludes This belief confirms that BS j has received a message from a legitimate N i . From I2, we have BS j ≺ n 2 The (7) and message meaning it infers that The A2, A1, (3) and freshness conjuncatenation comprehends that BS j |= #{n 0 , n 2 , (N i n i S ← → BS j )} (9) According to nonce freshness, this proves that BS j confirms that N i is recently alive and running the protocol with BS j .
From I3, we have The A7 and (10) deduce that The A3, (11) and freshness conjuncatenation comprehends that The (11), (12) and nonce verification rule infers that The (13) and believe rule comprehends that The logic belief proves that S j is confident and believes that K i S is issued by BS j ; moreover, the freshness of the key also suggests that BS j is alive and running the protocol with S j and N i .

BAN Logic Analysis of UAAPP:
The UAAP protocol should achieve the following goals: Idealization of UAAP: Let us analyze the protocol to show that U AAPachieves the mentioned goals: From I1, we have The (26), A4 and message meaning rule infers that The A1 and freshness conjuncatenation comprehend that The (27), (28) and nonce verification rule deduces that The (29) and believe rule infers that From A1, (30) and jurisdiction rule, it concludes This belief confirms that BS j has received a message from a legitimate N i . From M2, we have The (32), A3 and message meaning rule comprehends that The (33), A2 and freshness conjuncatenation rule infers that The (33), (34) and nonce verification rule deduce that The (35) and believe rule infers that (36 Goal-2) The (35), (36) and jurisdiction rule concludes that (37 Goal-1) From I3, we have BS j ≺ n 1 (38) The (36), (37), (38) and meaning rule comprehends that (39 Goal-3) Authentication claim is not fulfilled; Y = Authentication claim is fulfilled; O = Authentication claim is fulfilled but falsified for protocol instances >3.

Verifying Protocol Using Scyther Tool
The previous section proved that according to the BAN logic the SMSN is a secure authentication scheme. The BAN logic provided a foundation for the formal analysis of security protocols, but few attacks can slip through the BAN logic [32]. For further proof of the strength of the SMSN protocol suite, we implemented the SMSN and [11][12][13][14][15][16] schemes in the automated security protocol analysis tool, Scyther [17,18]. Our proposed scheme provides a strong defense against known attacks in the presence of an intruder (Z) which is capable of regulating the communication channel, redirecting, spoofing, replaying or blocking the messages. It has initially known information, e.g., IDs and public keys of all users, and any intercepted message is additional information to the current information set (S), i.e., S ∪ {m}. It can generate a fresh message from known data, e.g., S m, and can run multiple instances of the protocol. The Scyther tool verifies the protocol claims and checks the possibility of attacks against the protocol. The claims are the event that describes the design and security properties of the authentication protocol. We consider four claims as defined below; for a detailed description of protocol claims, please refer to [19,20].
In Scyther the protocol is modeled as an exchange of messages among different participating 'roles'; for instance, in sensor node authentication, the sensor node is in the role of initiator, the sink is in the role of responder and the base station is in the role of a server. The Scyther tool integrates the authentication properties into the protocol specification as a claim event. We tested our protocol [11][12][13][14][15][16] employing claims, as mentioned earlier, with the parameter settings given in Table 1.
The results are shown in Table 2. It is clear that in the presence of an intruder (as defined above), our protocol qualifies all the protocol claims and no attacks were found. Hence, for a large number of systems and scenarios, our protocol guarantees safety against a large number of known attacks, such as impersonating, man-in-middle and replay attacks, etc. In contrast, [11][12][13][14][15][16] are susceptible to several attacks and failed to fulfill the authentication claims. Moreover, in protocol schemes [11][12][13][14][15][16], there is a lack of sender-receiver binding verification, and an intruder can exploit this situation to impersonate a sensor node and run multiple instances of the protocol to launch multiplicity and man-in-middle attacks.

Performance Analysis
Although the SMSN authentication protocol suite covers authentication procedures for both sensor and user nodes, for the sake of simplicity, we compare the efficiency of the SMSN with user authentication protocols. We compared the efficiency of the SMSN user authentication protocols considering computational cost, message complexity and time synchronization requirements to that of [11][12][13][14][15][16]. Unlike in [11][12][13][14][15][16], the SMSN allows the user to be authenticated with both sensor and sink nodes.
The total computation cost is estimated as the sum of the total number of E = encryptions/decryptions, M = Multiplications, H = hash, X = XOR, and T = Time Synchronization operations. Moreover, we assume that cryptographic hash and symmetric encryption/decryption operations have computational complexity similar to O(m), where m is the size of the message. All the schemes in [11][12][13][14][15][16] considered that the registration process took place via a secure channel. We assume that in all schemes the user node U i and Gateway GW j exchange the registration information using a secure encrypted channel. Furthermore, one encrypted unicast message requires two E operations, one for encryption and one for decryption. Similarly, a broadcast message to N recipient adds the (N + 1)E operations in the total computational complexity.  From Table 3 we can see that computational complexity of SMSN authentication protocols in the registration phase is slightly more expensive compared to Kumar et al. [13] and Farash et al. [15]; however; in the authentication phase, the SMSN authentication protocols completely outperform Kumar et al. [13] and Farash et al. [15]. H. Tseng [11] and Yoo et al. [12] are the most computationally expensive schemes during the registration phase, but in the authentication phase, H. Tseng [11] is the most efficient scheme followed by the SMSN. However, regarding sensor node computational efficiency, in our scheme, the overall workload of a sensor node is very low. Moreover, unlike the [12][13][14]21] schemes, the SMSN does not require time synchronization between the Gateway and user node.
The communication complexity is calculated as the sum of the total unicast and broadcast message exchange. Figure 13 shows the overall communication complexity in a WSN when the number of sensor nodes is fixed in the network, and the number of new users' requests is constantly increasing. The message complexity of [11,12] increases multiplicatively by increasing the number of nodes; conversely, it grows slowly in the case of the SMSN, [13][14][15]. Figure 14 shows the overall communication complexity for various network sizes with the same number of user requests. This metric is only useful for a WSN with mobile sensor and user nodes. The message complexity of [11,12] increases rapidly with an increase in the number of new users' requests; conversely, it remains constant with the SMSN, [13][14][15]. This suggests that the schemes proposed in [11,12] are not suitable for highly dynamic mobile WSNs where the frequency of leaving and joining the network is high. However, a more interesting comparison in terms of communication efficiency is the comparison based on the amount of data exchanged during the protocol run. The numerical results are taken for a dynamic and mobile sensor network consisting of 100 nodes. The probability that a new user may join the network and an existing user may leave the system defines how frequently the users join and leave the network. The average communication cost per user is calculated for the dynamic probability of 0.05 to 0.5, and the results are shown in Figure 15.
SMSN user-sink authentication outperforms all other schemes from less dynamic to highly dynamic networks. However, in a less dynamic network with a dynamic probability of less than 0.05, the SMSN user-sensor authentication is slightly more expensive than the scheme of H. Tseng [11]. Even though in a less dynamic system the SMSN user-sensor authentication is slightly more expensive than [11], the performance gap decreases, and for highly mobile and dynamic networks, SMSN performs better than the scheme of H. Tseng [11].

Conclusions
Due to the recent growth in WSN technologies, we have observed an enormous paradigm shift in sensor network applications. The authentication and security goals of a sensor network have become more crucial and challenging. Most of the user and sensor node authentication schemes for WSNs have been developed without taking into account the requirements of integrating WSNs with emerging technologies such as IoT. We developed an SMSN scheme considering the requirements of mobile and dynamic WSN applications as discussed in Section-III. We noted that the user authentication schemes designed for sensor networks [11][12][13][14][15][16] do not meet the authentication properties; for example, the execution of these schemes in the Scyther tool revealed that the participating entities failed to achieve wider objectives (defined as protocol claims in Section 5-C) of the authentication protocol. Finally, we compared the efficiency of the SMSN user authentication protocols with the schemes in [11][12][13][14][15][16]. We observed that concerning the computational cost, our scheme is slightly more expensive compared to [13,15] during the registration phase but the SMSN totally outperforms both in the authentication phase. Regarding message complexity our proposed scheme totally outperforms [11][12][13][14][15]; however, the performance of the scheme of Y. Lu et al. [16] is close to the SMSN. Finally, unlike the schemes in [11][12][13][14][15][16], the SMSN does not require time synchronization between the Gateway (base station) and the user node. The main focus of this work was to discuss and provide solutions for the emerging challenge that has emerged from the integration of the WSN in IoT applications. To prove the usability of the proposed scheme, we made a comprehensive security and performance analysis and simulated the proposed idea in an automated protocol verifier tool, the Scyther. However, for future work, it will be interesting to investigate the usability of the SMSN by implementing it on an application specific testbed. Moreover, in the near future it will be possible to incorporate the basic Internet functionality in the sensor node. We believe it will further enhance the application scenarios for the SMSN; for instance a user device will be able to collect real-time sensor data remotely via the Internet. Moreover, we are further investigating the usage of SMSN for the promising future internet architecture, known as Name-Data-Networking (NDN), which is extensively studied in the literature [54][55][56][57][58][59]. In NDN the contents verification is achieved by the use of asymmetric cryptography. We argue that in future especially in IoT application scenarios the devices will be resource constraint devices; for instance, the sensor network is going to be the part of IoT. For resource constraint devices the asymmetric cryptography is computationally expensive. We believe that SMSN protocol suit with some modifications can be a suitable candidate for NDN internet architecture.