Exploiting D2D communications at the network edge for mission-critical IoT applications