# Group Authentication Scheme for Neighbourhood Area Networks (NANs) in Smart Grids
## 5 Implementation  
The authentication scheme was implemented on TelosB sensor nodes using TinyOS version 2.1 [29]. TelosB is an open source platform that includes a more with sensors and the development platform. TinyOS is a small, open-source, energy-efficient software operating system, which supports large scale, self-configuring sensor networks. Both TelosB and TinyOS were developed by UC Berkeley (Berkeley, CA, USA) [29]. Six sensor nodes were used, one each in a role as the NOC and as a GW, and four others in a mesh communicating to the NOC, via the GW. The motes were pre-loaded with the addresses of the NOC and the GW nodes, as well as the master key of the NOC. The NOC and the GW nodes were switched on, respectively, and the GW authenticated with the NOC. Subsequently, the nodes were switched on, one-by-one. Note that the implementation on the motes did not use the link layer encryption facility. The nodes were physically located such that each node was in the radio range of only two other nodes. This ensured that there were at least two two-hop paths from the nodes to the GW. Two specific measurements were made. The time taken for encryption/decryption (AES [5; 28], with block size 16, key size 128 bits) was measured. Figure 8 provides a snapshot of the packet transit across the nodes labelled L-SM (leaf node), H-SM (intermediate node), GW (group gateway), and NOC (the NOC). Each line starts with a time stamp in microseconds, indicates the source and destination node addresses (L-SM and NOC only), followed by the application data size (33 Bytes), the time to encrypt/decrypt the packet contents on the node (in microseconds), and the name of the routine providing the information. The total delay for the authentication process of a mote, using a two-hop path, was measured. The average encryption and decryption times on end nodes are 6 ms and 6.2 ms; on intermediate nodes (authenticated forwarding), including the GW node, 3.9 ms and 4.2 ms; and on the NOC, 8.2 ms and 6.5 ms. The average RTT from an end node to the NOC was 196 ms. The average RTT between a pair of nodes on the network was 25 ms. The entire authentication process Figure 8 took 331 ms. The time taken for encryption and decryption of a 16-byte block of the application packet is shown in Figures 9 and 10 respectively. This measurement was done using the microsecond timer implemented in TinyOS. The timer was fired before and after the encrypt/decrypt operations, within the application. Therefore, the measurement includes the TinyOS overheads (interrupt servicing,  
Figure 8: The output of the motes from the L-SM to NOC and back. packet reception, _etc._). The dataset contains a hundred measurements on each mote and Figures 8 and 9 indicate the mean of the dataset and the standard deviation. The path from the L-SM to the NOC is a three-hop path. Each mote in the path will need to process packets from its downstream, in addition to its own packets, which leads to an increase in the overall encryption time. This is evident from the increasing encryption and decryption times as well as the increasing value of the standard deviation of the dataset, which is plotted as an error bar. The round trip time (RTT) for an authentication packet (network transit time + processing time on each sensor node) from the L-SM to the NOC and back, was measured for the star and mesh topologies. Figures 11 and 12 indicate the RTTs without and with the security turned on (labelled as RTT-SECURE). The RTT for the mesh (Figure 12) topology is an order of magnitude higher than that for the star topology (see Figure 11). The limitation of the implementation is the inability to examine the performance of the authentication scheme when the number of nodes is scaled up. This requires physical configuration and deployment of a large number of motes. Specifically, the load on the gateway node and its impact on the authentication delay require evaluation. Figure 10: Time taken for AES decryption of a 16 byte block on motes in a mesh topology.