## 4 SENSED-SG Design and Protocols
### Sensed-Sg MAC Layer  
Although the standard IEEE 802.15.4 MAC layer defines two different types of devices, full-function devices (FFD) -capable of routing- and reduced-function devices (RFD) -with no routing capabilities-, SENSED-SG only employs full-function devices. The use of both, FFD and RFD is based on the idea of implementing star or cluster-tree topologies (depicted in Figure 1) where reduced-function devices will always have full-function devices within their coverage to route their packets. The problem that arises with this solution is illustrated in Figure 2; when the area to cover grows in just one axis, which is quite usual in power grids and especially in the T&D segment, the number of FFDs increases sharply in relation to the RFDs. The result is a WSN basically composed of full-function devices, which (according to the IEEE 802.15.4 standard) either cannot enter into sleep mode (non-beacon-based networks) or must carry out laborious coordination tasks to enable a global synchronization of the network (beacon-enabled networks). Both strands lead to a significant reduction in network lifetime occurring, for instance, in ZigBee-based solutions. To mitigate this problem, we have designed and implemented a novel duty-cycling-based MAC layer focused on Smart Grid environments where full-function devices are capable of entering into sleep mode while still providing synchronization between peers (and, therefore, FFDs are not compelled to perform global synchronization tasks)--as explained hereafter in this section. Figure 1: Cluster-Tree and Star topologies. As above mentioned, the IEEE 802.15.4 standard proposes two different operational modes namely, beacon-enabled and non-beacon-enabled. In the latter, devices simply transmit using un-slotted CSMA-CA channel access mechanism--the medium is sensed and if detected free, the message is sent; otherwise (the medium is busy) devices delay the transmission a random period of time. In contrast, the beacon-enabled mode requires FFD coordinator (PAN -Personal Area Network- coordinator) nodes to periodically send beacons (control frames that inform other devices in their coverage range about the beginning of a period for sending their messages). This mechanism is commonly used in star topologies where there is always a coordinator device in coverage range. Nonetheless, although the standard is rather ambiguous in this aspect, beacon-enabled mode could also be implemented in cluster-tree topologies by means of tight global synchronization techniques. These techniques force every FFD to arrange its own beacon frames and unavoidably lead to an increase in code complexity and a sharp reduction in network scalability [50]--beacons must be coordinated in order not to collide with one another, which in turn, leads to a limit on the number of FFDs in a coverage area. Finally, note that beacon-enabled mode implies faster battery depletion in FFDs since every node involved in coordination tasks is required to continuously send beacon messages to let other nodes synchronize with it. Therefore, in the interest of extending nodes' battery lifetime and increasing flexibility of the network topology, the non-beacon operational mode constitutes a cornerstone of our solution. Besides, the limit imposed in beacon-enabled networks on the number of FFDs coexisting in the same coverage area is especially important in Smart Grid environments and has been another reason for choosing non-beacon approaches--some segments of the power grid (like substations) are characterized for having a big number of power assets deployed in very small areas that can be potentially monitored; this greatly increases node density and thus potential beacon collisions. In addition, non-beacon mode simplifies the use of duty-cycle techniques that highly enhance power savings. The concept of duty cycle is based on the differences in power consumption of the radio module during the _awake period (ON)_ and _sleep period (OFF)_.