## 1 Introduction
Moreover, fog computing allows application developers to provide analytics and real-time actionable data insights directly from IoT end-devices with minimal data exchanges (on-site) and low latency, using user-specific resources [31]. Consider that even a simple water usage counter as a real-time, direct, feedback mechanism can significantly influence user behaviour in terms of water usage, leading to a modified, more sustainable, behaviour [6]. It is evident that the private nature of water consumption data is of paramount importance in smart metering applications [32; 33]. In current smart grid deployments where meters transmit all measurements to cloud-based services, privacy requirements are dealt with as an after-thought. It is evident that in doing so, personal information can be extracted from the fine-grained measurements [6; 34]. User lifestyle profiles can easily be extracted from the detailed consumption data collected, generating information about, but not limited to, house occupancy, meal times, working hours or even religious habits [35; 36]. One approach is to use a secure data aggregation scheme for smart grids that follows the fog computing paradigm to ensure the privacy of collected data [37]. Studies indicate that low-end devices participating in a fog computing architecture are capable of executing advanced cryptographic mechanisms in an energy-efficient manner [38]. Utilizing such mechanisms can help increase the privacy of the user's data while also reducing the communication and storage overhead. The hierarchical-nature of the fog computing architecture in combination with additive homomorphic encryption protects consumer privacy from third parties. Alternatively, differential privacy techniques can be applied to develop effective privacy-preserving schemes for load monitoring. Recently, new consumption behaviour models have been developed that take into consideration the fog computing elements of the architecture to add noise to the data collected at specific points, thus providing a better trade-off between the utility of the data and privacy compared with other popular methods [39]. In this work, we present the design and implementation details of a smart water grid system that follows the fog computing approach. A series of intermediate layers is strategically introduced in the computing and communication infrastructure that interconnects the secluded smart devices, the cloud services and the end-user equipment. The resulting system provides a fully functional edge-processing prototype for obtaining, analysing, storing and efficiently retrieving datasets from smart, off-the-shelf water consumption meters and water valve controllers. The benefits of using fog computing with regards to real-time analysis needs are summarized as follows:  
**Reduction of bandwidth requirements**: The packets collected from an installation of smart water metering devices in a relatively small-sized city comprised of 50,000 houses can accumulate up to 13 GB per day [40]. This constitutes a load above the capacity of currently available narrow-band wireless networking technologies [41]. Real-world evidence of deployments that adopt the fog computing paradigm indicates that the load can be reduced up to a level of 24 MB per day by using the processing capabilities already available at the edges of the network [40]. **Improved responsiveness and reliability**: A significant reduction in the wastage of resources can be achieved through fine-grained monitoring of consumption and relaying of this information back to the consumers [42]. Multiple studies suggest that real-time, direct, feedback mechanisms on the level of consumption can help to reduce consumption when compared to traditional, indirect mechanisms such as, e.g., bimonthly bills or periodic advice on resource consumption [43].