A layered IoT-based architecture for a distributed structural health monitoring system