Draft: draft-ietf-core-pubsub

Commentary: Removed the 2.07 code for no data and expect publisher to publish something . Clean up    so it applies to the topic . address email comments .
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
specification are to be interpreted as described in RFC2119.
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 as described in
BCP 14 RFC2119 RFC8174 when, and only when, they appear in all
capitals, as shown here.
"coaps://10.0.0.13:5684/EP-33543/sen/3303/0/5700".
"coaps://192.0.2.13:5684/EP-33543/sen/3303/0/5700".
A Topic may have a lifetime defined by using the CoAP Max-Age option
on topic creation, or on publish operations to the topic.  The
lifetime is refreshed each time a representation is published to the
topic.  If the lifetime expires, the topic is removed from discovery
responses, returns errors on subscription, and any outstanding
subscriptions are cancelled.
In some use cases, it is desireable to use pub/sub semantics for
peer-to-peer communication, but it is not feasible or desireable to
include a separate node on the network to serve as a Broker.  In
other use cases, it is desireable to enable one-way-only
communication, such as sensors pushing updates to a service.
Topics in the broker may be created in hierarchies (see {create})
with parent topics having sub-topics.  For a discovery the broker may
choose to not expose the sub-topics in order to limit amount of topic
links sent in a discovery response.  The client can then perform
discovery for the parent topics it wants to discover the sub-topics.
Topics in the broker may be created in hierarchies (see sec-create)
with parent topics having sub-topics.  For a discovery the broker may
choose to not expose the sub-topics in order to limit amount of topic
links sent in a discovery response.  The client can then perform
discovery for the parent topics it wants to discover the sub-topics.
A topic creator MUST include exactly one content format link
attribute value (ct) in the create payload.  If the Broker does not
support the indicated format for both publish and subscribe, or if
there is more than one "ct" value included in the request, the Broker
MUST reject the operation with an error code of "4.00 Bad Request".
There is no default content format.  If no ct is specified, the
Broker MUST reject the operation with an error code of "4.00 Bad
Request".
A Broker MUST return a response code of "2.01 Created" if the topic
is created and return the URI path of the created topic via Location-
Path options.  The Broker MUST return the appropriate 4.xx response
code indicating the reason for failure if a new topic can not be
created.  Broker SHOULD remove topics if the Max-Age of the topic is
exceeded without any publishes to the topic.  Broker SHOULD retain a
topic indefinitely if the Max-Age option is elided or is set to zero
upon topic creation.  The lifetime of a topic MUST be refreshed upon
create operations with a target of an existing topic.
A topic creator MUST include exactly one content format link
attribute value (ct) in the create payload.  If the content format
option is not included or if the option is repeated, the Broker MUST
reject the operation with an error code of "4.00 Bad Request".
A Broker MUST return a response code of "2.01 Created" if the topic
is created and MUST return the URI path of the created topic via
Location-Path options.  If a new topic can not be created, the Broker
MUST return the appropriate 4.xx response code indicating the reason
for failure.
A Broker SHOULD remove topics if the Max-Age of the topic is exceeded
without any publishes to the topic.  A Broker SHOULD retain a topic
indefinitely if the Max-Age option is elided or is set to zero upon
topic creation.  The lifetime of a topic MUST be refreshed upon
create operations with a target of an existing topic.
A topic creator SHOULD PUBLISH an initial value to a newly-created
Topic in order to enable responses to READ and SUBSCRIBE requests
that may be submitted after the topic is discoverable.
4.03 "Forbidden".  Topic already exists.
4.06 "Not Acceptable".  Unsupported content format for topic.
If a client publishes to a Broker without the Max-Age option, the
Broker MUST refresh the topic lifetime with the most recently set
Max-Age value, and the Broker MUST include the most recently set Max-
Age value in the Max-Age option of all notifications.
If the topic was published with the Max-Age option, the Broker MUST
set the Max-Age option in the valid response to the amount of time
remaining for the value to be valid since the last publish operation
on that topic.  The Broker MUST return a response code of "2.07 No
Content" if the topic has not yet been published to, or if Max-Age of
the previously stored value has expired.  The Broker MUST return a
response code "4.04 Not Found" if the topic does not exist or has
been removed.
If a Topic has been created but not yet published to when a SUBSCRIBE
to the topic is received, the Broker MAY acknowledge and queue the
pending SUBSCRIBE and defer the response until an initial PUBLISH
occurs.
If the topic was published with the Max-Age option, the Broker MUST
set the Max-Age option in the valid response to the amount of time
remaining for the topic to be valid since the last publish.  The
Broker MUST return a response code of "2.07 No Content" if the Max-
Age of the previously stored value has expired, or if the topic has
not yet been published to.
The Broker MUST return a response code "4.04 Not Found" if the topic
does not exist or has been removed.  The Broker MUST return a
response code "4.15 Unsupported Content Format" if the Broker can not
return the requested content format.
If a Topic has been created but not yet published to when a READ to
the topic is received, the Broker MAY acknowledge and queue the
pending READ, and defer the response until an initial PUBLISH occurs.
The Broker MUST return a response code "4.15 Unsupported Content
Format" if the Broker can not return the requested content format.
If the Broker is unable to serve a certain client that is sending
publish messages too fast, the Broker SHOULD respond with Response
Code 4.29, "Too Many Requests" I-D.ietf-core-too-many-reqs and set
the Max-Age Option to indicate the number of seconds after which the
client can retry.  The Broker MAY stop creating notifications from
the publish messages from this client and to this topic for the
indicated time.
If the Broker is unable to serve a certain client that is sending
publish messages too fast, the Broker SHOULD respond with Response
Code 4.29, "Too Many Requests" RFC8516 and set the Max-Age Option to
indicate the number of seconds after which the client can retry.  The
Broker MAY stop creating notifications from the publish messages from
this client and to this topic for the indicated time.