a simple CoAP message parser