[core] Notes on draft-jimenez-core-coap-diag-01

Christian Amsüss <christian@amsuess.com> Wed, 18 November 2026 03:16 UTC

Received: from smtp.akis.at (smtp.akis.at [IPv6:2a02:b18:500:a515::f455]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx.ietf.org (Postfix) with ESMTPS id 01E7546; Wed, 18 Nov 2026 03:16:08 +0000 (UTC)
Authentication-Results: mx.ietf.org; dkim=none; spf=pass (mx.ietf.org: domain of christian@amsuess.com designates 2a02:b18:500:a515::f455 as permitted sender) smtp.mailfrom=christian@amsuess.com; dmarc=none
Received: from poseidon-mailhub.amsuess.com ([IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by smtp.akis.at (8.18.2/8.18.2) with ESMTPS id 6AI3G75j038829 (version=TLSv1.2 cipher=ECDHE-ECDSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Nov 2026 04:16:07 +0100 (CET) (envelope-from christian@amsuess.com)
Received: from poseidon-mailbox.amsuess.com (hermes.lan.amsuess.com [10.13.13.254]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 16C8F7AE7B; Wed, 18 Nov 2026 04:16:07 +0100 (CET)
Received: from hephaistos.amsuess.com (hephaistos.lan.amsuess.com [IPv6:2a02:b18:c13b:8010::d5b]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id C737A68285; Wed, 18 Nov 2026 04:16:06 +0100 (CET)
Received: (nullmailer pid 1529954 invoked by uid 1000); Wed, 18 Nov 2026 03:16:06 -0000
Date: Wed, 18 Nov 2026 04:16:06 +0100
From: Christian Amsüss <christian@amsuess.com>
To: core@ietf.org
Message-ID: <av0Ydj3FmAoC6PUo@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="NIJf/XOsSb+lWp+F"
Content-Disposition: inline
X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on poseidon-mailhub.amsuess.com
X-Scanned-By: MIMEDefang 2.86
X-Spamd-Bar: ----------------
Message-ID-Hash: EZETPYZLY5IOPIITJJU7VMNZNC52N63I
X-Message-ID-Hash: EZETPYZLY5IOPIITJJU7VMNZNC52N63I
X-MailFrom: forwardingalgorithm@dmarc.ietf.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-core.ietf.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: draft-jimenez-core-coap-diag@ietf.org
X-Mailman-Version: 3.3.10
Precedence: list
Subject: [core] Notes on draft-jimenez-core-coap-diag-01
List-Id: "Constrained RESTful Environments (CoRE) Working Group list" <core.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/vWb3ekSMAJknuKrGXTkK9BsCp0o>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Owner: <mailto:core-owner@ietf.org>
List-Post: <mailto:core@ietf.org>
List-Subscribe: <mailto:core-join@ietf.org>
List-Unsubscribe: <mailto:core-leave@ietf.org>

Hello Jaime, CoRE,

thanks for writing this; it's good to have something like this around.


I've done quote some pretty-printing in aiocoap, so many points in my
unsorted notes are just what I've been doing:

* 4.3: I'd suggest `Location: /foo/bar?baz=qux` for simplicity.
  (Currently it's unclear if Location-Path would have both).

* Options: How are they turned between binary and text in general? I'd
  expect something like "This is extensible by the option definition,
  but by default, uint options are shown in decimal, string in quotes,
  and opaque in hex; multiple occurrences are comma separated".

* 4.5:

  - Link-Format doesn't allow space after the comma. In aiocoap-client
    (which formats payload quite similar to 4.5), I'm adding newlines
    after the commas. This makes it way easier to read.

  - non-CBOR binary: As a reader, h'001122' would give me the impression
    of CBOR being involved. aiocoap-client shows output as hex similar
    to how `hd` formats it.

    (In general, it'd be great if we found a convention at IETF for how
    to show bytes in print without invoking 0x11223344 notation (that
    invokes numeric values and looks odd for the empty byte string), or
    looking like CBOR, or needing many words to tell that it is hex).

* If there is a full URI in the request line, I suppose that's always
  Uri-Host + Uri-Path (and never Proxy-Uri?)

  Can the variants be split out for clarity where needed (e.g. "GET" /
  "Proxy-Scheme: coap" / ...?

* What I often see in Marco's documents are flow diagrams where messages
  are shown next to it (eg. [1]). I think that this format can be used
  there quite directly.


Just to give a full example, here is what aiocoap currently outputs:

| $ aiocoap-client coap://coap.me/5 -v
| INFO:coap.aiocoap-client:Sending request:
| INFO:coap.aiocoap-client:GET to coap://coap.me
| INFO:coap.aiocoap-client:- Uri-Host (3): 'coap.me'
| INFO:coap.aiocoap-client:- Uri-Path (11): '5'
| INFO:coap.aiocoap-client:No payload
| INFO:coap.aiocoap-client:Received response:
| INFO:coap.aiocoap-client:2.05 Content from coap://[2001:638:708:30da:223:24ff:fe93:e128]
| INFO:coap.aiocoap-client:- Etag (4): b'mk* \x84\x83\x01d'
| INFO:coap.aiocoap-client:- Content-Format (12): <ContentFormat 50, media_type='application/json'>
| INFO:coap.aiocoap-client:Payload: 7b2265223a5b7b226e223a22302f3322... (28 bytes total)
| # JSON re-formated and indented
| {
|     "e": [
|         {
|             "n": "0/3",
|             "sv": "1"
|         }
|     ]
| }

(The lines with `INFO:` are only shown in verbose mode)

As this document matures, I think I'd like to update aiocoap to just
print what this document does in verbose mode instead.

BR
Christian


[1]: https://www.ietf.org/archive/id/draft-ietf-core-oscore-capable-proxies-08.html#name-with-forward-proxy-oscore-c

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom