I´m trying to create a Client in java to transfer files over UDP using a Go-back-N sliding window. I'm using a TftpPacket, but that's not relevant for the question. My problem its how am I able to make the acknowledge control. Example:
Have a file that is divided into 15 segments, window with length 10. So first it will send 10 segm, but package 2 its lost so the client sends 10 segm and the the server only acknowledged the first one, so client sends segm 11 and stops. After the timeout the client send again but the window this time will be defined from segm 2 to segm 11 (10 segm window) and so on.
My problem its that I'm not able to understand how to control the window so it blocks on segm 11 if the last ack received was 1 and resend the whole window after the timeout.