< draft-ietf-lpwan-coap-static-context-hc-07.txt   draft-ietf-lpwan-coap-static-context-hc-08.txt >
lpwan Working Group A. Minaburo lpwan Working Group A. Minaburo
Internet-Draft Acklio Internet-Draft Acklio
Intended status: Standards Track L. Toutain Intended status: Standards Track L. Toutain
Expires: November 25, 2019 Institut MINES TELECOM; IMT Atlantique Expires: November 30, 2019 Institut MINES TELECOM; IMT Atlantique
R. Andreasen R. Andreasen
Universidad de Buenos Aires Universidad de Buenos Aires
May 24, 2019 May 29, 2019
LPWAN Static Context Header Compression (SCHC) for CoAP LPWAN Static Context Header Compression (SCHC) for CoAP
draft-ietf-lpwan-coap-static-context-hc-07 draft-ietf-lpwan-coap-static-context-hc-08
Abstract Abstract
This draft defines the way SCHC header compression can be applied to This draft defines the way SCHC header compression can be applied to
CoAP headers. The CoAP header structure differs from IPv6 and UDP CoAP headers. The CoAP header structure differs from IPv6 and UDP
protocols since CoAP protocols since CoAP
uses a flexible header with a variable number of options themselves uses a flexible header with a variable number of options themselves
of variable length. The CoAP protocol is asymmetric in its message of variable length. The CoAP protocol is asymmetric in its message
format, the format of the header packet in the request messages is format, the format of the header packet in the request messages is
different from that in the response messages. Most of the different from that in the response messages. Most of the
skipping to change at page 1, line 42 skipping to change at page 1, line 42
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on November 25, 2019. This Internet-Draft will expire on November 30, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 47 skipping to change at page 2, line 47
6. Other RFCs . . . . . . . . . . . . . . . . . . . . . . . . . 10 6. Other RFCs . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.1. Block . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.1. Block . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.2. Observe . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.2. Observe . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.3. No-Response . . . . . . . . . . . . . . . . . . . . . . . 10 6.3. No-Response . . . . . . . . . . . . . . . . . . . . . . . 10
6.4. Time Scale . . . . . . . . . . . . . . . . . . . . . . . 10 6.4. Time Scale . . . . . . . . . . . . . . . . . . . . . . . 10
6.5. OSCORE . . . . . . . . . . . . . . . . . . . . . . . . . 11 6.5. OSCORE . . . . . . . . . . . . . . . . . . . . . . . . . 11
7. Examples of CoAP header compression . . . . . . . . . . . . . 12 7. Examples of CoAP header compression . . . . . . . . . . . . . 12
7.1. Mandatory header with CON message . . . . . . . . . . . . 12 7.1. Mandatory header with CON message . . . . . . . . . . . . 12
7.2. OSCORE Compression . . . . . . . . . . . . . . . . . . . 13 7.2. OSCORE Compression . . . . . . . . . . . . . . . . . . . 13
7.3. Example OSCORE Compression . . . . . . . . . . . . . . . 17 7.3. Example OSCORE Compression . . . . . . . . . . . . . . . 17
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27
9. Security considerations . . . . . . . . . . . . . . . . . . . 28 9. Security considerations . . . . . . . . . . . . . . . . . . . 27
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 28 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 27
11. Normative References . . . . . . . . . . . . . . . . . . . . 29 11. Normative References . . . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28
1. Introduction 1. Introduction
CoAP [rfc7252] is an implementation of the REST architecture for CoAP [rfc7252] is an implementation of the REST architecture for
constrained devices. Although CoAP was designed for constrained constrained devices. Although CoAP was designed for constrained
devices, the size of a CoAP header may still be too large for LPWAN devices, the size of a CoAP header may still be too large for LPWAN
constraints and some compression may be needed to reduce the header constraints and some compression may be needed to reduce the header
size. size.
[I-D.ietf-lpwan-ipv6-static-context-hc] defines a header compression [I-D.ietf-lpwan-ipv6-static-context-hc] defines a header compression
skipping to change at page 19, line 5 skipping to change at page 18, line 32
Original msg length: 10 Original msg length: 10
Figure 11: CoAP CONTENT Response Figure 11: CoAP CONTENT Response
The SCHC Rules for the Inner Compression include all fields that are The SCHC Rules for the Inner Compression include all fields that are
already present in a regular CoAP message, what is important is the already present in a regular CoAP message, what is important is the
order of appearance and inclusion of only those CoAP fields that go order of appearance and inclusion of only those CoAP fields that go
into the Plaintext, Figure 12. into the Plaintext, Figure 12.
Rule ID 0 Rule ID 0
<<<<<<< Updated upstream +---------------+--+--+-----------+-----------+-----------++------+
+---------------+--+--+-----------+-----------+-----------++------+ | Field |FP|DI| Target | MO | CDA || Sent |
| Field |FP|DI| Target | MO | CDA || Sent | | | | | Value | | ||[bits]|
| | | | Value | | ||[bits]| +---------------+--+--+-----------+-----------+-----------++------+
+---------------+--+--+-----------+-----------+-----------++------+ |CoAP Code | |up| 1 | equal |not-sent || |
|CoAP Code | |up| 1 | equal |not-sent || | |CoAP Code | |dw|[69,132] | match-map |match-sent || c |
|CoAP Code | |dw|[69,132] | match-map |match-sent || c | |CoAP Uri-Path | |up|temperature| equal |not-sent || |
|CoAP Uri-Path | |up|temperature| equal |not-sent || | |COAP Option-End| |dw| 0xFF | equal |not-sent || |
|COAP Option-End| |dw| 0xFF | equal |not-sent || | +---------------+--+--+-----------+-----------+-----------++------+
+---------------+--+--+-----------+-----------+-----------++------+
=======
+----------------+--+--+-----------+-----------+-----------++--------+
| Field |FP|DI| Target | MO | CDA || Sent |
| | | | Value | | || [bits] |
+----------------+--+--+-----------+-----------+-----------++--------+
|CoAP Code | |up| 1 | equal |not-sent || |
|CoAP Code | |dw|[69,132] | match-map |match-sent || c |
|CoAP Uri-Path | |up|temperature| equal |not-sent || |
|COAP Option-End | |dw| 0xFF | equal |not-sent || |
+----------------+--+--+-----------+-----------+-----------++--------+
>>>>>>> Stashed changes
Figure 12: Inner SCHC Rules Figure 12: Inner SCHC Rules
Figure 13 shows the Plaintext obtained for our example GET Request Figure 13 shows the Plaintext obtained for our example GET Request
and follows the process of Inner Compression and Encryption until we and follows the process of Inner Compression and Encryption until we
end up with the Payload to be added in the outer OSCORE Message. end up with the Payload to be added in the outer OSCORE Message.
In this case the original message has no payload and its resulting In this case the original message has no payload and its resulting
Plaintext can be compressed up to only 1 byte (size of the Rule ID). Plaintext can be compressed up to only 1 byte (size of the Rule ID).
The AEAD algorithm preserves this length in its first output, but The AEAD algorithm preserves this length in its first output, but
skipping to change at page 25, line 5 skipping to change at page 24, line 13
to be re-established. to be re-established.
The size s included in the kid context field MAY be masked off with The size s included in the kid context field MAY be masked off with
CDA MSB. The rest of the field could have additional bits masked CDA MSB. The rest of the field could have additional bits masked
off, or have the whole field be fixed with MO equal and CDA not-sent. off, or have the whole field be fixed with MO equal and CDA not-sent.
The same holds for the kid field. The same holds for the kid field.
Figure 17 shows a possible set of Outer Rules to compress the Outer Figure 17 shows a possible set of Outer Rules to compress the Outer
Header. Header.
Rule ID 0 Rule ID 0
<<<<<<< Updated upstream +-------------------+--+--+--------------+--------+---------++------+
+-------------------+--+--+--------------+--------+---------++------+ | Field |FP|DI| Target | MO | CDA || Sent |
| Field |FP|DI| Target | MO | CDA || Sent | | | | | Value | | ||[bits]|
| | | | Value | | ||[bits]| +-------------------+--+--+--------------+--------+---------++------+
+-------------------+--+--+--------------+--------+---------++------+ |CoAP version | |bi| 01 |equal |not-sent || |
|CoAP version | |bi| 01 |equal |not-sent || | |CoAP Type | |up| 0 |equal |not-sent || |
|CoAP Type | |up| 0 |equal |not-sent || | |CoAP Type | |dw| 2 |equal |not-sent || |
|CoAP Type | |dw| 2 |equal |not-sent || | |CoAP TKL | |bi| 1 |equal |not-sent || |
|CoAP TKL | |bi| 1 |equal |not-sent || | |CoAP Code | |up| 2 |equal |not-sent || |
|CoAP Code | |up| 2 |equal |not-sent || | |CoAP Code | |dw| 68 |equal |not-sent || |
|CoAP Code | |dw| 68 |equal |not-sent || | |CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM |
|CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM | |CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT |
|CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT | |CoAP OSCORE_flags | |up| 0x09 |equal |not-sent || |
|CoAP OSCORE_flags | |up| 0x09 |equal |not-sent || | |CoAP OSCORE_piv | |up| 0x00 |MSB(4) |LSB ||PPPP |
|CoAP OSCORE_piv | |up| 0x00 |MSB(4) |LSB ||PPPP | |COAP OSCORE_kid | |up|0x636c69656e70|MSB(52) |LSB ||KKKK |
|COAP OSCORE_kid | |up|0x636c69656e70|MSB(52) |LSB ||KKKK | |COAP OSCORE_kidctxt| |bi| b'' |equal |not-sent || |
|COAP OSCORE_kidctxt| |bi| b'' |equal |not-sent || | |CoAP OSCORE_flags | |dw| b'' |equal |not-sent || |
|CoAP OSCORE_flags | |dw| b'' |equal |not-sent || | |CoAP OSCORE_piv | |dw| b'' |equal |not-sent || |
|CoAP OSCORE_piv | |dw| b'' |equal |not-sent || | |CoAP OSCORE_kid | |dw| b'' |equal |not-sent || |
|CoAP OSCORE_kid | |dw| b'' |equal |not-sent || | |COAP Option-End | |dw| 0xFF |equal |not-sent || |
|COAP Option-End | |dw| 0xFF |equal |not-sent || | +-------------------+--+--+--------------+--------+---------++------+
+-------------------+--+--+--------------+--------+---------++------+
=======
+-------------------+--+--+--------------+---------+-----------++--------+
| Field |FP|DI| Target | MO | CDA || Sent |
| | | | Value | | || [bits] |
+-------------------+--+--+--------------+---------+-----------++--------+
|CoAP version | |bi| 01 |equal |not-sent || |
|CoAP Type | |up| 0 |equal |not-sent || |
|CoAP Type | |dw| 2 |equal |not-sent || |
|CoAP TKL | |bi| 1 |equal |not-sent || |
|CoAP Code | |up| 2 |equal |not-sent || |
|CoAP Code | |dw| 68 |equal |not-sent || |
|CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM |
|CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT |
|CoAP OSCORE_flags | |up| 0x09 |equal |not-sent || |
|CoAP OSCORE_piv | |up| 0x00 |MSB(4) |LSB ||PPPP |
|COAP OSCORE_kid | |up|0x636c69656e70|MSB(52) |LSB ||KKKK |
|COAP OSCORE_kidctxt| |bi| b'' |equal |not-sent || |
|CoAP OSCORE_flags | |dw| b'' |equal |not-sent || |
|CoAP OSCORE_piv | |dw| b'' |equal |not-sent || |
|CoAP OSCORE_kid | |dw| b'' |equal |not-sent || |
|COAP Option-End | |dw| 0xFF |equal |not-sent || |
+-------------------+--+--+--------------+---------+-----------++--------+
>>>>>>> Stashed changes
Figure 17: Outer SCHC Rules Figure 17: Outer SCHC Rules
These Outer Rules are applied to the example GET Request and CONTENT These Outer Rules are applied to the example GET Request and CONTENT
Response. The resulting messages are shown in Figure 18 and Response. The resulting messages are shown in Figure 18 and
Figure 19. Figure 19.
Compressed message: Compressed message:
================== ==================
0x001489458a9fc3686852f6c4 (12 bytes) 0x001489458a9fc3686852f6c4 (12 bytes)
skipping to change at page 27, line 5 skipping to change at page 26, line 5
Compressed msg length: 16 bytes Compressed msg length: 16 bytes
Figure 19: SCHC-OSCORE Compressed CONTENT Response Figure 19: SCHC-OSCORE Compressed CONTENT Response
For contrast, we compare these results with what would be obtained by For contrast, we compare these results with what would be obtained by
SCHC compressing the original CoAP messages without protecting them SCHC compressing the original CoAP messages without protecting them
with OSCORE. To do this, we compress the CoAP messages according to with OSCORE. To do this, we compress the CoAP messages according to
the SCHC rules in Figure 20. the SCHC rules in Figure 20.
Rule ID 1 Rule ID 1
<<<<<<< Updated upstream +---------------+--+--+-----------+---------+-----------++--------+
+---------------+--+--+-----------+---------+-----------++--------+ | Field |FP|DI| Target | MO | CDA || Sent |
| Field |FP|DI| Target | MO | CDA || Sent | | | | | Value | | || [bits] |
| | | | Value | | || [bits] | +---------------+--+--+-----------+---------+-----------++--------+
+---------------+--+--+-----------+---------+-----------++--------+ |CoAP version | |bi| 01 |equal |not-sent || |
|CoAP version | |bi| 01 |equal |not-sent || | |CoAP Type | |up| 0 |equal |not-sent || |
|CoAP Type | |up| 0 |equal |not-sent || | |CoAP Type | |dw| 2 |equal |not-sent || |
|CoAP Type | |dw| 2 |equal |not-sent || | |CoAP TKL | |bi| 1 |equal |not-sent || |
|CoAP TKL | |bi| 1 |equal |not-sent || | |CoAP Code | |up| 2 |equal |not-sent || |
|CoAP Code | |up| 2 |equal |not-sent || | |CoAP Code | |dw| [69,132] |equal |not-sent || |
|CoAP Code | |dw| [69,132] |equal |not-sent || | |CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM |
|CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM | |CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT |
|CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT | |CoAP Uri-Path | |up|temperature|equal |not-sent || |
|CoAP Uri-Path | |up|temperature|equal |not-sent || | |COAP Option-End| |dw| 0xFF |equal |not-sent || |
|COAP Option-End| |dw| 0xFF |equal |not-sent || | +---------------+--+--+-----------+---------+-----------++--------+
+---------------+--+--+-----------+---------+-----------++--------+
=======
+---------------+--+--+-----------+---------+-----------++------------+
| Field |FP|DI| Target | MO | CDA || Sent |
| | | | Value | | || [bits] |
+---------------+--+--+-----------+---------+-----------++------------+
|CoAP version | |bi| 01 |equal |not-sent || |
|CoAP Type | |up| 0 |equal |not-sent || |
|CoAP Type | |dw| 2 |equal |not-sent || |
|CoAP TKL | |bi| 1 |equal |not-sent || |
|CoAP Code | |up| 2 |equal |not-sent || |
|CoAP Code | |dw| [69,132] |equal |not-sent || |
|CoAP MID | |bi| 0000 |MSB(12) |LSB ||MMMM |
|CoAP Token | |bi| 0x80 |MSB(5) |LSB ||TTT |
|CoAP Uri-Path | |up|temperature|equal |not-sent || |
|COAP Option-End| |dw| 0xFF |equal |not-sent || |
+---------------+--+--+-----------+---------+-----------++------------+
>>>>>>> Stashed changes
Figure 20: SCHC-CoAP Rules (No OSCORE) Figure 20: SCHC-CoAP Rules (No OSCORE)
This yields the results in Figure 21 for the Request, and Figure 22 This yields the results in Figure 21 for the Request, and Figure 22
for the Response. for the Response.
Compressed message: Compressed message:
================== ==================
0x0114 0x0114
0x01 = Rule ID 0x01 = Rule ID
 End of changes. 8 change blocks. 
111 lines changed or deleted 57 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/