Subject: [Dots] Role reversal in RFC7252

From: <[email-masked]>
Date: Fri, 8 Nov 2019 12:29:25 +0000

Hi Carsten,

Can you please help indicate whether (and thus which part of) RFC7252 discusses client/server role reversal so that a CoAP server can send (non-Empty) requests to a CoAP client?

Thank you.

Cheers,
Med

---

From: Carsten Bormann <[email-masked]>
Date: Fri, 8 Nov 2019 18:10:05 +0100

> Can you please help indicate whether (and thus which part of) RFC7252 discusses client/server role reversal so that a CoAP server can send (non-Empty) requests to a CoAP client?

2.  Constrained Application Protocol

   The interaction model of CoAP is similar to the client/server model
   of HTTP.  However, machine-to-machine interactions typically result
   in a CoAP implementation acting in both client and server roles.  

Obviously, the one sending a request is always a client. But it might have been a server in the last  interaction.  Because we don’t need a connection (or, with RFC 8323, the connection does not dictate the direction), this is easy to do.

Grüße, Carsten

---

From: <[email-masked]>
Date: Tue, 12 Nov 2019 06:40:22 +0000

Hi Carsten, 

Fully agree if we model an endpoint as both a client and server.

The concern I had is when we want to model an endpoint solely as an "client" (or as a server).

Thanks. 

Cheers,
Med

> -----Message d'origine-----
> De : Carsten Bormann [mailto:[email-masked]]
> Envoyé : vendredi 8 novembre 2019 18:10
> À : BOUCADAIR Mohamed TGI/OLN
> Cc : [email-masked]
> Objet : Re: Role reversal in RFC7252
> 
> > Can you please help indicate whether (and thus which part of) RFC7252
> discusses client/server role reversal so that a CoAP server can send (non-
> Empty) requests to a CoAP client?
> 
> 
> Obviously, the one sending a request is always a client. But it might have
> been a server in the last  interaction.  Because we don’t need a connection
> (or, with RFC 8323, the connection does not dictate the direction), this is
> easy to do.
> 
> Grüße, Carsten

---

From: Carsten Bormann <[email-masked]>
Date: Tue, 12 Nov 2019 07:58:42 +0100

On Nov 12, 2019, at 07:40, <[email-masked]> <[email-masked]> wrote:
> The concern I had is when we want to model an endpoint solely as an “client" (or as a server).

The question is why you would want to do this.

The main point about a server is that its transport address (IP address + port number) needs to be known to talk to it.  (The client implicitly indicates its transport address in a request, and it only needs to be stable up to a response — which may include an observe notification later.)

So if your clients are hopping around on different addresses, role reversal requires the server-now-client to know the current one.  In a keep alive situation, I’d expect that to be the case, so there is very little against role reversal.

(I’m assuming DOTS environments are NAT free.)

Grüße, Carsten

---

From: <[email-masked]>
Date: Tue, 12 Nov 2019 07:58:55 +0000

Re-,

Please see inline. 

Cheers,
Med

> Envoyé : mardi 12 novembre 2019 07:59

[Med] Our initial concerns were: (1) avoid duplicating functionality (CoAP keepalive vs application keepalive) and (2) avoid having dormant code. 

For the second one, I guess this can be controlled by limiting the code to the required functionality. As you can see in https://github.com/boucadair/draft-ietf-dots-signal-channel/blob/master/draft-ietf-dots-signal-channel-39.txt, we added this note:  

   DOTS clients and servers behave as CoAP endpoints.  By default, a
   DOTS client (or server) behaves as a CoAP client (or server).
   Nevertheless, a DOTS client (or server) behaves as a CoAP server (or
   client) for specific operations such as DOTS heartbeat operations
   (Section 4.7).  

> 
> The main point about a server is that its transport address (IP address +
> port number) needs to be known to talk to it.  (The client implicitly
> indicates its transport address in a request, and it only needs to be
> stable up to a response — which may include an observe notification later.)

[Med] ... assuming the state in on-path NATs/FWs is maintained.

> 
> So if your clients are hopping around on different addresses, role reversal
> requires the server-now-client to know the current one.  In a keep alive
> situation, I’d expect that to be the case, so there is very little against
> role reversal.

[Med] OK, thanks. 

In order to progress, we updated the spec with a DOTS heartbeat instead of CoAP ping messages. An example of such HB request is shown below:  
 
     Header: GET (Code=0.01)
     Uri-Path: ".well-known"
     Uri-Path: "dots"
     Uri-Path: "hb" 

FWIW, the required changes to the spec are straightforward: 

https://github.com/boucadair/draft-ietf-dots-signal-channel/blob/master/wdiff%20draft-ietf-dots-signal-channel-38.txt%20draft-ietf-dots-signal-channel-39.pdf

> (I’m assuming DOTS environments are NAT free.)

[Med] We need to deal with both NATs and FWs. We are covering those details in the spec. These considerations will be valid with or without role reversal (observe notifications, for example).