Setup: Study group of 4 students, each assigned a role.
[0-5 min] Context Setting (Facilitator)
- Scenario: Smart agriculture with 500 soil sensors
- Constraint: Cellular data costs $0.10/MB
- Average message: 20 bytes
- Frequency: Every 15 minutes
- Reliability requirement: 95% delivery
[5-15 min] Position Arguments (5 min each)
Team A (MQTT): Maria presents - QoS 1 ensures 95% delivery with ACKs - Persistent connection allows instant alerts - Broker-based fan-out and retained state simplify downstream integrations - Math: Using the same assumptions from the calculator above, MQTT publish traffic is about 54.9 MB/month, and a 60-second keepalive adds roughly 618.0 MB/month more. That is much more expensive on cellular, but Maria argues the extra cost may be worth it when real-time alerts and operational simplicity matter.
Team B (CoAP): Jason presents - Confirmable messages provide reliability - No persistent connection saves battery - Smaller request/response exchanges keep routine telemetry lightweight - Math: 500 sensors × 96 msg/day × 20 bytes × 30 days is about 27.5 MB/month, or $2.75/month at $0.10/MB - BUT: Sleep mode between messages saves 200mAh/day per sensor = 6 months longer battery life
[15-20 min] Cross-Examination (Facilitator moderates)
Q: “Maria, what happens when cellular drops during 15-min sleep?” A: “MQTT broker stores messages. Device resends on reconnect. Data is never lost.”
Q: “Jason, how do you handle real-time alerts with CoAP’s request-response model?” A: “CoAP Observe extension allows push notifications. Gateway polls sensors every 5 min for urgent alerts.”
[20-25 min] Role Reversal
- Maria argues FOR CoAP battery savings
- Jason argues FOR MQTT’s simplicity
- Learning: Students see both sides’ merits
[25-30 min] Facilitator Synthesis “No right answer. Trade-offs:” - MQTT: Better for real-time alerts, higher data cost - CoAP: Better for battery life, more complex implementation - Real projects often use BOTH: CoAP for sensors, MQTT for gateway-to-cloud
Student Feedback: “Switching sides forced me to see why someone would choose the other protocol. Now I understand it’s about project constraints, not ‘better’ vs ‘worse’.”
Time Breakdown Success: 5 min context + 10 min arguments + 5 min questions + 5 min role-switch + 5 min synthesis = exactly 30 min