Enabling TLS on MQTT adds a one-time handshake cost per connection. For a sensor connecting once per day with 100ms RTT:
TLS 1.2 handshake (2 RTTs): \[
T_{\text{TLS1.2}} = 2 \times \text{RTT} = 2 \times 100\text{ ms} = 200\text{ ms}
\]
TLS 1.3 handshake (1 RTT, improved): \[
T_{\text{TLS1.3}} = 1 \times \text{RTT} = 100\text{ ms}
\]
Energy cost (8 mA TX current, 6 handshake packets, 15 ms TX time per packet): \[
E_{\text{handshake}} = 6 \times (8\text{ mA} \times 15\text{ ms}) = 0.72\text{ mAs}
\]
Amortized per message (connect once, send \(N\) messages): \[
E_{\text{per\_msg}} = \frac{0.72}{N} + E_{\text{MQTT}}
\]
For \(N = 1440\) (1 msg/min, 1 day session): \[
E_{\text{per\_msg}} = \frac{0.72}{1440} + 0.4 = 0.0005 + 0.4 \approx 0.4\text{ mAs}
\]
Bandwidth overhead: TLS 1.3 handshake: ~3–5 KB (certificates exchanged) TLS 1.2 handshake: ~5–10 KB (larger due to additional round-trip messages) MQTT message: ~50 bytes (typical sensor reading)
Takeaway: Keep MQTT connections persistent for multiple messages to amortize TLS handshake cost. Reconnecting for every message adds 100–200 ms latency (1 RTT for TLS 1.3, 2 RTT for TLS 1.2) and proportional energy overhead per reconnect. For always-connected devices sending many messages per session, TLS handshake cost falls below 0.1% of total energy.