Hi,
I hate t repeat myself.
In order to have a "protocol" you need also other stuff, e.g., a packet format.
About your other questions:
"how does sender stop to wait ACK from receiver. It's like time out." - well, that's the problem of how to find out if a data packet has been lost, assuming that ACKs too can be lost.
This problem (the data segment loss calculation) alone has generated a shitload of publications, algorithms and techniques. Heck, the whole TCP congestion control system is based on HOW you detect a loss... best suggestion: grab a book. Any book.
In ns-3, it's "just" a matter of: receive an ACK, trash the acknowledged data, move the sliding window, check if you have pending data to send, send them.
Anyway, as I said (already), GBN isn't a protocol. You have to define the missing parts before implementing it.
T.