For GBN and SR...
Suppose the sender has a window size of 3 and sends packets 1, 2, 3 at 0t. At 1t the receiver ACKS 1, 2, 3. At 2t the sender times out and resends 1, 2, 3. At 3t the receiver receives the duplicates and re-acknowledges 1, 2, 3. At 4t the sender receives the ACKs that the receiver sent at 1t and advances its window to 4, 5, 6. At 5t the sender receives the ACKs 1, 2, 3 the receiver sent at 2t. These ACKs are outside its window.
For stop and wait..
Let sender at t0 send 0th packet. At t1 received by receiver and send ack1 (ack for 0th packet and expecting packet 1). Eventually sender time out and send 0th packet again at receiver side it is discarded as expecting packet is 1. Ack1 has been send again.
When first ack1 is received sender sends packet1 and expecting ack0. Suppose after t time second ack1 arrives but expected ack is ack0 so ack1 is discarded.
So it is also true for stop and wait protocol.
Correct me ...