Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify/revise language around epochs in section 9.1.1 #9

Open
jimsch opened this issue Jun 12, 2019 · 8 comments
Open

Clarify/revise language around epochs in section 9.1.1 #9

jimsch opened this issue Jun 12, 2019 · 8 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jimsch
Copy link

jimsch commented Jun 12, 2019

Current text is:

The following rules are added for matching an Acknowledgement message
or Reset message to a Confirmable message, or a Reset message to a
Non-confirmable message: The DTLS session MUST be the same, and the
epoch MUST be the same.

However this does not really make any sense in terms of what DTLS does for authentication. The rule was initially created so that if the authentication data changed, which forces an epoch change, then the message would not be matched. The problem is that epochs can change for other reasons such as simple re-keys which do not change any of the authentication data.

When a re-authentication is done in TLS, then there is a large discussion about what this means. One interpretation is that the new authentication is added to the existing one. In which case not matching may not make sense. The other interpretation is that the new authentication replaces the old one.

Under each of these situations it does not really make sense for the client to have to add this rule for matching. The sequence of events would be:

  • Client sends request
  • Client-server does a new authentication set
  • Client receives response from server

The server should have checked that the authentication was fine when creating the response and there is no change in the client that is at the other end of the pipe.

Recommend: Remove all of the language about epochs from RFC 7252.

@ektrah
Copy link

ektrah commented Jun 12, 2019

Small clarification: The rule was initially created because noone had performed a security analysis under which condition it's OK to send request and response(s) in different epochs. The change of authentication data is just one issue that shows that a careful security analysis is needed.

@ektrah
Copy link

ektrah commented Jun 12, 2019

@ektrah
Copy link

ektrah commented Jun 12, 2019

@boaks
Copy link

boaks commented Jun 15, 2021

Let me try to add some practical notes:

For the most request/response pairs the time span is short, and therefore the probability that something changes according the DTLS layer is low.

The most pain comes with RFC7641, observe/notify. With that, the time span gets much larger. Assuming longer quiet periods, NAT timeouts occur too often. Though that pattern was used for LwM2M (data reporting), the most of the discussion have been in the OMA repo (at least, I feel so :-) ). For Eclipse/Californium we introduced therefore a (hopefully) flexible and customizable matcher-interface. With that, it's up to the application, what is considered to be save enough or not.

For coap-servers there is a left-risk, that the response is sent, when the IP is already "assigned" to a different client (e.g. after a NAT timeout of the original client). Therefore Californium uses that matcher-interface not only for incoming responses, it's also used for outgoing ones. For LwM2M, where the coap-roles are also used exchanged (initial the LwM2M server is a coap-server, after the registration exchange, the LwM2M-server acts as coap-client), that dtls-context-matching is even extended to all messages, e.g. no coap-data-request is sent to a device, if the context doesn't still match the one of the registration message of that device.

@sbernard31
Copy link

Recommend: Remove all of the language about epochs from RFC 7252.

👍

@sbernard31
Copy link

Maybe a bit out of the topic of this issue.

@boaks raises that particular attention should be taken for RFC7641 observe/notify case:

For the most request/response pairs the time span is short, and therefore the probability the something changes according the DTLS layer is low.
The most pain comes with RFC7641, observe/notify. With that, the time span gets much larger. Assuming longer quiet periods, NAT timeouts occur too often.

Regarding this topic about matching request/response for observe/notify.
It could maybe have a very similar issue with coap over tcp.

The RFC8323 says :

 Responses MUST be returned over the same connection as the originating request. 

Which is fine for "classic" CoAP request/response but maybe not for observe/notify.

RFC-9006§4.3 - TCP Connection Lifetime says :

One approach for infrequent data transfer is to use short-lived TCP connections.
Instead of trying to maintain a TCP connection for a long time, it is possible that short-lived
connections can be opened between two endpoints, which are closed if no more data 
needs to be exchanged. For use cases that can cope with the additional messages
and the latency resulting from starting new connections, it is recommended to use a sequence
of short-lived connections instead of maintaining a single long-lived connection.

I'm not totally sure but I feel using sequence of short-lived connections could fit the case of an observed device which send notify very infrequently but with current RFC8323 this seems not possible.

This seems to illustrate that the "classic" Request/Response matching is often not very well suited to observe/notify.

@cabo cabo transferred this issue from core-wg/corrclar-old Jul 22, 2023
@cabo cabo added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 16, 2024
@cabo cabo closed this as completed in ae82241 Jul 2, 2024
cabo added a commit that referenced this issue Jul 2, 2024
address #9: epochs (or, more generally, match boxing)

Merging, so other PRs can build on top of this.
@cabo
Copy link
Member

cabo commented Jul 2, 2024

I reopened this so further PRs can easily reference this issue.

@cabo cabo reopened this Jul 2, 2024
@sbernard31
Copy link

(0953e9d is a very good summary)

cabo added a commit that referenced this issue Sep 24, 2024
address #9: match boxing with (Group) OSCORE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants