RAM requirements comparison: \[
\begin{align}
\text{CoAP stack (minimal)} &= 2{,}048 \text{ bytes} \\
\text{MQTT stack (minimal)} &= 10{,}240 \text{ bytes} \\
\text{HTTP stack (minimal)} &= 51{,}200 \text{ bytes} \\
\text{Ratio} &= \text{CoAP : MQTT : HTTP = 1 : 5 : 25}
\end{align}
\]
Message size for 20-byte payload: \[
\begin{align}
\text{CoAP} &= 4 + 2 + 8 + 20 = 34 \text{ bytes} \\
\text{MQTT} &= 2 + 20 + 20 = 42 \text{ bytes (header + topic + payload)} \\
\text{HTTP} &= 200 + 20 = 220 \text{ bytes (headers + payload)}
\end{align}
\]
Power consumption per transaction (cellular): \[
\begin{align}
\text{CoAP (UDP)} &: 20 \text{ ms} \times 120 \text{ mA} = 2.4 \text{ mAs} = 0.67 \text{ }\mu\text{Ah} \\
\text{MQTT (TCP)} &: 150 \text{ ms} \times 120 \text{ mA} = 18 \text{ mAs} = 5.0 \text{ }\mu\text{Ah} \\
\text{HTTP (TCP+TLS)} &: 400 \text{ ms} \times 120 \text{ mA} = 48 \text{ mAs} = 13.3 \text{ }\mu\text{Ah}
\end{align}
\]
Battery life (AA 2,500 mAh, 1 msg/min): \[
\begin{align}
\text{Messages/day} &= 1{,}440 \\
\text{CoAP daily} &= 1{,}440 \times 0.67 \text{ }\mu\text{Ah} = 0.96 \text{ mAh} \\
\text{Battery life} &= \frac{2{,}500}{0.96} \approx 2{,}604 \text{ days} \approx 7.1 \text{ years} \\
\text{MQTT daily} &= 1{,}440 \times 5.0 \text{ }\mu\text{Ah} = 7.2 \text{ mAh} \rightarrow 347 \text{ days} \\
\text{HTTP daily} &= 1{,}440 \times 13.3 \text{ }\mu\text{Ah} = 19.2 \text{ mAh} \rightarrow 130 \text{ days}
\end{align}
\]
Conclusion: CoAP’s minimal overhead enables multi-year battery life (7+ years at 1 msg/min). MQTT lasts ~1 year; HTTP only ~4 months. For battery-powered devices, CoAP is clearly optimal.