first version of stop and wait of data transfer