# A Framework for Constructing a Secure Domain of Sensor Nodes
## 3 The Concept of a Security Domain of Sensor Nodes
### Procedures in a Secure Domain
If diagnostic procedures detect the absence of the M node or G node or the loss of credibility by these nodes, node selection procedures that will take over the Master or Gateway roles are initiated. Data exchange during diagnostic procedures is protected using a symmetric NDK key. The M node counts independently for the NSK and NDK and the size of the data transferred using these keys. If the volume of transferred data exceeds a fixed value, the renewal procedure for the given key is initiated. The NSK key being renewed is generated by the node that owns the key and is then sent to the M node--data transfer is protected by the \"old\" NSK key. The new NDK key is generated by the M node and is passed to all registered nodes in the domain. The \"old\" NDK key is used to protect the exchange of data during the renewal of the NDK key. The size of the sent sensor data is counted by the G node--these data are protected using the NTK key. After exceeding the determinedvolume value of the transferred data using the NTK key, the G node initiates the renewal procedure for this key--an old NTK key is used to protect the transmission. The lifecycle of the sensors' secure domain consists of the following phases:  
1. **The pre-preparation phase--activities related to the preparation of the sensor nodes for work in the sensors' domain. The procedures of this phase are performed in a safe and controlled space outside the area of the regular operation of sensor nodes. In this phase, the most important tasks are performed by the base node (B node), which is a source of credentials for sensor nodes prepared to work in a secure domain. This phase includes the following procedures: 1. The procedure for initiating the Base node (B node); 2. The procedure for preparing a sensor node for registration in the security domain. 2. **The deployment phase of solutions--activities related to the creation of the secure domain of sensor nodes and the registration of new sensor nodes in the domain. The procedures of this phase can be performed in the area of the regular operation of sensor nodes: 3. The procedure for initiating M node--the creation of data structures in the node resources, which act as the Master in the domain; 4. The procedure for registering a sensor node in the security domain; 5. The procedure for restoring the M node and the entire description of the security domain--recovery and verification of data after power on the M node; 6. Procedure for refreshing the node status--the procedure is started by the M node to check the current state of the R node; 7. The procedure for node status confirmation--the process starts when the R node is powered up. 3. **The phase of regular domain work** while maintaining safety rules (security policy)--activities related to secure exchange of the data between the sensor nodes in the domain and among the domains of sensor nodes: 8. The procedure for sending data from the R node to the G node; 9. The procedure for sending data from the G node outside the domain; 10. The diagnostic procedure for the domain; 11. The procedure for electing a new M node; 12. The procedure for removing nodes from the domain; 13. The procedure for electing a new G node; 14. Procedure for renewing the NSK; 15. Procedure for renewing the NTK; 16. Procedure for renewing the NDK. In this paper, attention is focused on activities included in the second phase, i.e., on the security mechanisms for deploying the sensors' domain.