Is it useless to reply the received messages (on TCP) on application layer to tell the sender the messages have been successfully received?
Any data loss is detected and automatically corrected, which is why TCP is also called a reliable protocol.
In other words,
the transport layer is responsible for error-free, end-to-end delivery of data from the source host to the destination host.
TCP is guaranteed to be a reliable transmission indeed. A question is raised, is it redundant (or useless, sorry for my poor English) to reply the received messages (which are transported on TCP) on application layer to tell the sender that the messages have been successfully received?
Solution 1:
It is not redundant. TCP only cares about delivery between two systems, not between two applications. The ACK is sent once data are successfully received. The payload of the packets is then put into the socket buffer of the application on the receiver side. The ACK is thus send before the application has read the payload (from the socket buffer) and specifically before it processed the payload, for example made changes to a database based on the processed payload.
Thus a client can only know that the applications has successfully processed the payload, if it gets some kind of acknowledgement at the application level. This does not need to be an explicit acknowledgement though - simply sending a response back might be sufficient. Details depend on the semantics of the application protocol.