LPWAN Static Context Header Compression (SCHC) and fragmentation for IPv6 and UDP
draft-ietf-lpwan-ipv6-static-context-hc-13
The information below is for an old version of the document.
Document | Type |
This is an older version of an Internet-Draft that was ultimately published as RFC 8724.
|
|
---|---|---|---|
Authors | Ana Minaburo , Laurent Toutain , Carles Gomez | ||
Last updated | 2018-06-27 (Latest revision 2018-05-22) | ||
Replaces | draft-toutain-lpwan-ipv6-static-context-hc | ||
RFC stream | Internet Engineering Task Force (IETF) | ||
Formats | |||
Reviews |
GENART Last Call review
(of
-21)
by Pete Resnick
Ready w/issues
|
||
Additional resources | Mailing list discussion | ||
Stream | WG state | WG Document | |
Document shepherd | Pascal Thubert | ||
IESG | IESG state | Became RFC 8724 (Proposed Standard) | |
Consensus boilerplate | Yes | ||
Telechat date | (None) | ||
Responsible AD | (None) | ||
Send notices to | Dominique Barthel <dominique.barthel@orange.com>, Pascal Thubert <pthubert@cisco.com> |
draft-ietf-lpwan-ipv6-static-context-hc-13
fragment of the packet being transmitted and therefore there will not be another window for this packet. 7.5.1. No-ACK In the No-ACK mode, there is no feedback communication from the fragment receiver. The sender will send all the SCHC fragments of a packet without any possibility of knowing if errors or losses have occurred. As, in this mode, there is no need to identify specific SCHC Fragments, a one-bit FCN MAY be used. Consequently, the FCN All-0 value is used in all SCHC fragments except the last one, which carries an All-1 FCN and the MIC. The receiver will wait for SCHC Fragments and will set the Inactivity timer. The receiver will use the MIC contained in the last SCHC Fragment to check for errors. When the Inactivity Timer expires or if the MIC check indicates that the reassembled packet does not match the original one, the receiver will release all resources allocated to reassembling this packet. The initial value of the Inactivity Timer will be determined based on the characteristics of the underlying LPWAN technology and will be defined in other documents (e.g. technology-specific profile documents). 7.5.2. ACK-Always In ACK-Always, the sender transmits SCHC Fragments by using the two- jumping-windows procedure. A delay between each SCHC fragment can be added to respect local regulations or other constraints imposed by the applications. Each time a SCHC fragment is sent, the FCN is decreased by one. When the FCN reaches value 0 and there are more SCHC Fragments to be sent after, the sender transmits the last SCHC Fragment of this window using the All-0 fragment format, it starts the transmitted is the last SCHC Fragment of the SCHC Packet, the sender uses the All-1 fragment format, which includes a MIC. The sender sets the Retransmission Timer and waits for the SCHC ACK to know if transmission errors have occured. The Retransmission Timer is dimensioned based on the LPWAN technology in use. When the Retransmission Timer expires, the sender sends an All-0 empty (resp. All-1 empty) fragment to request again the SCHC ACK for the window that ended with the All-0 (resp. All-1) fragment just sent. The window number is not changed. After receiving an All-0 or All-1 fragment, the receiver sends an SCHC ACK with an encoded Bitmap reporting whether any SCHC fragments have been lost or not. When the sender receives an SCHC ACK, it checks the W bit carried by the SCHC ACK. Any SCHC ACK carrying an unexpected W bit value is discarded. If the W bit value of the received SCHC ACK is correct, the sender analyzes the rest of the Minaburo, et al. Expires November 23, 2018 [Page 33] Internet-Draft LPWAN SCHC May 2018 SCHC ACK message, such as the encoded Bitmap and the MIC. If all the SCHC Fragments sent for this window have been well received, and if at least one more SCHC Fragment needs to be sent, the sender advances its sending window to the next window value and sends the next SCHC Fragments. If no more SCHC Fragments have to be sent, then the SCHC fragmented packet transmission is finished. However, if one or more SCHC Fragments have not been received as per the SCHC ACK (i.e. the corresponding bits are not set in the encoded Bitmap) then the sender resends the missing SCHC Fragments. When all missing SCHC Fragments have been retransmitted, the sender starts the Retransmission Timer, even if an All-0 or an All-1 has not been sent as part of this retransmission and waits for an SCHC ACK. Upon receipt of the SCHC ACK, if one or more SCHC Fragments have not yet been received, the counter Attempts is increased and the sender resends the missing SCHC Fragments again. When Attempts reaches MAX_ACK_REQUESTS, the sender aborts the on-going SCHC Fragmented packet transmission by sending an Abort message and releases any resources for transmission of the packet. The sender also aborts an on-going SCHC Fragmented packet transmission when a failed MIC check is reported by the receiver or when a SCHC Fragment that has not been sent is reported in the encoded Bitmap. On the other hand, at the beginning, the receiver side expects to receive window 0. Any SCHC Fragment received but not belonging to the current window is discarded. All SCHC Fragments belonging to the correct window are accepted, and the actual SCHC Fragment number managed by the receiver is computed based on the FCN value. The receiver prepares the encoded Bitmap to report the correctly received and the missing SCHC Fragments for the current window. After each SCHC Fragment is received the receiver initializes the Inactivity timer, if the Inactivity Timer expires the transmission is aborted. When an All-0 fragment is received, it indicates that all the SCHC Fragments have been sent in the current window. Since the sender is not obliged to always send a full window, some SCHC Fragment number not set in the receiver memory SHOULD not correspond to losses. The receiver sends the corresponding SCHC ACK, the Inactivity Timer is set and the transmission of the next window by the sender can start. If an All-0 fragment has been received and all SCHC Fragments of the current window have also been received, the receiver then expects a new Window and waits for the next SCHC Fragment. Upon receipt of a SCHC Fragment, if the window value has not changed, the received SCHC Fragments are part of a retransmission. A receiver that has already received a SCHC Fragment SHOULD discard it, otherwise, it updates the encoded Bitmap. If all the bits of the encoded Bitmap are set to Minaburo, et al. Expires November 23, 2018 [Page 34] Internet-Draft LPWAN SCHC May 2018 one, the receiver MUST send an SCHC ACK without waiting for an All-0 fragment and the Inactivity Timer is initialized. On the other hand, if the window value of the next received SCHC Fragment is set to the next expected window value, this means that the sender has received a correct encoded Bitmap reporting that all SCHC Fragments have been received. The receiver then updates the value of the next expected window. When an All-1 fragment is received, it indicates that the last SCHC Fragment of the packet has been sent. Since the last window is not always full, the MIC will be used to detect if all SCHC Fragments of the packet have been received. A correct MIC indicates the end of the transmission but the receiver MUST stay alive for an Inactivity Timer period to answer to any empty All-1 fragments the sender MAY send if SCHC ACKs sent by the receiver are lost. If the MIC is incorrect, some SCHC Fragments have been lost. The receiver sends the SCHC ACK regardless of successful SCHC Fragmented packet reception or not, the Inactitivity Timer is set. In case of an incorrect MIC, the receiver waits for SCHC Fragments belonging to the same window. After MAX_ACK_REQUESTS, the receiver will abort the on- going SCHC Fragmented packet transmission by transmitting a the Receiver-Abort format. The receiver also aborts upon Inactivity Timer expiration. 7.5.3. ACK-on-Error The senders behavior for ACK-on-Error and ACK-Always are similar. The main difference is that in ACK-on-Error the SCHC ACK with the encoded Bitmap is not sent at the end of each window but only when at least one SCHC Fragment of the current window has been lost. Excepts for the last window where an SCHC ACK MUST be sent to finish the transmission. In ACK-on-Error, the Retransmission Timer expiration will be considered as a positive acknowledgment. This timer is set after sending an All-0 or an All-1 fragment. When the All-1 fragment has been sent, then the on-going SCHC F/R process is finished and the sender waits for the last SCHC ACK. If the Retransmission Timer expires while waiting for the SCHC ACK for the last window, an All-1 empty MUST be sent to request the last SCHC ACK by the sender to complete the SCHC Fragmented packet transmission. When it expires the sender continue sending SCHC Fragments of the next window. If the sender receives an SCHC ACK, it checks the window value. SCHC ACKs with an unexpected window number are discarded. If the window number on the received encoded Bitmap is correct, the sender verifies if the receiver has received all SCHC fragments of the current Minaburo, et al. Expires November 23, 2018 [Page 35] Internet-Draft LPWAN SCHC May 2018 window. When at least one SCHC Fragment has been lost, the counter Attempts is increased by one and the sender resends the missing SCHC Fragments again. When Attempts reaches MAX_ACK_REQUESTS, the sender sends an Abort message and releases all resources for the on-going SCHC Fragmented packet transmission. When the retransmission of the missing SCHC Fragments is finished, the sender starts listening for an SCHC ACK (even if an All-0 or an All-1 has not been sent during the retransmission) and initializes the Retransmission Timer. After sending an All-1 fragment, the sender listens for an SCHC ACK, initializes Attempts, and starts the Retransmission Timer. If the Retransmission Timer expires, Attempts is increased by one and an empty All-1 fragment is sent to request the SCHC ACK for the last window. If Attempts reaches MAX_ACK_REQUESTS, the sender aborts the on-going SCHC Fragmented packet transmission by transmitting the Sender-Abort fragment. Unlike the sender, the receiver for ACK-on-Error has a larger amount of differences compared with ACK-Always. First, an SCHC ACK is not sent unless there is a lost SCHC Fragment or an unexpected behavior. With the exception of the last window, where an SCHC ACK is always sent regardless of SCHC Fragment losses or not. The receiver starts by expecting SCHC Fragments from window 0 and maintains the information regarding which SCHC Fragments it receives. After receiving an SCHC Fragment, the Inactivity Timer is set. If no further SCHC Fragment are received and the Inactivity Timer expires, the SCHC Fragment receiver aborts the on-going SCHC Fragmented packet transmission by transmitting the Receiver-Abort data unit. Any SCHC Fragment not belonging to the current window is discarded. The actual SCHC Fragment number is computed based on the FCN value. When an All-0 fragment is received and all SCHC Fragments have been received, the receiver updates the expected window value and expects a new window and waits for the next SCHC Fragment. If the window value of the next SCHC Fragment has not changed, the received SCHC Fragment is a retransmission. A receiver that has already received an SCHC Fragment discard it. If all SCHC Fragments of a window (that is not the last one) have been received, the receiver does not send an SCHC ACK. While the receiver waits for the next window and if the window value is set to the next value, and if an All-1 fragment with the next value window arrived the receiver knows that the last SCHC Fragment of the packet has been sent. Since the last window is not always full, the MIC will be used to detect if all SCHC Fragments of the window have been received. A correct MIC check indicates the end of the SCHC Fragmented packet transmission. An ACK is sent by the SCHC Fragment receiver. In case of an incorrect MIC, the receiver waits for SCHC Fragments belonging to the same window or the expiration of the Inactivity Timer. The latter Minaburo, et al. Expires November 23, 2018 [Page 36] Internet-Draft LPWAN SCHC May 2018 will lead the receiver to abort the on-going SCHC fragmented packet transmission. If after receiving an All-0 fragment the receiver missed some SCHC Fragments, the receiver uses an SCHC ACK with the encoded Bitmap to ask the retransmission of the missing fragments and expect to receive SCHC Fragments with the actual window. While waiting the retransmission an All-0 empty fragment is received, the receiver sends again the SCHC ACK with the encoded Bitmap, if the SCHC Fragments received belongs to another window or an All-1 fragment is received, the transmission is aborted by sending a Receiver-Abort fragment. Once it has received all the missing fragments it waits for the next window fragments. 7.6. Supporting multiple window sizes For ACK-Always or ACK-on-Error, implementers MAY opt to support a single window size or multiple window sizes. The latter, when feasible, may provide performance optimizations. For example, a large window size SHOULD be used for packets that need to be carried by a large number of SCHC Fragments. However, when the number of SCHC Fragments required to carry a packet is low, a smaller window size, and thus a shorter Bitmap, MAY be sufficient to provide feedback on all SCHC Fragments. If multiple window sizes are supported, the Rule ID MAY be used to signal the window size in use for a specific packet transmission. Note that the same window size MUST be used for the transmission of all SCHC Fragments that belong to the same SCHC Packet. 7.7. Downlink SCHC Fragment transmission In some LPWAN technologies, as part of energy-saving techniques, downlink transmission is only possible immediately after an uplink transmission. In order to avoid potentially high delay in the downlink transmission of a SCHC Fragmented datagram, the SCHC Fragment receiver MAY perform an uplink transmission as soon as possible after reception of a SCHC Fragment that is not the last one. Such uplink transmission MAY be triggered by the L2 (e.g. an L2 ACK sent in response to a SCHC Fragment encapsulated in a L2 frame that requires an L2 ACK) or it MAY be triggered from an upper layer. For downlink transmission of a SCHC Fragmented packet in ACK-Always mode, the SCHC Fragment receiver MAY support timer-based SCHC ACK retransmission. In this mechanism, the SCHC Fragment receiver initializes and starts a timer (the Inactivity Timer is used) after the transmission of an SCHC ACK, except when the SCHC ACK is sent in response to the last SCHC Fragment of a packet (All-1 fragment). In Minaburo, et al. Expires November 23, 2018 [Page 37] Internet-Draft LPWAN SCHC May 2018 the latter case, the SCHC Fragment receiver does not start a timer after transmission of the SCHC ACK. If, after transmission of an SCHC ACK that is not an All-1 fragment, and before expiration of the corresponding Inactivity timer, the SCHC Fragment receiver receives a SCHC Fragment that belongs to the current window (e.g. a missing SCHC Fragment from the current window) or to the next window, the Inactivity timer for the SCHC ACK is stopped. However, if the Inactivity timer expires, the SCHC ACK is resent and the Inactivity timer is reinitialized and restarted. The default initial value for the Inactivity timer, as well as the maximum number of retries for a specific SCHC ACK, denoted MAX_ACK_RETRIES, are not defined in this document, and need to be defined in other documents (e.g. technology-specific profiles). The initial value of the Inactivity timer is expected to be greater than that of the Retransmission timer, in order to make sure that a (buffered) SCHC Fragment to be retransmitted can find an opportunity for that transmission. When the SCHC Fragment sender transmits the All-1 fragment, it starts its Retransmission Timer with a large timeout value (e.g. several times that of the initial Inactivity timer). If an SCHC ACK is received before expiration of this timer, the SCHC Fragment sender retransmits any lost SCHC Fragments reported by the SCHC ACK, or if the SCHC ACK confirms successful reception of all SCHC Fragments of the last window, the transmission of the SCHC Fragmented packet is considered complete. If the timer expires, and no SCHC ACK has been received since the start of the timer, the SCHC Fragment sender assumes that the All-1 fragment has been successfully received (and possibly, the last SCHC ACK has been lost: this mechanism assumes that the retransmission timer for the All-1 fragment is long enough to allow several SCHC ACK retries if the All-1 fragment has not been received by the SCHC Fragment receiver, and it also assumes that it is unlikely that several ACKs become all lost). 8. Padding management Default padding is defined for L2 frame with a variable length of bytes. Padding is done twice, after compression and in the all-1 fragmentation. In compression, the Compressed Header is generally not a multiple of bytes in size, but the payload following the Compressed Header is always a multiple of 8 bits (see Figure 4). If needed, padding bits can be added after the payload to reach the next byte boundary. Since the Compressed Header (through the Rule ID and the Compression Residue) tells its length and the payload is always a multiple of 8 Minaburo, et al. Expires November 23, 2018 [Page 38] Internet-Draft LPWAN SCHC May 2018 bits, the receiver can without ambiguity remove the padding bits, which never exceed 7 bits. SCHC F/R works on a byte aligned (i.e. padded SCHC Packet). Fragmentation header may not be aligned on byte boundary, but each fragment except the last one (All-1 fragment) must sent the maximum bits as possible. Only the last fragment need to introduce padding to reach the next boundary limit. Since the SCHC is known to be a multiple of 8 bits, the receiver can remove the extra bit to reach this limit. Default padding mechanism do not need to send the padding length and can lead to a maximum of 14 bits of padding. The padding is not mandatory and is optional to the technology- specific document to give a different solution. In this docuement there are some inputs on how to manage the padding. 9. SCHC Compression for IPv6 and UDP headers This section lists the different IPv6 and UDP header fields and how they can be compressed. 9.1. IPv6 version field This field always holds the same value. Therefore, in the rule, TV is set to 6, MO to "equal" and CDA to "not-sent". 9.2. IPv6 Traffic class field If the DiffServ field does not vary and is known by both sides, the Field Descriptor in the rule SHOULD contain a TV with this well-known value, an "equal" MO and a "not-sent" CDA. Otherwise, two possibilities can be considered depending on the variability of the value: o One possibility is to not compress the field and send the original value. In the rule, TV is not set to any particular value, MO is set to "ignore" and CDA is set to "value-sent". o If some upper bits in the field are constant and known, a better option is to only send the LSBs. In the rule, TV is set to a value with the stable known upper part, MO is set to MSB(x) and CDA to LSB(y). Minaburo, et al. Expires November 23, 2018 [Page 39] Internet-Draft LPWAN SCHC May 2018 9.3. Flow label field If the Flow Label field does not vary and is known by both sides, the Field Descriptor in the rule SHOULD contain a TV with this well-known value, an "equal" MO and a "not-sent" CDA. Otherwise, two possibilities can be considered: o One possibility is to not compress the field and send the original value. In the rule, TV is not set to any particular value, MO is set to "ignore" and CDA is set to "value-sent". o If some upper bits in the field are constant and known, a better option is to only send the LSBs. In the rule, TV is set to a value with the stable known upper part, MO is set to MSB(x) and CDA to LSB(y). 9.4. Payload Length field This field can be elided for the transmission on the LPWAN network. The SCHC C/D recomputes the original payload length value. In the Field Descriptor, TV is not set, MO is set to "ignore" and CDA is "compute-IPv6-length". If the payload length needs to be sent and does not need to be coded in 16 bits, the TV can be set to 0x0000, the MO set to MSB(16-s) where 's' is the number of bits to code the maximum length, and CDA is set to LSB(s). 9.5. Next Header field If the Next Header field does not vary and is known by both sides, the Field Descriptor in the rule SHOULD contain a TV with this Next Header value, the MO SHOULD be "equal" and the CDA SHOULD be "not- sent". Otherwise, TV is not set in the Field Descriptor, MO is set to "ignore" and CDA is set to "value-sent". Alternatively, a matching- list MAY also be used. 9.6. Hop Limit field The field behavior for this field is different for Uplink and Downlink. In Uplink, since there is no IP forwarding between the Dev and the SCHC C/D, the value is relatively constant. On the other hand, the Downlink value depends of Internet routing and MAY change more frequently. One neat way of processing this field is to use the Direction Indicator (DI) to distinguish both directions: Minaburo, et al. Expires November 23, 2018 [Page 40] Internet-Draft LPWAN SCHC May 2018 o in the Uplink, elide the field: the TV in the Field Descriptor is set to the known constant value, the MO is set to "equal" and the CDA is set to "not-sent". o in the Downlink, send the value: TV is not set, MO is set to "ignore" and CDA is set to "value-sent". 9.7. IPv6 addresses fields As in 6LoWPAN [RFC4944], IPv6 addresses are split into two 64-bit long fields; one for the prefix and one for the Interface Identifier (IID). These fields SHOULD be compressed. To allow for a single rule being used for both directions, these values are identified by their role (DEV or APP) and not by their position in the frame (source or destination). 9.7.1. IPv6 source and destination prefixes Both ends MUST be synchronized with the appropriate prefixes. For a specific flow, the source and destination prefixes can be unique and stored in the context. It can be either a link-local prefix or a global prefix. In that case, the TV for the source and destination prefixes contain the values, the MO is set to "equal" and the CDA is set to "not-sent". If the rule is intended to compress packets with different prefix values, match-mapping SHOULD be used. The different prefixes are listed in the TV, the MO is set to "match-mapping" and the CDA is set to "mapping-sent". See Figure 28 Otherwise, the TV contains the prefix, the MO is set to "equal" and the CDA is set to "value-sent". 9.7.2. IPv6 source and destination IID If the DEV or APP IID are based on an LPWAN address, then the IID can be reconstructed with information coming from the LPWAN header. In that case, the TV is not set, the MO is set to "ignore" and the CDA is set to "DEViid" or "APPiid". Note that the LPWAN technology generally carries a single identifier corresponding to the DEV. Therefore Appiid cannot be used. For privacy reasons or if the DEV address is changing over time, a static value that is not equal to the DEV address SHOULD be used. In that case, the TV contains the static value, the MO operator is set to "equal" and the CDF is set to "not-sent". [RFC7217] provides some methods that MAY be used to derive this static identifier. Minaburo, et al. Expires November 23, 2018 [Page 41] Internet-Draft LPWAN SCHC May 2018 If several IIDs are possible, then the TV contains the list of possible IIDs, the MO is set to "match-mapping" and the CDA is set to "mapping-sent". It MAY also happen that the IID variability only expresses itself on a few bytes. In that case, the TV is set to the stable part of the IID, the MO is set to "MSB" and the CDA is set to "LSB". Finally, the IID can be sent in extenso on the LPWAN. In that case, the TV is not set, the MO is set to "ignore" and the CDA is set to "value-sent". 9.8. IPv6 extensions No rule is currently defined that processes IPv6 extensions. If such extensions are needed, their compression/decompression rules can be based on the MOs and CDAs described above. 9.9. UDP source and destination port To allow for a single rule being used for both directions, the UDP port values are identified by their role (DEV or APP) and not by their position in the frame (source or destination). The SCHC C/D MUST be aware of the traffic direction (Uplink, Downlink) to select the appropriate field. The following rules apply for DEV and APP port numbers. If both ends know the port number, it can be elided. The TV contains the port number, the MO is set to "equal" and the CDA is set to "not- sent". If the port variation is on few bits, the TV contains the stable part of the port number, the MO is set to "MSB" and the CDA is set to "LSB". If some well-known values are used, the TV can contain the list of these values, the MO is set to "match-mapping" and the CDA is set to "mapping-sent". Otherwise the port numbers are sent over the LPWAN. The TV is not set, the MO is set to "ignore" and the CDA is set to "value-sent". 9.10. UDP length field The UDP length can be computed from the received data. In that case, the TV is not set, the MO is set to "ignore" and the CDA is set to "compute-length". Minaburo, et al. Expires November 23, 2018 [Page 42] Internet-Draft LPWAN SCHC May 2018 If the payload is small, the TV can be set to 0x0000, the MO set to "MSB" and the CDA to "LSB". In other cases, the length SHOULD be sent and the CDA is replaced by "value-sent". 9.11. UDP Checksum field IPv6 mandates a checksum in the protocol above IP. Nevertheless, if a more efficient mechanism such as L2 CRC or MIC is carried by or over the L2 (such as in the LPWAN SCHC F/R process (see Section 7)), the UDP checksum transmission can be avoided. In that case, the TV is not set, the MO is set to "ignore" and the CDA is set to "compute- checksum". In other cases, the checksum SHOULD be explicitly sent. The TV is not set, the MO is set to "ignore" and the CDF is set to "value- sent". 10. Security considerations 10.1. Security considerations for header compression A malicious header compression could cause the reconstruction of a wrong packet that does not match with the original one. Such a corruption MAY be detected with end-to-end authentication and integrity mechanisms. Header Compression does not add more security problem than what is already needed in a transmission. For instance, to avoid an attack, never re-construct a packet bigger than some configured size (with 1500 bytes as generic default). 10.2. Security considerations for SCHC Fragmentation/Reassembly This subsection describes potential attacks to LPWAN SCHC F/R and suggests possible countermeasures. A node can perform a buffer reservation attack by sending a first SCHC Fragment to a target. Then, the receiver will reserve buffer space for the IPv6 packet. Other incoming SCHC Fragmented packets will be dropped while the reassembly buffer is occupied during the reassembly timeout. Once that timeout expires, the attacker can repeat the same procedure, and iterate, thus creating a denial of service attack. The (low) cost to mount this attack is linear with the number of buffers at the target node. However, the cost for an attacker can be increased if individual SCHC Fragments of multiple packets can be stored in the reassembly buffer. To further increase the attack cost, the reassembly buffer can be split into SCHC Fragment-sized buffer slots. Once a packet is complete, it is Minaburo, et al. Expires November 23, 2018 [Page 43] Internet-Draft LPWAN SCHC May 2018 processed normally. If buffer overload occurs, a receiver can discard packets based on the sender behavior, which MAY help identify which SCHC Fragments have been sent by an attacker. In another type of attack, the malicious node is required to have overhearing capabilities. If an attacker can overhear a SCHC Fragment, it can send a spoofed duplicate (e.g. with random payload) to the destination. If the LPWAN technology does not support suitable protection (e.g. source authentication and frame counters to prevent replay attacks), a receiver cannot distinguish legitimate from spoofed SCHC Fragments. Therefore, the original IPv6 packet will be considered corrupt and will be dropped. To protect resource- constrained nodes from this attack, it has been proposed to establish a binding among the SCHC Fragments to be transmitted by a node, by applying content-chaining to the different SCHC Fragments, based on cryptographic hash functionality. The aim of this technique is to allow a receiver to identify illegitimate SCHC Fragments. Further attacks MAY involve sending overlapped fragments (i.e. comprising some overlapping parts of the original IPv6 datagram). Implementers SHOULD make sure that the correct operation is not affected by such event. In Window mode - ACK on error, a malicious node MAY force a SCHC Fragment sender to resend a SCHC Fragment a number of times, with the aim to increase consumption of the SCHC Fragment sender's resources. To this end, the malicious node MAY repeatedly send a fake ACK to the SCHC Fragment sender, with a Bitmap that reports that one or more SCHC Fragments have been lost. In order to mitigate this possible attack, MAX_ACK_RETRIES MAY be set to a safe value which allows to limit the maximum damage of the attack to an acceptable extent. However, note that a high setting for MAX_ACK_RETRIES benefits SCHC Fragment reliability modes, therefore the trade-off needs to be carefully considered. 11. Acknowledgements Thanks to Dominique Barthel, Carsten Bormann, Philippe Clavier, Eduardo Ingles Sanchez, Arunprabhu Kandasamy, Rahul Jadhav, Sergio Lopez Bernal, Antony Markovski, Alexander Pelov, Pascal Thubert, Juan Carlos Zuniga, Diego Dujovne, Edgar Ramos, and Shoichi Sakane for useful design consideration and comments. 12. References Minaburo, et al. Expires November 23, 2018 [Page 44] Internet-Draft LPWAN SCHC May 2018 12.1. Normative References [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, December 1998, <https://www.rfc-editor.org/info/rfc2460>. [RFC3385] Sheinwald, D., Satran, J., Thaler, P., and V. Cavanna, "Internet Protocol Small Computer System Interface (iSCSI) Cyclic Redundancy Check (CRC)/Checksum Considerations", RFC 3385, DOI 10.17487/RFC3385, September 2002, <https://www.rfc-editor.org/info/rfc3385>. [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, "Transmission of IPv6 Packets over IEEE 802.15.4 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, <https://www.rfc-editor.org/info/rfc4944>. [RFC5795] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust Header Compression (ROHC) Framework", RFC 5795, DOI 10.17487/RFC5795, March 2010, <https://www.rfc-editor.org/info/rfc5795>. [RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136, February 2014, <https://www.rfc-editor.org/info/rfc7136>. [RFC7217] Gont, F., "A Method for Generating Semantically Opaque Interface Identifiers with IPv6 Stateless Address Autoconfiguration (SLAAC)", RFC 7217, DOI 10.17487/RFC7217, April 2014, <https://www.rfc-editor.org/info/rfc7217>. 12.2. Informative References [I-D.ietf-lpwan-overview] Farrell, S., "LPWAN Overview", draft-ietf-lpwan- overview-10 (work in progress), February 2018. Appendix A. SCHC Compression Examples This section gives some scenarios of the compression mechanism for IPv6/UDP. The goal is to illustrate the behavior of SCHC. The most common case using the mechanisms defined in this document will be a LPWAN Dev that embeds some applications running over CoAP. In this example, three flows are considered. The first flow is for the device management based on CoAP using Link Local IPv6 addresses and UDP ports 123 and 124 for Dev and App, respectively. The second Minaburo, et al. Expires November 23, 2018 [Page 45] Internet-Draft LPWAN SCHC May 2018 flow will be a CoAP server for measurements done by the Device (using ports 5683) and Global IPv6 Address prefixes alpha::IID/64 to beta::1/64. The last flow is for legacy applications using different ports numbers, the destination IPv6 address prefix is gamma::1/64. Figure 27 presents the protocol stack for this Device. IPv6 and UDP are represented with dotted lines since these protocols are compressed on the radio link. Management Data +----------+---------+---------+ | CoAP | CoAP | legacy | +----||----+---||----+---||----+ . UDP . UDP | UDP | ................................ . IPv6 . IPv6 . IPv6 . +------------------------------+ | SCHC Header compression | | and fragmentation | +------------------------------+ | LPWAN L2 technologies | +------------------------------+ DEV or NGW Figure 27: Simplified Protocol Stack for LP-WAN Note that in some LPWAN technologies, only the Devs have a device ID. Therefore, when such technologies are used, it is necessary to statically define an IID for the Link Local address for the SCHC C/D. Rule 0 +----------------+--+--+--+---------+--------+------------++------+ | Field |FL|FP|DI| Value | Match | Comp Decomp|| Sent | | | | | | | Opera. | Action ||[bits]| +----------------+--+--+--+---------+---------------------++------+ |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | |IPv6 DEVprefix |64|1 |Bi|FE80::/64| equal | not-sent || | |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | |IPv6 APPprefix |64|1 |Bi|FE80::/64| equal | not-sent || | |IPv6 APPiid |64|1 |Bi|::1 | equal | not-sent || | +================+==+==+==+=========+========+============++======+ |UDP DEVport |16|1 |Bi|123 | equal | not-sent || | Minaburo, et al. Expires November 23, 2018 [Page 46] Internet-Draft LPWAN SCHC May 2018 |UDP APPport |16|1 |Bi|124 | equal | not-sent || | |UDP Length |16|1 |Bi| | ignore | comp-length|| | |UDP checksum |16|1 |Bi| | ignore | comp-chk || | +================+==+==+==+=========+========+============++======+ Rule 1 +----------------+--+--+--+---------+--------+------------++------+ | Field |FL|FP|DI| Value | Match | Action || Sent | | | | | | | Opera. | Action ||[bits]| +----------------+--+--+--+---------+--------+------------++------+ |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | |IPv6 Hop Limit |8 |1 |Bi|255 | ignore | not-sent || | |IPv6 DEVprefix |64|1 |Bi|[alpha/64, match- |mapping-sent|| [1] | | | | | |fe80::/64] mapping| || | |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | |IPv6 APPprefix |64|1 |Bi|[beta/64,| match- |mapping-sent|| [2] | | | | | |alpha/64,| mapping| || | | | | | |fe80::64]| | || | |IPv6 APPiid |64|1 |Bi|::1000 | equal | not-sent || | +================+==+==+==+=========+========+============++======+ |UDP DEVport |16|1 |Bi|5683 | equal | not-sent || | |UDP APPport |16|1 |Bi|5683 | equal | not-sent || | |UDP Length |16|1 |Bi| | ignore | comp-length|| | |UDP checksum |16|1 |Bi| | ignore | comp-chk || | +================+==+==+==+=========+========+============++======+ Rule 2 +----------------+--+--+--+---------+--------+------------++------+ | Field |FL|FP|DI| Value | Match | Action || Sent | | | | | | | Opera. | Action ||[bits]| +----------------+--+--+--+---------+--------+------------++------+ |IPv6 version |4 |1 |Bi|6 | equal | not-sent || | |IPv6 DiffServ |8 |1 |Bi|0 | equal | not-sent || | |IPv6 Flow Label |20|1 |Bi|0 | equal | not-sent || | |IPv6 Length |16|1 |Bi| | ignore | comp-length|| | |IPv6 Next Header|8 |1 |Bi|17 | equal | not-sent || | |IPv6 Hop Limit |8 |1 |Up|255 | ignore | not-sent || | |IPv6 Hop Limit |8 |1 |Dw| | ignore | value-sent || [8] | |IPv6 DEVprefix |64|1 |Bi|alpha/64 | equal | not-sent || | |IPv6 DEViid |64|1 |Bi| | ignore | DEViid || | |IPv6 APPprefix |64|1 |Bi|gamma/64 | equal | not-sent || | |IPv6 APPiid |64|1 |Bi|::1000 | equal | not-sent || | +================+==+==+==+=========+========+============++======+ |UDP DEVport |16|1 |Bi|8720 | MSB(12)| LSB || [4] | Minaburo, et al. Expires November 23, 2018 [Page 47] Internet-Draft LPWAN SCHC May 2018 |UDP APPport |16|1 |Bi|8720 | MSB(12)| LSB || [4] | |UDP Length |16|1 |Bi| | ignore | comp-length|| | |UDP checksum |16|1 |Bi| | ignore | comp-chk || | +================+==+==+==+=========+========+============++======+ Figure 28: Context rules All the fields described in the three rules depicted on Figure 28 are present in the IPv6 and UDP headers. The DEViid-DID value is found in the L2 header. The second and third rules use global addresses. The way the Dev learns the prefix is not in the scope of the document. The third rule compresses port numbers to 4 bits. Appendix B. Fragmentation Examples This section provides examples for the different fragment reliability modes specified in this document. Figure 29 illustrates the transmission in No-ACK mode of an IPv6 packet that needs 11 fragments. FCN is 1 bit wide. Sender Receiver |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-------FCN=0-------->| |-----FCN=1 + MIC --->|MIC checked: success => Figure 29: Transmission in No-ACK mode of an IPv6 packet carried by 11 fragments In the following examples, N (i.e. the size if the FCN field) is 3 bits. Therefore, the All-1 FCN value is 7. Minaburo, et al. Expires November 23, 2018 [Page 48] Internet-Draft LPWAN SCHC May 2018 Figure 30 illustrates the transmission in ACK-on-Error of an IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no fragment loss. Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4----->| |-----W=0, FCN=3----->| |-----W=0, FCN=2----->| |-----W=0, FCN=1----->| |-----W=0, FCN=0----->| (no ACK) |-----W=1, FCN=6----->| |-----W=1, FCN=5----->| |-----W=1, FCN=4----->| |--W=1, FCN=7 + MIC-->|MIC checked: success => |<---- ACK, W=1 ------| Figure 30: Transmission in ACK-on-Error mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6 and no loss. Figure 31 illustrates the transmission in ACK-on-Error mode of an IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. Minaburo, et al. Expires November 23, 2018 [Page 49] Internet-Draft LPWAN SCHC May 2018 Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4--X-->| |-----W=0, FCN=3----->| |-----W=0, FCN=2--X-->| 7 |-----W=0, FCN=1----->| / |-----W=0, FCN=0----->| 6543210 |<-----ACK, W=0-------|Bitmap:1101011 |-----W=0, FCN=4----->| |-----W=0, FCN=2----->| (no ACK) |-----W=1, FCN=6----->| |-----W=1, FCN=5----->| |-----W=1, FCN=4--X-->| |- W=1, FCN=7 + MIC ->|MIC checked: failed |<-----ACK, W=1-------|C=0 Bitmap:1100001 |-----W=1, FCN=4----->|MIC checked: success => |<---- ACK, W=1 ------|C=1, no Bitmap Figure 31: Transmission in ACK-on-Error mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. Figure 32 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and no loss. Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4----->| |-----W=0, FCN=3----->| |-----W=0, FCN=2----->| |-----W=0, FCN=1----->| |-----W=0, FCN=0----->| |<-----ACK, W=0-------| Bitmap:1111111 |-----W=1, FCN=6----->| |-----W=1, FCN=5----->| |-----W=1, FCN=4----->| |--W=1, FCN=7 + MIC-->|MIC checked: success => |<-----ACK, W=1-------| C=1 no Bitmap (End) Figure 32: Transmission in ACK-Always mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6 and no lost fragment. Minaburo, et al. Expires November 23, 2018 [Page 50] Internet-Draft LPWAN SCHC May 2018 Figure 33 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. Sender Receiver |-----W=1, FCN=6----->| |-----W=1, FCN=5----->| |-----W=1, FCN=4--X-->| |-----W=1, FCN=3----->| |-----W=1, FCN=2--X-->| 7 |-----W=1, FCN=1----->| / |-----W=1, FCN=0----->| 6543210 |<-----ACK, W=1-------|Bitmap:1101011 |-----W=1, FCN=4----->| |-----W=1, FCN=2----->| |<-----ACK, W=1-------|Bitmap: |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4--X-->| |--W=0, FCN=7 + MIC-->|MIC checked: failed |<-----ACK, W=0-------| C= 0 Bitmap:11000001 |-----W=0, FCN=4----->|MIC checked: success => |<-----ACK, W=0-------| C= 1 no Bitmap (End) Figure 33: Transmission in ACK-Always mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6 and three lost fragments. Figure 34 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost fragments and only one retry needed to recover each lost fragment. Minaburo, et al. Expires November 23, 2018 [Page 51] Internet-Draft LPWAN SCHC May 2018 Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4--X-->| |-----W=0, FCN=3--X-->| |-----W=0, FCN=2--X-->| |--W=0, FCN=7 + MIC-->|MIC checked: failed |<-----ACK, W=0-------|C= 0 Bitmap:1100001 |-----W=0, FCN=4----->|MIC checked: failed |-----W=0, FCN=3----->|MIC checked: failed |-----W=0, FCN=2----->|MIC checked: success |<-----ACK, W=0-------|C=1 no Bitmap (End) Figure 34: Transmission in ACK-Always mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6, three lost framents and only one retry needed for each lost fragment. Figure 35 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 6 fragments, with MAX_WIND_FCN=6, three lost fragments, and the second ACK lost. Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4--X-->| |-----W=0, FCN=3--X-->| |-----W=0, FCN=2--X-->| |--W=0, FCN=7 + MIC-->|MIC checked: failed |<-----ACK, W=0-------|C=0 Bitmap:1100001 |-----W=0, FCN=4----->|MIC checked: failed |-----W=0, FCN=3----->|MIC checked: failed |-----W=0, FCN=2----->|MIC checked: success | X---ACK, W=0-------|C= 1 no Bitmap timeout | | |--W=0, FCN=7 + MIC-->| |<-----ACK, W=0-------|C= 1 no Bitmap (End) Figure 35: Transmission in ACK-Always mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6, three lost fragments, and the second ACK lost. Figure 36 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 6 fragments, with MAX_WIND_FCN=6, with three lost fragments, and one retransmitted fragment lost again. Minaburo, et al. Expires November 23, 2018 [Page 52] Internet-Draft LPWAN SCHC May 2018 Sender Receiver |-----W=0, FCN=6----->| |-----W=0, FCN=5----->| |-----W=0, FCN=4--X-->| |-----W=0, FCN=3--X-->| |-----W=0, FCN=2--X-->| |--W=0, FCN=7 + MIC-->|MIC checked: failed |<-----ACK, W=0-------|C=0 Bitmap:1100001 |-----W=0, FCN=4----->|MIC checked: failed |-----W=0, FCN=3----->|MIC checked: failed |-----W=0, FCN=2--X-->| timeout| | |--W=0, FCN=7 + MIC-->|All-0 empty |<-----ACK, W=0-------|C=0 Bitmap: 1111101 |-----W=0, FCN=2----->|MIC checked: success |<-----ACK, W=0-------|C=1 no Bitmap (End) Figure 36: Transmission in ACK-Always mode of an IPv6 packet carried by 11 fragments, with MAX_WIND_FCN=6, with three lost fragments, and one retransmitted fragment lost again. Figure 37 illustrates the transmission in ACK-Always mode of an IPv6 packet that needs 28 fragments, with N=5, MAX_WIND_FCN=23 and two lost fragments. Note that MAX_WIND_FCN=23 may be useful when the maximum possible Bitmap size, considering the maximum lower layer technology payload size and the value of R, is 3 bytes. Note also that the FCN of the last fragment of the packet is the one with FCN=31 (i.e. FCN=2^N-1 for N=5, or equivalently, all FCN bits set to 1). Minaburo, et al. Expires November 23, 2018 [Page 53] Internet-Draft LPWAN SCHC May 2018 Sender Receiver |-----W=0, FCN=23----->| |-----W=0, FCN=22----->| |-----W=0, FCN=21--X-->| |-----W=0, FCN=20----->| |-----W=0, FCN=19----->| |-----W=0, FCN=18----->| |-----W=0, FCN=17----->| |-----W=0, FCN=16----->| |-----W=0, FCN=15----->| |-----W=0, FCN=14----->| |-----W=0, FCN=13----->| |-----W=0, FCN=12----->| |-----W=0, FCN=11----->| |-----W=0, FCN=10--X-->| |-----W=0, FCN=9 ----->| |-----W=0, FCN=8 ----->| |-----W=0, FCN=7 ----->| |-----W=0, FCN=6 ----->| |-----W=0, FCN=5 ----->| |-----W=0, FCN=4 ----->| |-----W=0, FCN=3 ----->| |-----W=0, FCN=2 ----->| |-----W=0, FCN=1 ----->| |-----W=0, FCN=0 ----->| | |lcl-Bitmap:110111111111101111111111 |<------ACK, W=0-------|encoded Bitmap:1101111111111011 |-----W=0, FCN=21----->| |-----W=0, FCN=10----->| |<------ACK, W=0-------|no Bitmap |-----W=1, FCN=23----->| |-----W=1, FCN=22----->| |-----W=1, FCN=21----->| |--W=1, FCN=31 + MIC-->|MIC checked: sucess => |<------ACK, W=1-------|no Bitmap (End) Figure 37: Transmission in ACK-Always mode of an IPv6 packet carried by 28 fragments, with N=5, MAX_WIND_FCN=23 and two lost fragments. Appendix C. Fragmentation State Machines The fragmentation state machines of the sender and the receiver, one for each of the different reliability modes, are described in the following figures: Minaburo, et al. Expires November 23, 2018 [Page 54] Internet-Draft LPWAN SCHC May 2018 +===========+ +------------+ Init | | FCN=0 +===========+ | No Window | No Bitmap | +-------+ | +========+==+ | More Fragments | | | <--+ ~~~~~~~~~~~~~~~~~~~~ +--------> | Send | send Fragment (FCN=0) +===+=======+ | last fragment | ~~~~~~~~~~~~ | FCN = 1 v send fragment+MIC +============+ | END | +============+ Figure 38: Sender State Machine for the No-ACK Mode +------+ Not All-1 +==========+=+ | ~~~~~~~~~~~~~~~~~~~ | + <--+ set Inactivity Timer | RCV Frag +-------+ +=+===+======+ |All-1 & All-1 & | | |MIC correct MIC wrong | |Inactivity | | |Timer Exp. | v | | +==========++ | v | Error |<-+ +========+==+ +===========+ | END | +===========+ Figure 39: Receiver State Machine for the No-ACK Mode Minaburo, et al. Expires November 23, 2018 [Page 55] Internet-Draft LPWAN SCHC May 2018 +=======+ | INIT | FCN!=0 & more frags | | ~~~~~~~~~~~~~~~~~~~~~~ +======++ +--+ send Window + frag(FCN) W=0 | | | FCN- Clear local Bitmap | | v set local Bitmap FCN=max value | ++==+========+ +> | | +---------------------> | SEND | | +==+===+=====+ | FCN==0 & more frags | | last frag | ~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~ | set local-Bitmap | | set local-Bitmap | send wnd + frag(all-0) | | send wnd+frag(all-1)+MIC | set Retrans_Timer | | set Retrans_Timer | | | |Recv_wnd == wnd & | | |Lcl_Bitmap==recv_Bitmap& | | +----------------------+ |more frag | | |lcl-Bitmap!=rcv-Bitmap| |~~~~~~~~~~~~~~~~~~~~~~ | | | ~~~~~~~~~ | |Stop Retrans_Timer | | | Attemp++ v |clear local_Bitmap v v | +=====+=+ |window=next_window +====+===+==+===+ |Resend | +---------------------+ | |Missing| +----+ Wait | |Frag | not expected wnd | | Bitmap | +=======+ ~~~~~~~~~~~~~~~~ +--->+ ++Retrans_Timer Exp | discard frag +==+=+===+=+==+=+| ~~~~~~~~~~~~~~~~~ | | | | ^ ^ |reSend(empty)All-* | | | | | | |Set Retrans_Timer | MIC_bit==1 & | | | | +--+Attemp++ | Recv_window==window & | | | +-------------------------+ Lcl_Bitmap==recv_Bitmap &| | | all missing frag sent no more frag| | | ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~| | | Set Retrans_Timer Stop Retrans_Timer| | | +=============+ | | | | END +<--------+ | | Attemp > MAX_ACK_REQUESTS +=============+ | | ~~~~~~~~~~~~~~~~~~ All-1 Window | v Send Abort ~~~~~~~~~~~~ | +=+===========+ MIC_bit ==0 & +>| ERROR | Lcl_Bitmap==recv_Bitmap +=============+ Figure 40: Sender State Machine for the ACK-Always Mode Minaburo, et al. Expires November 23, 2018 [Page 56] Internet-Draft LPWAN SCHC May 2018 Not All- & w=expected +---+ +---+w = Not expected ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ Set local_Bitmap(FCN) | v v |discard ++===+===+===+=+ +---------------------+ Rcv +--->* ABORT | +------------------+ Window | | | +=====+==+=====+ | | All-0 & w=expect | ^ w =next & not-All | | ~~~~~~~~~~~~~~~~~~ | |~~~~~~~~~~~~~~~~~~~~~ | | set lcl_Bitmap(FCN)| |expected = next window | | send local_Bitmap | |Clear local_Bitmap | | | | | | w=expct & not-All | | | | ~~~~~~~~~~~~~~~~~~ | | | | set lcl_Bitmap(FCN)+-+ | | +--+ w=next & All-0 | | if lcl_Bitmap full | | | | | | ~~~~~~~~~~~~~~~ | | send lcl_Bitmap | | | | | | expct = nxt wnd | | v | v | | | Clear lcl_Bitmap | | w=expct & All-1 +=+=+=+==+=++ | set lcl_Bitmap(FCN) | | ~~~~~~~~~~~ +->+ Wait +<+ send lcl_Bitmap | | discard +--| Next | | | All-0 +---------+ Window +--->* ABORT | | ~~~~~ +-------->+========+=++ | | snd lcl_bm All-1 & w=next| | All-1 & w=nxt | | & MIC wrong| | & MIC right | | ~~~~~~~~~~~~~~~~~| | ~~~~~~~~~~~~~~~~~~ | | set local_Bitmap(FCN)| |set lcl_Bitmap(FCN) | | send local_Bitmap| |send local_Bitmap | | | +----------------------+ | |All-1 & w=expct | | | |& MIC wrong v +---+ w=expctd & | | |~~~~~~~~~~~~~~~~~~~~ +====+=====+ | MIC wrong | | |set local_Bitmap(FCN) | +<+ ~~~~~~~~~~~~~~ | | |send local_Bitmap | Wait End | set lcl_btmp(FCN)| | +--------------------->+ +--->* ABORT | | +===+====+=+-+ All-1&MIC wrong| | | ^ | ~~~~~~~~~~~~~~~| | w=expected & MIC right | +---+ send lcl_btmp | | ~~~~~~~~~~~~~~~~~~~~~~ | | | set local_Bitmap(FCN) | +-+ Not All-1 | | send local_Bitmap | | | ~~~~~~~~~ | | | | | discard | |All-1 & w=expctd & MIC right | | | | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v | v +----+All-1 | |set local_Bitmap(FCN) +=+=+=+=+==+ |~~~~~~~~~ | |send local_Bitmap | +<+Send lcl_btmp | +-------------------------->+ END | | +==========+<---------------+ Minaburo, et al. Expires November 23, 2018 [Page 57] Internet-Draft LPWAN SCHC May 2018 --->* ABORT ~~~~~~~ Inactivity_Timer = expires When DWN_Link IF Inactivity_Timer expires Send DWL Request Attemp++ Figure 41: Receiver State Machine for the ACK-Always Mode Minaburo, et al. Expires November 23, 2018 [Page 58] Internet-Draft LPWAN SCHC May 2018 +=======+ | | | INIT | | | FCN!=0 & more frags +======++ +--+ ~~~~~~~~~~~~~~~~~~~~~~ W=0 | | | send Window + frag(FCN) ~~~~~~~~~~~~~~~~~~ | | | FCN- Clear local Bitmap | | v set local Bitmap FCN=max value | ++=============+ +> | | | SEND | +-------------------------> | | | ++=====+=======+ | FCN==0 & more frags| |last frag | ~~~~~~~~~~~~~~~~~~~~~~~| |~~~~~~~~~~~~~~~~~ | set local-Bitmap| |set local-Bitmap | send wnd + frag(all-0)| |send wnd+frag(all-1)+MIC | set Retrans_Timer| |set Retrans_Timer | | | |Retrans_Timer expires & | | lcl-Bitmap!=rcv-Bitmap |more fragments | | ~~~~~~~~~~~~~~~~~~~~~~ |~~~~~~~~~~~~~~~~~~~~ | | Attemp++ |stop Retrans_Timer | | +-----------------+ |clear local-Bitmap v v | v |window = next window +=====+=====+==+==+ +====+====+ +----------------------+ + | Resend | +--------------------->+ Wait Bitmap | | Missing | | +-- + | | Frag | | not expected wnd | ++=+===+===+===+==+ +======+==+ | ~~~~~~~~~~~~~~~~ | ^ | | | ^ | | discard frag +----+ | | | +-------------------+ | | | | all missing frag sent |Retrans_Timer expires & | | | ~~~~~~~~~~~~~~~~~~~~~ | No more Frag | | | Set Retrans_Timer | ~~~~~~~~~~~~~~~~~~~~~~~ | | | | Stop Retrans_Timer | | | | Send ALL-1-empty | | | +-------------------------+ | | | | Local_Bitmap==Recv_Bitmap| | ~~~~~~~~~~~~~~~~~~~~~~~~~| |Attemp > MAX_ACK_REQUESTS +=========+Stop Retrans_Timer | |~~~~~~~~~~~~~~~~~~~~~~~ | END +<------------------+ v Send Abort +=========+ +=+=========+ | ERROR | +===========+ Figure 42: Sender State Machine for the ACK-on-Error Mode Minaburo, et al. Expires November 23, 2018 [Page 59] Internet-Draft LPWAN SCHC May 2018 Not All- & w=expected +---+ +---+w = Not expected ~~~~~~~~~~~~~~~~~~~~~ | | | |~~~~~~~~~~~~~~~~ Set local_Bitmap(FCN) | v v |discard ++===+===+===+=+ +-----------------------+ +--+ All-0 & full | ABORT *<---+ Rcv Window | | ~~~~~~~~~~~~ | +--------------------+ +<-+ w =next | | All-0 empty +->+=+=+===+======+ clear lcl_Bitmap | | ~~~~~~~~~~~ | | | ^ | | send bitmap +----+ | |w=expct & not-All & full | | | |~~~~~~~~~~~~~~~~~~~~~~~~ | | | |set lcl_Bitmap; w =nxt | | | | | | All-0 & w=expect | | w=next | | & no_full Bitmap | | ~~~~~~~~ +========+ | | ~~~~~~~~~~~~~~~~~ | | Send abort| Error/ | | | send local_Bitmap | | +---------->+ Abort | | | | | | +-------->+========+ | | v | | | all-1 ^ | | All-0 empty +====+===+==+=+=+ ~~~~~~~ | | | ~~~~~~~~~~~~~ +--+ Wait | Send abort | | | send lcl_btmp +->| Missing Fragm.| | | | +==============++ | | | +--------------+ | | Uplink Only & | | Inactivity_Timer = expires | | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | | Send Abort | |All-1 & w=expect & MIC wrong | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-+ All-1 | |set local_Bitmap(FCN) | v ~~~~~~~~~~ | |send local_Bitmap +===========+==+ snd lcl_btmp | +--------------------->+ Wait End +-+ | +=====+=+====+=+ | w=expct & | w=expected & MIC right | | ^ | MIC wrong | ~~~~~~~~~~~~~~~~~~~~~~ | | +---+ ~~~~~~~~~ | set & send local_Bitmap(FCN) | | set lcl_Bitmap(FCN) | | | |All-1 & w=expected & MIC right | +-->* ABORT |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v |set & send local_Bitmap(FCN) +=+==========+ +---------------------------->+ END | +============+ --->* ABORT Only Uplink Inactivity_Timer = expires ~~~~~~~~~~~~~~~~~~~~~~~~~~ Send Abort Minaburo, et al. Expires November 23, 2018 [Page 60] Internet-Draft LPWAN SCHC May 2018 Figure 43: Receiver State Machine for the ACK-on-Error Mode Appendix D. SCHC Parameters - Ticket #15 This section gives the list of parameters that need to be defined in the technology-specific documents, technology developers must evaluate that L2 has strong enough integrity checking to match SCHC's assumption: o LPWAN Architecture. Explain the SCHC entities (Compression and Fragmentation), how/where are they be represented in the corresponding technology architecture. o L2 fragmentation decision o Rule ID number of rules o Size of the Rule ID o The way the Rule ID is sent (L2 or L3) and how (describe) o Fragmentation delivery reliability mode used in which cases o Define the number of bits FCN (N) and DTag (T) o The MIC algorithm to be used and the size if different from the default CRC32 o Retransmission Timer duration o Inactivity Timer duration o Define the MAX_ACK_REQUEST (number of attempts) o Use of padding or not and how and when to use it o Take into account that the length of rule-id + N + T + W when possible is good to have a multiple of 8 bits to complete a byte and avoid padding o In the ACK format to have a length for Rule-ID + T + W bit into a complete number of byte to do optimization more easily o The technology documents will describe if Rule ID is constrained by any alignment And the following parameters need to be addressed in another document but not forcely in the technology-specific one: Minaburo, et al. Expires November 23, 2018 [Page 61] Internet-Draft LPWAN SCHC May 2018 o The way the contexts are provisioning o The way the Rules as generated Appendix E. Note Carles Gomez has been funded in part by the Spanish Government (Ministerio de Educacion, Cultura y Deporte) through the Jose Castillejo grant CAS15/00336, and by the ERDF and the Spanish Government through project TEC2016-79988-P. Part of his contribution to this work has been carried out during his stay as a visiting scholar at the Computer Laboratory of the University of Cambridge. Authors' Addresses Ana Minaburo Acklio 2bis rue de la Chataigneraie 35510 Cesson-Sevigne Cedex France Email: ana@ackl.io Laurent Toutain IMT-Atlantique 2 rue de la Chataigneraie CS 17607 35576 Cesson-Sevigne Cedex France Email: Laurent.Toutain@imt-atlantique.fr Carles Gomez Universitat Politecnica de Catalunya C/Esteve Terradas, 7 08860 Castelldefels Spain Email: carlesgo@entel.upc.edu Minaburo, et al. Expires November 23, 2018 [Page 62]