| Internet-Draft | CORECONF | July 2023 |
| Veillette, et al. | Expires 11 January 2024 | [Page] |
This document describes a network management interface for constrained devicesand networks, called CoAP Management Interface (CORECONF). The Constrained ApplicationProtocol (CoAP) is used to access datastore and data node resources specifiedin YANG, or SMIv2 converted to YANG. CORECONF uses the YANG to CBOR mapping and convertsYANG identifier strings to numeric identifiers for payload size reduction.CORECONF extends the set of YANG basedprotocols, NETCONF and RESTCONF, with the capability to manage constrained devicesand networks.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found athttps://core-wg.github.io/comi/draft-ietf-core-comi.html. Status information for this document may be found athttps://datatracker.ietf.org/doc/draft-ietf-core-comi/.¶
Discussion of this document takes place on the core Working Group mailing list (mailto:core@ietf.org), which is archived athttps://mailarchive.ietf.org/arch/browse/core/. Subscribe athttps://www.ietf.org/mailman/listinfo/core/.¶
Source for this draft and an issue tracker can be found athttps://github.com/core-wg/comi.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is athttps://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 11 January 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The Constrained Application Protocol (CoAP)[RFC7252] is designed forMachine to Machine (M2M) applications such as smart energy, smart city, and building control.Constrained devices need to be managed in an automatic fashion to handlethe large quantities of devices that are expected infuture installations. Messages between devices need to be as small andinfrequent as possible. The implementationcomplexity and runtime resources need to be as small as possible.¶
This draft describes the CoAP Management Interface (CORECONF) which uses CoAP methodsto access structured data defined in YANG[RFC7950]. This draft iscomplementary to[RFC8040] which describes a REST-like interfacecalled RESTCONF, which uses HTTP methods to access structured datadefined in YANG.¶
The use of standardized data models specified in a standardized language, suchas YANG, promotes interoperability between devices and applications fromdifferent manufacturers.¶
CORECONF and RESTCONF are intended to work in a stateless client-server fashion.They use a single round-trip to complete a single editing transaction, whereNETCONF needs multiple round trips.¶
To promote small messages, CORECONF uses a YANG to CBOR mapping[RFC9254] and numeric identifiers[I-D.ietf-core-sid]to minimize CBOR payloads and URI length.¶
The following terms are defined in the YANG data modeling language[RFC7950]: action, anydata, anyxml, client, container, data model, data node, identity, instance identifier, leaf, leaf-list, list, module, RPC, schema node, server, submodule.¶
The following terms are defined in[RFC6241]: configuration data, datastore, state data.¶
The following term is defined in[I-D.ietf-core-sid]: YANG schema item identifier (YANG SID, often shortened to simply SID).¶
The following terms are defined in the CoAP protocol[RFC7252]: Confirmable Message, Content-Format, Endpoint.¶
The following terms are defined in this document:¶
a CoAP resource that models a YANG data node.¶
a CoAP resource that models a YANG datastore.¶
a CoAP resource used by clients to observe YANG notifications.¶
An instance of a schema node of type notification, specified in a YANG moduleimplemented by the server. The instance is generated in the server at the occurrenceof the corresponding event and reported by an event stream resource.¶
Handle used to identify a YANG data node that is an instance of a YANG "list",specified with the values of the key leaves of the list.¶
Handle used to identify a specific data node which can be instantiated onlyonce. This includes data nodes defined at the root of a YANG module anddata nodes defined within a container. This excludes data nodes definedwithin a list or any children of these data nodes.¶
List instance identifier or single instance identifier.¶
The value assigned to a data node instance. Instance-values are serialized intothe payload according to the rules defined inSection 4 of [RFC9254].In a yang-instances data item, the reference SID applying to theinstance-value is provided by the SID in the corresponding instance-identifier.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED","MAY", and "OPTIONAL" in this document are to be interpreted asdescribed in BCP 14[RFC2119][RFC8174] when, and only when, theyappear in all capitals, as shown here.¶
CBOR is used to encode CORECONF request and response payloads. The CBOR syntaxof the YANG payloads is specified in[RFC9254], based on[RFC8949]and[RFC8742].The payload examples arenotated in Diagnostic notation (defined inSection 8 of [RFC8949] andAppendix G of [RFC8610]), whichcan be automatically converted to CBOR.¶
This section describes the CORECONF architecture to use CoAP for reading andmodifying the content of datastore(s) used for the management of the instrumentednode.¶
Figure 1 is a high-level representation of the main elements of the CORECONF managementarchitecture. The different numbered components ofFigure 1 are discussed according to the component number.¶
contains a set of named and versioned modules.¶
Optional part that consists of a named module which, specifies a set of variables and "conceptual tables". Thereis an algorithm to translate SMIv2 specifications to YANG specifications.¶
The CORECONF client sends request messages to and receives response messagesfrom the CORECONF server.¶
Processes performed by the CORECONF clients and servers.¶
A resource used to access configuration data, state data, RPCs, and actions. A CORECONF server may support a single unified datastore or multiple datastores as those defined by Network Management Datastore Architecture (NMDA)[RFC8342].¶
A resource used to get real-time notifications. A CORECONF server may support multiple Event streams serving different purposes such as normal monitoring, diagnostic, syslog, security monitoring.¶
The serverMUST prevent unauthorized users from reading or writing any CORECONFresources. CORECONF relies on security protocols such as DTLS[RFC6347][RFC9147] or OSCORE[RFC8613] to secure CoAP communications.¶
CORECONF is a RESTful protocol for small devices where saving bytes totransport a message is very important. Contrary to RESTCONF, many designdecisions are motivated by thesaving of bytes. Consequently, CORECONF is not a RESTCONF over CoAP protocol,but differs more significantly from RESTCONF.¶
In the YANG specification, items are identified with a name string. In orderto significantly reduce the size of identifiers used in CORECONF, numeric identifiers called YANG Schema Item iDentifier (YANG SID or simply SID) are used instead.¶
Instance-identifiers are used to uniquely identify data node instances within a datastore. This YANG built-in type is defined inSection 9.13 of [RFC7950]. An instance-identifier is composed of the data node identifier (i.e., a SID) and, for data nodes within list(s), the keys used to index within these list(s).¶
In CORECONF, instance-identifiers are carried in the payload of FETCHand PATCH requests.They are encoded in CBORbased on the rules defined inSection 6.13.1 of [RFC9254].¶
CORECONF uses Media-Types based on the YANG to CBOR mapping specifiedin[RFC9254].¶
The following new Media-Types based on CBOR sequences[RFC8742] are defined in this document:¶
This Media-Type represents a CBOR YANG document containing a list of instance-identifiers used to target specific data node instances within a datastore.¶
FORMAT: CBOR sequence of instance-identifiers¶
The message payload of Media-Type 'application/yang-identifiers+cbor-seq' is encoded using a CBOR sequence.Each item of this CBOR sequence contains an instance-identifier encoded as defined inSection 6.13.1 of [RFC9254].¶
This Media-Type represents a CBOR YANG document containing a list of data node instances.Each data node instance is identified by its associated instance-identifier.¶
FORMAT: CBOR sequence of CBOR maps of instance-identifier, instance-value¶
The message payload of Media-Type 'application/yang-instances+cbor-seq' is encoded using a CBOR sequence.Each item within this CBOR sequence contains a CBOR map carrying an instance-identifier and associated instance-value.Instance-identifiers are encoded using the rules defined inSection 6.13.1 of [RFC9254], instance-values are encoded using the rulesdefined inSection 4 of [RFC9254].The reference SID applying to the instance-value is provided by theSID in the instance-identifier.¶
When present in an iPATCH request payload, this Media-Type carry a list of data node instances to be replaced, created, or deleted.For each data node instance D, for which the instance-identifier is the same as a data node instance I, in the targeted datastore resource: the value of D replaces the value of I. When the value of D is null, the data node instance I is removed. When the targeted datastore resource does not contain a data node instance with the same instance-identifier as D, a new instance is created with the same instance-identifier and value as D (unless the value of D is null).¶
The different Media-Type usages are summarized in the table below:¶
| Method | Resource | Media-Type |
|---|---|---|
| FETCH request | datastore | application/yang-identifiers+cbor-seq |
| FETCH response | datastore | application/yang-instances+cbor-seq |
| iPATCH request | datastore | application/yang-instances+cbor-seq |
| GET response | event stream | application/yang-instances+cbor-seq |
| POST request | rpc, action | application/yang-instances+cbor-seq |
| POST response | rpc, action | application/yang-instances+cbor-seq |
CORECONF supports a simple datastore model consisting of a single unified datastore. This datastore provides access to both configuration and operational data. Configuration updates performed on this datastore are reflected immediately or with a minimal delay as operational data.¶
Alternatively, CORECONF serversMAY implement a more complex datastore model such as the Network Management Datastore Architecture (NMDA) as defined by[RFC8342]. Each datastore supported is implemented as a datastore resource.¶
Characteristics of the unified datastore are summarized in the table below:¶
| Name | Value |
|---|---|
| Name | unified |
| YANG modules | all modules |
| YANG nodes | all data nodes ("config true" and "config false") |
| Access | read-write |
| How applied | changes applied in place immediately or with a minimal delay |
| Protocols | CORECONF |
| Defined in | "ietf-coreconf" |
This document specifies a Management Interface. CoAP endpoints thatimplement the CORECONF management protocol, supportat least one discoverable management resource of resource type (rt): core.c.ds.The path of the discoverable management resource is left to implementers toselect (seeSection 5).¶
YANG data node instances are accessible by performing FETCH and iPATCHoperations on the datastore resource.¶
CORECONF also supports event stream resources used to observe notification instances.Event stream resources can be discovered using resource type (rt): core.c.ev.¶
The description of the CORECONF management interface is shown in the table below:¶
| CoAP resource | Example path | rt |
|---|---|---|
| Datastore resource | /c | core.c.ds |
| Default event stream resource | /s | core.c.ev |
The path values in the table are example ones. On discovery, the server makesthe actual path values known for these resources.¶
The methods used by CORECONF are:¶
| Operation | Description |
|---|---|
| FETCH | Retrieve specific data nodes within a datastore resource |
| iPATCH | Idempotently create, replace, and delete data node(s) within a datastore resource |
| POST | Invoke an RPC or action |
| GET | Retrieve the datastore resource or event stream resource |
| PUT | Create or replace a datastore resource |
| DELETE | Delete a datastore resource |
One or more data nodes can be retrieved by the client.The operation is mapped to the FETCH method defined inSection 2 of [RFC8132].¶
There are two additional query parameters for the FETCH method:¶
| query parameters | Description |
|---|---|
| c | Control selection of configuration and non-configuration data nodes (GET and FETCH) |
| d | Control retrieval of default values. |
The 'c' (content) option controls how descendant nodes of therequested data nodes will be processed in the reply.¶
The allowed values are:¶
| Value | Description |
|---|---|
| c | Return only configuration descendant data nodes |
| n | Return only non-configuration descendant data nodes |
| a | Return all descendant data nodes |
This option is only allowed for GET and FETCH methods on datastore anddata node resources. A 4.02 (Bad Option) error is returned if used for othermethods or resource types.¶
If this query parameter is not present, the default value is "a" (the quotesare added for readability, but they are not part of the payload).¶
The 'd' (with-defaults) option controls how the default values of thedescendant nodes of the requested data nodes will be processed.¶
The allowed values are:¶
| Value | Description |
|---|---|
| a | All data nodes are reported. Defined as 'report-all' inSection 3.1 of [RFC6243]. |
| t | Data nodes set to the YANG default are not reported. Defined as 'trim' inSection 3.2 of [RFC6243]. |
If the target of a GET or FETCH method is a data node that represents a leafthat has a default value, and the leaf has not been given a value by anyclient yet, the serverMUST return the default value of the leaf.¶
If the target of a GET method is a data node that represents acontainer or list that has child resources with default values,and these have not been given a value yet,¶
The serverMUST NOT return the child resource ifd=t.¶
The serverMUST return the child resource ifd=a.¶
If this query parameter is not present, the default value is "t" (the quotes areadded for readability, but they are not part of the payload).¶
The FETCH method is used to retrieve one or more instance-values.The FETCH request payload contains the list of instance-identifiers of the data node instances requested.¶
The return response payload contains a list of data node instance-values in the same order as requested.A CBOR null is returned for each data node requested by the client, not supported by the server or not currently instantiated.¶
For compactness, indexes of the list instance identifiers returned by the FETCH responseSHOULD be elided, only the SID is provided.This approach may also help reduce implementation complexity since the format of each entry within the CBOR sequence of the FETCH response is identical to the format of the corresponding GET response.¶
FORMAT: FETCH <datastore resource> (Content-Format: application/yang-identifiers+cbor-seq) CBOR sequence of instance-identifiers 2.05 Content (Content-Format: application/yang-instances+cbor-seq) CBOR sequence of CBOR maps of SID, instance-value¶
This example uses the current-datetime leaf from module ietf-system[RFC7317]and the interface list from module ietf-interfaces[RFC8343].In this example the value of current-datetime (SID 1723) and the interfacelist (SID 1533) instance identified with name="eth0" are queried.¶
REQ: FETCH </c> (Content-Format: application/yang-identifiers+cbor-seq)1723, / current-datetime (SID 1723) /[1533, "eth0"] / interface (SID 1533) with name = "eth0" /RES: 2.05 Content (Content-Format: application/yang-instances+cbor-seq){ 1723 : "2014-10-26T12:16:31Z" / current-datetime (SID 1723) /},{ 1533 : { 4 : "eth0", / name (SID 1537) / 1 : "Ethernet adaptor", / description (SID 1534) / 5 : 1880, / type (SID 1538), identity / / ethernetCsmacd (SID 1880) / 2 : true, / enabled (SID 1535) / 11 : 3 / oper-status (SID 1544), value is testing / }}¶CORECONF allows datastore contents to be created, modified and deleted usingCoAP methods.¶
A CORECONF serverMUST preserve the relative order of all user-ordered listand leaf-list entries that are received in a single edit request.As per[RFC9254], these YANG data node types are encoded as CBORarrays, so messages will preserve their order.¶
The CoAP POST operation is used in CORECONF for theinvocation of "ACTION" and "RPC" resources.Refer toSection 3.5 for details on "ACTION" and "RPC" resources.¶
One or multiple data node instances are replaced with the idempotentCoAP iPATCH method[RFC8132].¶
There are no query parameters for the iPATCH method.¶
The processing of the iPATCH command is specified by Media-Type 'application/yang-instances+cbor-seq'.In summary, if the CBOR patch payload contains a data node instance that is not presentin the target, this instance is added. If the target contains the specified instance,the content of this instance is replaced with the value of the payload.A null value indicates the removal of an existing data node instance.¶
FORMAT: iPATCH <datastore resource> (Content-Format: application/yang-instances+cbor-seq) CBOR sequence of CBOR maps of instance-identifier, instance-value 2.04 Changed¶
In this example, a CORECONF client requests the following operations:¶
REQ: iPATCH </c> (Content-Format: application/yang-instances+cbor-seq){ 1755 : true / enabled (SID 1755) /},{ [1756, "tac.nrc.ca"] : null / server (SID 1756) /},{ 1756 : { / server (SID 1756) / 3 : "tic.nrc.ca", / name (SID 1759) / 4 : true, / prefer (SID 1760) / 5 : { / udp (SID 1761) / 1 : "132.246.11.231" / address (SID 1762) / } }}RES: 2.04 Changed¶A data node resource is deleted using an iPATCH with a null value, as seen in this example.¶
The methods GET, PUT, POST, and DELETE can be used to request, replace, create,and delete a whole datastore respectively.¶
FORMAT: GET <datastore resource> 2.05 Content (Content-Format: application/yang-data+cbor; id=sid) CBOR map of SID, instance-value¶
FORMAT: PUT <datastore resource> (Content-Format: application/yang-data+cbor; id=sid) CBOR map of SID, instance-value 2.04 Changed¶
FORMAT: POST <datastore resource> (Content-Format: application/yang-data+cbor; id=sid) CBOR map of SID, instance-value 2.01 Created¶
FORMAT: DELETE <datastore resource> 2.02 Deleted¶
The content of the CBOR map represents the complete datastore of the serverat the GET indication of after a successful processing of a PUT or POST request.¶
The example uses the interface list from module ietf-interfaces[RFC8343] andthe clock container from module ietf-system[RFC7317].We assume that the datastore contains two modules ietf-system (SID 1700) andietf-interfaces (SID 1500); they contain the 'interface' list (SID 1533) withone instance and the 'clock' container (SID 1721). After invocation of GET, aCBOR map with data nodes from these two modules is returned:¶
REQ: GET </c>RES: 2.05 Content (Content-Format: application/yang-data+cbor; id=sid){ 1721 : { / Clock (SID 1721) / 2: "2016-10-26T12:16:31Z", / current-datetime (SID 1723) / 1: "2014-10-05T09:00:00Z" / boot-datetime (SID 1722) / }, 1533 : [ { / interface (SID 1533) / 4 : "eth0", / name (SID 1537) / 1 : "Ethernet adaptor", / description (SID 1534) / 5 : 1880, / type (SID 1538), identity: / / ethernetCsmacd (SID 1880) / 2 : true, / enabled (SID 1535) / 11 : 3 / oper-status (SID 1544), value is testing / } ]}¶Event notification is an essential function for the management of servers.CORECONF allows notifications specified in YANG[RFC5277] to be reported to a listof clients. The path for the default event stream can be discovered asdescribed inSection 3. The serverMAY support additional eventstream resources to address different notification needs.¶
Reception of notification instances is enabled with the CoAP Observe[RFC7641] function. Clients subscribe to the notifications by sending aGET request with an "Observe" option to the stream resource.¶
Each response payload carries one or multiple notifications. The number ofnotifications reported, and the conditions used to remove notificationsfrom the reported list are left to implementers.When multiple notifications are reported, theyMUST be ordered starting fromthe newest notification at index zero. Note that this could lead tonotifications being sent multiple times, which increases the probability forthe client to receive them, but it might potentially lead to messages thatexceed the MTU of a single CoAP packet. If such cases could arise, implementersshould make sure appropriate fragmentation is available - for example the onedescribed inSection 4.¶
The format of notifications is a CBOR sequence, where each item inthe sequence is a single notification as described inSection 4.2.1 of [RFC9254].(Accordingly, a notification without any content is an empty CBORsequence, i.e., zero bytes.)¶
FORMAT: GET <stream-resource> Observe(0) 2.05 Content (Content-Format: application/yang-instances+cbor-seq) CBOR sequence of CBOR maps of instance-identifier, instance-value¶
The sequence of data node instances may contain identical items which havebeen generated at different times.¶
An example implementation is:¶
Every time an event is generated, the generated notification instance isappended to the chosen stream(s). After an aggregation period, which may belimited by the maximum number of notifications supported,the content of the instance is sent to all clients observing the modified stream.¶
Let suppose the server generates the example-port-fault event as defined below.¶
module example-port { yang-version 1.1; namespace "https://example.com/ns/example-port"; prefix "port"; notification example-port-fault { // SID 60010 description "Event generated if a hardware fault is detected"; leaf port-name { // SID 60011 type string; } leaf port-fault { // SID 60012 type string; } }}¶In this example the default event stream resource path /s is an examplelocation discovered with a request similar toFigure 3. By executing aGET with Observe 0 on the default event stream resource the client receives thefollowing response:¶
REQ: GET </s> Observe(0)RES: 2.05 Content (Content-Format: application/yang-instances+cbor-seq) Observe(12){ 60010 : { / example-port-fault (SID 60010) / 1 : "0/4/21", / port-name (SID 60011) / 2 : "Open pin 2" / port-fault (SID 60012) / }},{ 60010 : { / example-port-fault (SID 60010) / 1 : "1/4/21", / port-name (SID 60011) / 2 : "Open pin 5" / port-fault (SID 60012) / }}¶In the example, the request returns a success response with the contentsof the last two generated events. Consecutively the server will regularlynotify the client when a new event is generated.¶
The 'f' (filter) option is used to indicate which subset of all possible notifications is of interest. If not present, all notifications supported by the event stream are reported.¶
When not supported by a CORECONF server, this option shall be ignored, all events notifications are reported independently of the presence and content of the 'f' (filter) option.¶
When present, this option contains a comma-separated list of notification SIDs. For example, the following request returns notifications 60010 and 60020.¶
REQ: GET </s?f=60010,60020> Observe(0)¶
This is one place where SIDs are used in the URI. Do we want to replace this with FETCH as well?¶
The YANG "action" and "RPC" statements specify the execution of a RemoteProcedure Call (RPC) in the server. It is invoked using a POST method toan "Action" or "RPC" resource instance.¶
The request payload contains the values assigned to the input container when specified.The response payload contains the values of the output container when specified.Both the input and output containers are encoded in CBOR using the rules defined inSection 4.2.1 of [RFC9254].¶
The returned success response code is 2.05 Content.¶
FORMAT: POST <datastore resource> (Content-Format: application/yang-instances+cbor-seq) CBOR sequence of CBOR maps of instance-identifier, instance-value 2.04 (Content-Format: application/yang-instances+cbor-seq) CBOR sequence of CBOR maps of instance-identifier, instance-value¶
This example is based onSection 3.6.1 of [RFC8040], abbreviated andannotated with SIDs as follows:¶
module example-ops { yang-version 1.1; namespace "https://example.com/ns/example-ops"; prefix "ops"; rpc reboot { // SID 61000 description "Reboot operation."; input { // SID 61009 leaf delay { // SID 61001 type uint32; units "seconds"; default 0; description "Number of seconds to wait before initiating the reboot operation."; } } }}¶This example invokes the 'reboot' RPC (SID 61000),of the server instance with name equal to "myserver".¶
REQ: POST </c> (Content-Format: application/yang-instances+cbor-seq){ 61000: { 1 : 77 }}RES: 2.04 Changed (Content-Format: application/yang-instances+cbor-seq){ 61000: null}¶Is this the correct empty return for an RPC without output?Note that we always have to send a yang-instances (or at least ayang-identifiers) for the input side to find the right RPC.¶
The example is based on the YANG action "reset" as defined inSection 7.15.3 of [RFC7950]and annotated below with SIDs.¶
module example-server-farm { yang-version 1.1; namespace "urn:example:server-farm"; prefix "sfarm"; import ietf-yang-types { prefix "yang"; } list server { // SID 60000 key name; leaf name { // SID 60001 type string; } action reset { // SID 60002 input { // SID 60008 leaf reset-at { // SID 60003 type yang:date-and-time; mandatory true; } } output { // SID 60009 leaf reset-finished-at { // SID 60004 type yang:date-and-time; mandatory true; } } } }}¶This example invokes the 'reset' action (SID 60002),of the server instance with name equal to "myserver".¶
REQ: POST </c> (Content-Format: application/yang-instances+cbor-seq){ [60002, "myserver"]: { 0 : { / SID 60002 XXX does this need to be input? / 1 : "2016-02-08T14:10:08Z09:00" / reset-at (SID 60003) / } }}RES: 2.04 Changed (Content-Format: application/yang-instances+cbor-seq){ [60002, "myserver"]: { 0 : { / SID 60002 XXX does this need to be output? / 2 : "2016-02-08T14:10:08Z" / reset-finished-at (SID 60004)/ } }}¶The CoAP protocol provides reliability by acknowledging the UDP datagrams.However, when large pieces of data need to be transported, datagrams getfragmented, thus creating constraints on the resources in the client, serverand intermediate routers. The block option[RFC7959] allows the transportof the total payload in individual blocks of which thesize can be adapted to the underlying transport sizes such as: (UDP datagramsize ~64KiB, IPv6 MTU of 1280, IEEE 802.15.4 payload of 60-80 bytes). Eachblock is individually acknowledged to guarantee reliability.¶
Notice that the Block mechanism splits the data at fixed positions,such that individual data fields may become fragmented. Therefore, assemblyof multiple blocks may be required to process complete data fields.¶
Beware of race conditions. In case blocks are filled one at a time, care shouldbe taken that the whole and consistent data representation is sent in multiple blocks sequentiallywithout interruption. On the server, values might change, lists might get re-ordered,extended or reduced. When these actions happen during the serialization ofthe contents of the resource, the transported results do not correspond witha state having occurred in the server; or worse the returned values are inconsistent.For example: array length does not correspond with the actual number of items.It may be advisable to use Indefinite-length CBOR arrays and maps,which are foreseen for data streaming purposes.(Note that the outer structure of yang-identifiers and yang-instancesis a CBOR sequence, which already behaves similar to anindefinite-length encoded array.)¶
Two application discovery mechanisms are supported by CORECONF, the YANG librarydata model as defined by[I-D.ietf-core-yang-library] andthe CORE resource discovery[RFC6690].Implementers may choose to implement one or the other or both.¶
The YANG library data model[I-D.ietf-core-yang-library] provides a high-level description of the resources available. The YANG library contains thelist of modules, features, and deviations supported by the CORECONF server.From this information, CORECONF clients can infer the list of data nodes supportedand the interaction model to be used to access them. This module also containsthe list of datastores implemented.¶
As described in[RFC6690], the location of the YANG library can be found bysending a GET request to"/.well-known/core" including a resource type (RT) parameter with the value"core.c.yl". Upon success, the return payload will contain the root resourceof the YANG library module.¶
The following example assumes that the SID of the YANG library is 2351 (kv afterencoding as specified inSection 2.2) and that the server uses /c asdatastore resource path.¶
REQ: GET </.well-known/core?rt=core.c.yl>RES: 2.05 Content (Content-Format: application/link-format)</c/kv>;rt="core.c.yl"¶
As some CoAP interfaces and services might not support the YANG libraryinterface and still be interested to discover resources that are available,implementationsMAY choose to support discovery of all availableresources using "/.well-known/core" as defined by[RFC6690].¶
The presence and location of (path to) each datastore implemented by the CORECONF servercan be discovered by sending a GET request to "/.well-known/core" including aresource type (RT) parameter with the value "core.c.ds".¶
Upon success, the return payload contains the list of datastore resources.¶
Each datastore returned is further qualified using the "ds" Link-Format attribute.This attribute is set to the SID assigned to the datastore identity.When a unified datastore is implemented, the ds attribute is set to 1029 asspecified inAppendix B.For other examples of datastores, see the Network Management Datastore Architecture (NMDA)[RFC7950].¶
link-extension = ( "ds" "=" sid ) ; SID assigned to the datastore identitysid = 1*DIGIT¶
The following example assumes that the server uses /c as datastore resourcepath.¶
REQ: GET </.well-known/core?rt=core.c.ds>RES: 2.05 Content (Content-Format: application/link-format)</c>; rt="core.c.ds";ds=1029
If implemented, the presence and location of (path to) each data nodeimplemented by the CORECONF server are discovered by sending a GET request to"/.well-known/core" including a resource type (RT) parameter with the value"core.c.dn".¶
Upon success, the return payload contains the SID assigned to each data nodeand their location.¶
The example below shows the discovery of the presence and location ofdata nodes. Data nodes '/ietf-system:system-state/clock/boot-datetime' (SID 1722)and '/ietf-system:system-state/clock/current-datetime' (SID 1723) are returned.The example assumes that the server uses /c as datastore resource path.¶
REQ: GET </.well-known/core?rt=core.c.dn>RES: 2.05 Content (Content-Format: application/link-format)</c/a6>;rt="core.c.dn",</c/a7>;rt="core.c.dn"¶
Without additional filtering, the list of data nodes may become prohibitivelylong. If this is the case implementationsSHOULD support a way to obtain alllinks using multiple GET requests (for example through some form ofpagination).¶
The presence and location of (path to) each event stream implemented by the CORECONF server arediscovered by sending a GET request to "/.well-known/core" including a resource type (RT)parameter with the value "core.c.es".¶
Upon success, the return payload contains the list of event stream resources.¶
The following example assumes that the server uses /s as the default event streamresource.¶
REQ: GET </.well-known/core?rt=core.c.es>RES: 2.05 Content (Content-Format: application/link-format)</s>;rt="core.c.es"
In case a request is received which cannot be processed properly, the CORECONF serverMUST return an error response. This error responseMUST contain a CoAP 4.xx or 5.xx response code.¶
Errors returned by a CORECONF server can be broken into two categories, those associated with the CoAP protocol itself and those generated during the validation of the YANG data model constraints as described inSection 8 of [RFC7950].¶
The following list of common CoAP errors should be implemented by CORECONF servers. This list is not exhaustive, other errors defined by CoAP and associated RFCs may be applicable.¶
The CORECONF serverMUST also enforce the different constraints associated with the YANG data models implemented. These constraints are described inSection 8 of [RFC7950]. These errors are reported using the CoAP error code 4.00 (Bad Request) and may have the following error container as payload. The YANG definition and associated .sid file are available inAppendix A andAppendix B. The error container is encoded using the encoding rules of a YANG data template as defined inSection 5 of [RFC9254].¶
+--rw error! +--rw error-tag identityref +--rw error-app-tag? identityref +--rw error-data-node? instance-identifier +--rw error-message? string¶
The following 'error-tag' and 'error-app-tag' are defined by the ietf-coreconf YANG module, these tags are implemented as YANG identity and can be extended as needed.¶
error-tag 'operation-failed' is returned by the CORECONF server when the operation request cannot be processed successfully.¶
error-tag 'invalid-value' is returned by the CORECONF server when the CORECONF client tries to update or create a leaf with a value encoded using an invalid CBOR datatype or if the 'range', 'length', 'pattern' or 'require-instance' constrain is not fulfilled.¶
error-tag 'missing-element' is returned by the CORECONF server when the operation requested by a CORECONF client fails to comply with the 'mandatory' constraint defined. The 'mandatory' constraint is enforced for leafs and choices, unless the node or any of its ancestors have a 'when' condition or 'if-feature' expression that evaluates to 'false'.¶
error-tag 'data-missing' is returned by the CORECONF server when a data node required to accept the request is not present.¶
For example, the CORECONF server might return the following error.¶
RES: 4.00 Bad Request (Content-Format: application/yang-data+cbor; id=sid){ 1024 : { 4 : 1011, / error-tag (SID 1028) / / = invalid-value (SID 1011) / 1 : 1018, / error-app-tag (SID 1025) / / = not-in-range (SID 1018) / 2 : 1740, / error-data-node (SID 1026) / / = timezone-utc-offset (SID 1740) / 3 : "maximum value exceeded" / error-message (SID 1027) / }}¶I don't quite know how to use application/yang-instances+cbor-seq here, if we don't have an instance?¶
For secure network management, it is important to restrict access to configuration variablesonly to authorized parties. CORECONF re-uses the security mechanisms already available to CoAP,this includes DTLS[RFC6347][RFC9147] and OSCORE[RFC8613] for protected access toresources, as well as suitable authentication and authorization mechanisms, forexample those defined in ACE OAuth[RFC9200].¶
All the security considerations of[RFC7252],[RFC7959],[RFC8132] and[RFC7641] apply to this document as well. The use of NoSec (Section 9 of [RFC7252]), when OSCOREis not used, isNOT RECOMMENDED.¶
In addition, mechanisms for authentication and authorization may need to beselected if not provided with the CoAP security mode.¶
As[RFC9254] and[RFC4648] are used for payload and SIDencoding, the security considerations of those documents also need to bewell-understood.¶
This document adds the following resource type to the "Resource Type (rt=) Link Target Attribute Values", within the "Constrained RESTful Environments (CoRE) Parameters" registry.¶
| Value | Description | Reference |
|---|---|---|
| core.c.ds | YANG datastore | RFC XXXX |
| core.c.dn | YANG data node | RFC XXXX |
| core.c.yl | YANG module library | RFC XXXX |
| core.c.es | YANG event stream | RFC XXXX |
// RFC Ed.: replace RFC XXXX with this RFC number and remove this note.¶
This document adds the following Content-Format to the "CoAP Content-Formats", within the "Constrained RESTful Environments (CoRE) Parameters" registry.¶
| Media Type | Content Coding | ID | Reference |
|---|---|---|---|
| application/yang-identifiers+cbor-seq | TBD2 | RFC XXXX | |
| application/yang-instances+cbor-seq | TBD3 | RFC XXXX |
// RFC Ed.: replace TBD1, TBD2 and TBD3 with assigned IDs and remove this note.// RFC Ed.: replace RFC XXXX with this RFC number and remove this note.¶
This document adds the following media types to the "Media Types" registry.¶
| Name | Template | Reference |
|---|---|---|
| yang-identifiers+cbor-seq | application/yang-identifiers+cbor-seq | RFC XXXX |
| yang-instances+cbor-seq | application/yang-instances+cbor-seq | RFC XXXX |
Each of these media types share the following information:¶
* Deprecated alias names for this type: N/A* Magic number(s): N/A* File extension(s): N/A* Macintosh file type code(s): N/A¶
// RFC Ed.: replace RFC XXXX with this RFC number and remove this note.¶
This document registers the following XML namespace URN in the "IETF XMLRegistry", following the format defined in[RFC3688]:¶
URI: please assign urn:ietf:params:xml:ns:yang:ietf-coreconf¶
Registrant Contact: The IESG.¶
XML: N/A, the requested URI is an XML namespace.¶
Reference: RFC XXXX¶
// RFC Ed.: please replace XXXX with RFC number and remove this note¶
<CODE BEGINS> file "ietf-coreconf@2023-07-10.yang"module ietf-coreconf { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-coreconf"; prefix coreconf; import ietf-datastores { prefix ds; } import ietf-restconf { prefix rc; description "This import statement is required to access the yang-data extension defined in RFC 8040."; reference "RFC 8040: RESTCONF Protocol"; } organization "IETF Core Working Group"; contact "Michel Veillette <mailto:michel.veillette@trilliantinc.com> Alexander Pelov <mailto:alexander@ackl.io> Peter van der Stok <mailto:consultancy@vanderstok.org> Andy Bierman <mailto:andy@yumaworks.com>"; description "This module contains the different definitions required by the CORECONF protocol. Copyright (c) 2019 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2023-07-10 { description "Initial revision."; reference "[I-D.ietf-core-comi] CoAP Management Interface"; } identity unified { base ds:datastore; description "Identifier of the unified configuration and operational state datastore."; } identity error-tag { description "Base identity for error-tag."; } identity operation-failed { base error-tag; description "Returned by the CORECONF server when the operation request can't be processed successfully."; } identity invalid-value { base error-tag; description "Returned by the CORECONF server when the CORECONF client tries to update or create a leaf with a value encoded using an invalid CBOR datatype or if the 'range', 'length', 'pattern' or 'require-instance' constrain is not fulfilled."; } identity missing-element { base error-tag; description "Returned by the CORECONF server when the operation requested by a CORECONF client fails to comply with the 'mandatory' constraint defined. The 'mandatory' constraint is enforced for leafs and choices, unless the node or any of its ancestors have a 'when' condition or 'if-feature' expression that evaluates to 'false'."; } identity unknown-element { base error-tag; description "Returned by the CORECONF server when the CORECONF client tries to access a data node of a YANG module not supported, of a data node associated with an 'if-feature' expression evaluated to 'false' or to a 'when' condition evaluated to 'false'."; } identity bad-element { base error-tag; description "Returned by the CORECONF server when the CORECONF client tries to create data nodes for more than one case in a choice."; } identity data-missing { base error-tag; description "Returned by the CORECONF server when a data node required to accept the request is not present."; } identity error { base error-tag; description "Returned by the CORECONF server when an unspecified error has occurred."; } identity error-app-tag { description "Base identity for error-app-tag."; } identity malformed-message { base error-app-tag; description "Returned by the CORECONF server when the payload received from the CORECONF client don't contain a well-formed CBOR content as defined in [RFC8949] or don't comply with the CBOR structure defined within this document."; } identity data-not-unique { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'unique' constraint of a list or leaf-list fails."; } identity too-many-elements { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'max-elements' constraint of a list or leaf-list fails."; } identity too-few-elements { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'min-elements' constraint of a list or leaf-list fails."; } identity must-violation { base error-app-tag; description "Returned by the CORECONF server when the restrictions imposed by a 'must' statement are violated."; } identity duplicate { base error-app-tag; description "Returned by the CORECONF server when a client tries to create a duplicate list or leaf-list entry."; } identity invalid-datatype { base error-app-tag; description "Returned by the CORECONF server when CBOR encoding is incorect or when the value encoded is incompatible with the YANG Built-In type. (e.g., value greater than 127 for an int8, undefined enumeration)."; } identity not-in-range { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'range' property fails."; } identity invalid-length { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'length' property fails."; } identity pattern-test-failed { base error-app-tag; description "Returned by the CORECONF server when the validation of the 'pattern' property fails."; } identity missing-key { base error-app-tag; description "Returned by the CORECONF server to further qualify a missing-element error. This error is returned when the CORECONF client tries to create or list instance, without all the 'key' specified or when the CORECONF client tries to delete a leaf listed as a 'key'."; } identity missing-input-parameter { base error-app-tag; description "Returned by the CORECONF server when the input parameters of a RPC or action are incomplete."; } identity instance-required { base error-app-tag; description "Returned by the CORECONF server when a leaf of type 'instance-identifier' or 'leafref' marked with require-instance set to 'true' refers to an instance that does not exist."; } identity missing-choice { base error-app-tag; description "Returned by the CORECONF server when no nodes exist in a mandatory choice."; } rc:yang-data coreconf-error { container error { description "Optional payload of a 4.00 Bad Request CoAP error."; leaf error-tag { type identityref { base error-tag; } mandatory true; description "The enumerated error-tag."; } leaf error-app-tag { type identityref { base error-app-tag; } description "The application-specific error-tag."; } leaf error-data-node { type instance-identifier; description "When the error reported is caused by a specific data node, this leaf identifies the data node in error."; } leaf error-message { type string; description "A message describing the error."; } } }}<CODE ENDS>¶{ "assignment-ranges": [ { "entry-point": 1000, "size": 100 } ], "module-name": "ietf-coreconf", "module-revision": "2023-07-10", "items": [ { "namespace": "module", "identifier": "ietf-coreconf", "sid": 1000 }, { "namespace": "identity", "identifier": "bad-element", "sid": 1001 }, { "namespace": "identity", "identifier": "data-missing", "sid": 1002 }, { "namespace": "identity", "identifier": "data-not-unique", "sid": 1003 }, { "namespace": "identity", "identifier": "duplicate", "sid": 1004 }, { "namespace": "identity", "identifier": "error", "sid": 1005 }, { "namespace": "identity", "identifier": "error-app-tag", "sid": 1006 }, { "namespace": "identity", "identifier": "error-tag", "sid": 1007 }, { "namespace": "identity", "identifier": "instance-required", "sid": 1008 }, { "namespace": "identity", "identifier": "invalid-datatype", "sid": 1009 }, { "namespace": "identity", "identifier": "invalid-length", "sid": 1010 }, { "namespace": "identity", "identifier": "invalid-value", "sid": 1011 }, { "namespace": "identity", "identifier": "malformed-message", "sid": 1012 }, { "namespace": "identity", "identifier": "missing-choice", "sid": 1013 }, { "namespace": "identity", "identifier": "missing-element", "sid": 1014 }, { "namespace": "identity", "identifier": "missing-input-parameter", "sid": 1015 }, { "namespace": "identity", "identifier": "missing-key", "sid": 1016 }, { "namespace": "identity", "identifier": "must-violation", "sid": 1017 }, { "namespace": "identity", "identifier": "not-in-range", "sid": 1018 }, { "namespace": "identity", "identifier": "operation-failed", "sid": 1019 }, { "namespace": "identity", "identifier": "pattern-test-failed", "sid": 1020 }, { "namespace": "identity", "identifier": "too-few-elements", "sid": 1021 }, { "namespace": "identity", "identifier": "too-many-elements", "sid": 1022 }, { "namespace": "identity", "identifier": "unified", "sid": 1029 }, { "namespace": "identity", "identifier": "unknown-element", "sid": 1023 }, { "namespace": "data", "identifier": "/ietf-coreconf:error", "sid": 1024 }, { "namespace": "data", "identifier": "/ietf-coreconf:error/error-app-tag", "sid": 1025 }, { "namespace": "data", "identifier": "/ietf-coreconf:error/error-data-node", "sid": 1026 }, { "namespace": "data", "identifier": "/ietf-coreconf:error/error-message", "sid": 1027 }, { "namespace": "data", "identifier": "/ietf-coreconf:error/error-tag", "sid": 1028 } ]}¶We are very grateful toBert Greevenbosch who was one of the original authorsof the CORECONF specification.¶
Mehmet Ersue andBert Wijnen explained the encoding aspects of PDUs transportedunder SNMP.Koen Zandberg's implementation input motivated massively simplifying(and fixing) the URI construction for GET/PUT/POST requests.¶
The draft has further benefited from comments (alphabetical order) byRodney Cummings,Dee Denteneer,Esko Dijk,Klaus Hartke,Michael van Hartskamp,Tanguy Ropitault,Jürgen Schönwälder,Anuj Sehgal,Zach Shelby,Hannes Tschofenig,Michael Verschoor,andThomas Watteyne.¶
draft-ietf-core-comi-14
| Document | Document type | This is an older version of an Internet-Draft whose latest revision state is "Expired". | |
|---|---|---|---|
| Select version | |||
| Compare versions | |||
| Authors | Michel Veillette,Peter Van der Stok,Alexander Pelov,Andy Bierman,Carsten Bormann | ||
| Replaces | draft-vanderstok-core-comi | ||
| RFC stream | |||
| Other formats | |||
| Additional resources | Mailing list discussion |