Keep-alive connections amortize the handshake cost across multiple messages. For a sensor sending 10-byte readings every 30 seconds over an hour:
Number of messages per hour: \[N = \frac{3600\text{ sec}}{30\text{ sec}} = 120\text{ messages}\]
TCP per-message (reconnect each time): \[\begin{align}
\text{Per message} &= 120\text{ B handshake} + 64\text{ B data} + 120\text{ B teardown} = 304\text{ B} \\
\text{Hourly total} &= 120 \times 304 = 36{,}480\text{ B}
\end{align}\]
TCP keep-alive (persistent connection): \[\begin{align}
\text{Initial} &= 120\text{ B handshake (once)} \\
\text{Per message} &= 64\text{ B data} \\
\text{Keep-alive probes} &= 0\text{ (data every 30s keeps connection alive)} \\
\text{Hourly total} &= 120 + (120 \times 64) = 7{,}800\text{ B}
\end{align}\]
Note: With data sent every 30 seconds, the connection stays active without explicit keep-alive probes (typically triggered only after 60–120 seconds of idle time).
Overhead reduction: \[\text{Savings} = \frac{36{,}480 - 7{,}800}{36{,}480} = 78.6\%\]
At 250 kbps (31,250 B/s) with 50 mA TX current: - Reconnect: \(\frac{36{,}480}{31{,}250} = 1.17\text{ sec active} \Rightarrow 1.17 \times \frac{50}{3{,}600} = 0.016\text{ mAh/hour}\) - Keep-alive: \(\frac{7{,}800}{31{,}250} = 0.25\text{ sec active} \Rightarrow 0.25 \times \frac{50}{3{,}600} = 0.0035\text{ mAh/hour}\)
These are the raw byte-transmission costs only. In practice, radio wake-up, idle listening, and RTT waiting dominate. For LTE-M (120 mA TX, 200 ms RTT): each reconnection holds the radio active for ~550 ms at 120 mA, giving 1.1 mAh/hour (reconnect) vs 0.27 mAh/hour (keep-alive), a ~79% energy reduction.