When a packet is being sent after the SYN ACK connection has been established between a host and a server, packets can now be sent between the hosts and a server. Sometimes, there’s a window size which is determinable by ACK sent after reception of a segment. 

Let’s say the window size is 100, the sender can send 100 segments before it expects to receive an ACK. But what happens is segment 50 gets missing along the line? 

I read somewhere that 1-49 & 51-100 gets sent but then the receiver ACKs for 50 and the sender resend 1 segment with segment number 50. I was also reading somewhere that, for example, let’s say sender has a window size of three, and my sender sends segment 1,2,3, receiver ACKS for 4. The next window must be 4,5,6. 

Let’s say 4 doesn’t get sent, the receiver ACKS for 4 again, and the whole segment gets sent again, which conflicts with the earlier idea. I was thinking 5-6 gets sent before an ACK for 4 gets sent, then the 4th segment gets sent after 5-6.

Which idea is right?