Desired-State PUT and Toggle POST Retries

Desired-State PUT and Toggle POST Retries

Try Tap Step from the two unlit lamps and compare the simulated lamp states with what each client received.

Predict the two lamp states after a lost reply.

CoAP

PUT /state · desired value ON

Client record

Target state: ON

Simulated lamp

OFF

POST /toggle

Client record

Target state: ON

Simulated lamp

OFF

Start from separate lamps

Start with the lamp off in each scenario. The client wants it on.

Observe Both lamps light in frame 2 even though the client records show no ACK or response. After you submit your predictions, frame 5 reveals the PUT lamp still ON and the POST lamp OFF.
Explain Frame 5 shows different outcomes because repeating the PUT assignment keeps the lamp ON, while the newly executed POST toggles the lamp from its current ON state to OFF.

Technical boundaries. Both lamps start OFF, and the scenario assumes each initial operation executes and its piggybacked ACK and response are lost. The same-CON example assumes recognition within the exchange. The restart path assumes the server executes each new request, and the final state check is simulated.

Back to the chapter