Managing TCP Retransmission Timeout

During our evaluation of MQTT, we observed that if we send data every five minutes, the server stops receiving it. We currently believe this is related to CG-NAT, which drops the tunnel due to inactivity, preventing the packet from being routed. This leads to the module retransmitting the TCP packet 10 times with varying delays before determining that the TCP connection is dead. The entire process takes approximately 18 minutes.

Is there a way to control the frequency of retransmissions or the total time before considering the TCP connection dead?

Related