I know TCP is able to guarantee the delivery of messages from sender to receiver, without corruption (thanks to checksums), in order and without duplication (thanks to sequence numbers).
So I'm confused when I read something about MQTT QoS. For example, QoS 1 (at least once) uses ack (PUBACK) and retransmissions (with packet ids) to guarantee that the message is delivered at least one time.
I'm wondering how this is possible over a TCP connection that uses the same technique of ack and sequence numbers.
From what I know about TCP, if some data isn't well acknowledged by the receiver, the sender automatically resends the packets not acked. This is performed by TCP/IP stack or kernel, without the application knows anything about this.
It seems to me it's impossible that a MQTT client needs to resend a MQTT message because it wasn't received by the broker. If this happens, TCP should signal the error to the application that should close and try to reopen the connection.