Fast and agile lossless mode switching for D2D communications in LTE-Advanced networks