# A Framework for Constructing a Secure Domain of Sensor Nodes
## 5 Results and Discussion
### Analysis of Wireless Bandwidth Consumption
#### 5.2.1 Registering Nodes in a Domain  
The procedure of registering one node in the domain requires the exchange of packet sequences between the node being registered and the M node. The list of names of these packages, their required size, direction, and the number of transfers are shown in Table 1.  
An XBee interface was used to exchange data between the domain nodes. Due to the specificity of this interface, the size of a single frame sent by this interface cannot be larger than 64 bytes. For this reason, the packages described in Table 1 must be fragmented. For example, the contents of one _transfer_key_req_ packet containing 272 bytes will be sent in six XBee frames, of which five will have a maximum size of 64 bytes (full frame), and the last will be 48 bytes. In each full frame, 16 bytes of the XBee header and 48 bytes of the _transfer_key_req_ packet will be sent, and in the previous frame, the payload will cover the remaining 32 bytes of this packet. Packet fragmentation increases the required volume of data to be transmitted over the link--the numbers of XBee frames and bytes to be transmitted in these frames are given in the last two columns of Table 1.  
\begin{table}
\begin{tabular}{l c c c c c} \hline \hline \multirow{2}{*}{**Packet Name**} & **Packet Length (B)** & **Detection** & **Required** & **Number of** & **Number of** & **Number of** \\  & **Packet** & **Number of** & **Bytes in** & **Xbee** & **Bytes in** \\  & & & **Packets** & **Packets (B)** & **Frames** & **Xbee** \\ \hline transfer\_key\_req & 272 & R \(\rightarrow\) M & 1 & 272 & 6 & 560 \\ transfer\_key\_ans & 66 & M \(\rightarrow\) R & 1 & 66 & 2 & 98 \\ diagnostic\_key\_req & 22 & R \(\rightarrow\) M & 1 & 22 & 1 & 38 \\ diagnostic\_key\_ans & 66 & M \(\rightarrow\) R & 1 & 66 & 2 & 98 \\ domain\_desc\_req & 22 & R \(\rightarrow\) M & 1 & 22 & 1 & 38 \\ domain\_desc\_ans & 68 & M \(\rightarrow\) R & 1 & 68 & 2 & 100 \\ back\_up\_node\_req & 22 & R \(\rightarrow\) M & 6 & 132 & 6 & 228 \\ back\_up\_node\_ans (0) & 82 & M \(\rightarrow\) R & 1 & 82 & 2 & 114 \\ back\_up\_node\_ans (1) & 82 & M \(\rightarrow\) R & 5 & 410 & 10 & 570 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Transmission requirements for the procedure for registering the first node in the domain.  
Figure 23: View of the demonstrator during the transmission of sensor data to the G node.  
In the sequence of packages necessary to register one node in the domain, only the packets used to send descriptions of domain nodes (i.e., _back_up_node_req_ and _back_up_node_ans_) are used repeatedly, and the others are used only once. It is worth noting that the number of these packets is proportional to the number of already registered nodes in the domain. This is because the description of one registered node requires the whole of one _back_up_node_ans_ packet (type (0)), and in the type (1) of the _back_up_node_ans_ packet, it is possible to send up to seventeen descriptions of non-registered nodes. The dependence of the number of required XBee frames in the procedure of registering one node from the number of nodes already registered in the domain is given in Figure 24, and the dependence of the number of bytes to be transmitted in these frames is shown in Figure 25.  
The data volume to be transmitted for a domain with several dozen nodes is quite large and for N = 60, it is 10,356 bytes. The time needed to register the tenth node in the sensor domain was  
Figure 24: Number of nodes to register versus the number of required XBee frames to be transferred during the procedure for registering the \(N\)th node in a domain.  
Figure 25: The number of nodes to register versus the data volume needed to send in XBee frames during the procedure to register the \(N\)th node in a domain.  
experimentally tested. This procedure required 1168 bytes to be sent towards R \(\rightarrow\) M and 1892 bytes towards M \(\rightarrow\) R. The registration time for this node was a few seconds--the XBee interface was operating at 57,600 bps.