How to send acknowledgement in tcp

I am having three node cluster of node-red and having a tcp listening node. So, whenever the I'll receive the first packet I have to send the acknowledgment message for the socket and also I need to store this deviceid and connection in Redis for further communication. For further request, I'll receive only telemetry data without deviceid. So, I have to fetch device id by using tcp connection. So, how can I do this using node-red. How can I send the acknowledgement part for the same socket and also store the connection in redis to get deviceid.