THE OPTIMAL SOLUTION OF CONSENSUS IN A FOG COMPUTING BASED IOT WITHIN UNRELIABLE COMMUNICATION