## 7 Security Considerations for Proposed Mobility Schemes
### Authentication of the MN before It Is Allowed to Join the PAN  
When a new MN enters a PAN for the first time, it informs a SN about its own home address and HA's (Home Agent's) address. Also the MN generates a random number (R1), known as challenge, and encrypts it with the shared key between itself and it's HA, i.e., K\({}_{\text{MH}}\). Then the MN sends this encrypted message to its associated SN. The SN forwards the message to its MSP by encrypting it with the key shared between itself and GW, i.e., K\({}_{\text{SG}}\). The MSP then forwards the message to the GW. When the GW receives the message, it decrypts it with the key K\({}_{\text{SG}}\) and gets to know that this message is sent by the legitimate SN and the message is destined for MN's HA. The GW then informs the MN's HA that the MN is currently located in its PAN. Following this, a security association is set up between the GW and HA, using IKE [26]. It should be noted that the legitimacy of the HA can be established during the creation of security association between GW and HA, using IKE. This is because IKE uses public key and certificates signed by a trusted authority [27]. Thereafter, the GW forwards the MN's challenge to the HA, using the newly created security association. The HA then decrypts the number (R1) using K\({}_{\text{MH}}\) and generates a random number (R2) and encrypts the concatenate of R1 and R2 with MN's and its shared key, i.e., K\({}_{\text{MH}}\). The HA then sends the encrypted concatenation of R1 and R2 to GW. When this information reaches the GW, the GW forwards the information to the MSP by encrypting it with K\({}_{\text{SG}}\). The MSP then forwards the message to the SN. The SN decrypts with K\({}_{\text{SG}}\), and then delivers the message to the MN. Once the MN receives this information, it decrypts the message with K\({}_{\text{MH}}\). The MN then verifies whether it has received R1 or not  
Figure 14: Authentication of a new MN.  
in the message. The MN then reverses the concatenation of R1 and R2 and encrypts the concatenation with the K\({}_{\text{MH}}\) and forwards the message to its SN. The SN encrypts the message with K\({}_{\text{SG}}\) and sends to the MSP that then forwards to the GW, as described above. When the GW receives this message, it forwards the message to the MN's HA after decrypting with K\({}_{\text{SG}}\). The HA then verifies the MN's authenticity by checking whether it received R2 or not. If the HA is satisfied with the authenticity of the MN, it sends a _MN_authorized_ message to the GW, which indicates that MN is a legitimate node. Moreover, the HA update the binding table entry of the MN with its current CoA. On the other end, GW assigns two keys to the MN. The first one is known as Mobile Key (K\({}_{\text{m}}\)) and the second key is known as Communication Key (K\({}_{\text{c}}\)). The GW then sends these keys to the HA. Also it sends K\({}_{\text{m}}\)to the SN by encrypting them with K\({}_{\text{SG}}\). In order to securely deliver the Mobile Key and Communication Key to the MN, the HA encrypts the K\({}_{\text{m}}\) and K\({}_{\text{c}}\) with K\({}_{\text{MH}}\)and forwards the encrypted keys to the GW. The GW then forwards this message to SN by encrypting it with K\({}_{\text{SG}}\). The SN in turn sends it to the MN. The MN decrypts the message and obtains the K\({}_{\text{c}}\) and K\({}_{\text{m}}\).