basic algorithm for timeout timer in tcp protocol