In TCP/IP communication, we know that when a sender sends a packet containing some data, the receiver has to return an ACK packet. Does this ACK packet has to carry the same payload that the receiver got or it is just turning on ACK flag in the header and the next serial number?
it is just turning on ACK flag in the header and the next serial number
Repeating the payload would just lead to unnecessary duplicating of data that has to be carried across the network. The Acknowledgement number itself is sufficient to tell the initial sender exactly what bits of data have been received.