if a tcp client send a packet, with sequence number from 10000 to 20000, to a tcp server. the tcp will respond with an ACK with seq_ack 20001.
if I intercept the TCP packet from the client, and split the packet into 2 tcp segments, one with seq from 10000 to 15000, and the other with seq from 15001 to 20000. And then these 2 TCP segments are sent to the TCP server. Assume that the second segment is lost in the path. The TCP server will respond an ACK with seq_ack 15001.
Now since the TCP client send a integral packet with seq 10000 to 20000, but it gets an ACK with 15001, from the client's point of view, this is weird. How will it react? In theory, the client should retransmit the bytes from seq 15001 to 20000, namely, the client will transmit new packets from seq 15001. But how about the practice, in TCP stack implementation, is it the same as in the theory?
I think in the TCP send buffer, when a tcp segment is sent, the segment still stays there until the ACK. When the ACK come, these bytes for the segment are cleared from the buffer. There is a pointer in the send buffer, when an ACK come, the pointer points to the location where the ack_seq corresponds to. The bytes that are below the ack_seq are cleared. In this way, the whole segment needn't be retransmitted?