Optimal control with unreliable communication: the TCP case