Implemeting a reliable data transfer protocol