D2D Communications for Large-Scale Fog Platforms: Enabling Direct M2M Interactions