In LPWAN technologies, the L2 MTU typically ranges from tens to hundreds of bytes. Some of these technologies do not have an internal fragmentation/reassembly mechanism.
The optional SCHC F/R functionality enables such LPWAN technologies to comply with the IPv6 MTU requirement of 1280 bytes [
RFC 8200]. It is
OPTIONAL to implement per this specification, but Profiles may specify that it is
REQUIRED.
This specification includes several SCHC F/R modes, which allow for a range of reliability options such as optional SCHC Fragment retransmission. More modes may be defined in the future.
The same SCHC F/R mode
MUST be used for all SCHC Fragments of a given SCHC Packet. This document does not specify which mode(s) must be implemented and used over a specific LPWAN technology. That information will be given in Profiles.
SCHC allows transmitting non-fragmented SCHC Packet concurrently with fragmented SCHC Packets. In addition, SCHC F/R provides protocol elements that allow transmitting several fragmented SCHC Packets concurrently, i.e., interleaving the transmission of fragments from different fragmented SCHC Packets. A Profile
MAY restrict the latter behavior.
The L2 Word size (see
Section 4) determines the encoding of some messages. SCHC F/R usually generates SCHC Fragments and SCHC ACKs that are multiples of L2 Words.
This subsection describes the different elements that are used to enable the SCHC F/R functionality defined in this document. These elements include the SCHC F/R messages, tiles, windows, bitmaps, counters, timers, and header fields.
The elements are described here in a generic manner. Their application to each SCHC F/R mode is found in
Section 8.4.
SCHC F/R defines the following messages:
-
SCHC Fragment:
-
A message that carries part of a SCHC Packet from the sender to the receiver.
-
SCHC ACK:
-
An acknowledgement for fragmentation, by the receiver to the sender.This message is used to indicate whether or not the reception of pieces of,or the whole of, the fragmented SCHC Packet was successful.
-
SCHC ACK REQ:
-
A request by the sender for a SCHC ACK from the receiver.
-
SCHC Sender-Abort:
-
A message by the sender telling the receiver that it has aborted the transmission of a fragmented SCHC Packet.
-
SCHC Receiver-Abort:
-
A message by the receiver to tell the sender to abort the transmission of a fragmented SCHC Packet.
The format of these messages is provided in
Section 8.3.
The SCHC Packet is fragmented into pieces, hereafter called "tiles". The tiles
MUST be non-empty and pairwise disjoint. Their union
MUST be equal to the SCHC Packet.
See
Figure 10 for an example.
SCHC Packet
+----+--+-----+---+----+-+---+-----+...-----+----+---+------+
Tiles | | | | | | | | | | | | |
+----+--+-----+---+----+-+---+-----+...-----+----+---+------+
Modes (see
Section 8.4)
MAY place additional constraints on tile sizes.
Each SCHC Fragment message carries at least one tile in its Payload, if the Payload field is present.
Some SCHC F/R modes may handle successive tiles in groups, called windows.
If windows are used:
-
all the windows of a SCHC Packet, except the last one, MUST contain the same number of tiles. This number is WINDOW_SIZE.
-
WINDOW_SIZE MUST be specified in a Profile.
-
the windows are numbered.
-
their numbers MUST increment by 1 from 0 upward, from the start of the SCHC Packet to its end.
-
the last window MUST contain WINDOW_SIZE tiles or less.
-
tiles are numbered within each window.
-
the tile indices MUST decrement by 1 from WINDOW_SIZE - 1 downward, looking from the start of the SCHC Packet toward its end.
-
therefore, each tile of a SCHC Packet is uniquely identified by a window number and a tile index within this window.
See
Figure 11 for an example.
+---------------------------------------------...-----------+
| SCHC Packet |
+---------------------------------------------...-----------+
Tile# | 4 | 3 | 2 | 1 | 0 | 4 | 3 | 2 | 1 | 0 | 4 | | 0 | 4 |3|
Window# |-------- 0 --------|-------- 1 --------|- 2 ... 27 -|- 28-|
Appendix E discusses the benefits of selecting one among multiple window sizes depending on the size of the SCHC Packet to be fragmented.
When windows are used:
-
Bitmaps (see Section 8.2.2.3) MAY be sent back by the receiver to the sender in a SCHC ACK message.
-
A Bitmap corresponds to exactly one Window.
Each bit in the Bitmap for a window corresponds to a tile in the window. Therefore, each Bitmap has WINDOW_SIZE bits. The bit at the leftmost position corresponds to the tile numbered WINDOW_SIZE - 1. Consecutive bits, going right, correspond to sequentially decreasing tile indices. In Bitmaps for windows that are not the last one of a SCHC Packet, the bit at the rightmost position corresponds to the tile numbered 0. In the Bitmap for the last window, the bit at the rightmost position corresponds either to the tile numbered 0 or to a tile that is sent/received as "the last one of the SCHC Packet" without explicitly stating its number (see
Section 8.3.1.2).
At the receiver:
-
a bit set to 1 in the Bitmap indicates that a tile associated with that bit position has been correctly received for that window.
-
a bit set to 0 in the Bitmap indicates that there has been no tile correctly received, associated with that bit position, for that window. Possible reasons include that the tile was not sent at all, not received, or received with errors.
Some SCHC F/R modes can use the following timers and counters:
-
Inactivity Timer:
-
a SCHC Fragment receiver uses this timer to abort waiting for a SCHC F/R message.
-
Retransmission Timer:
-
a SCHC Fragment sender uses this timer to abort waiting for an expected SCHC ACK.
-
Attempts:
-
this counter counts the requests for SCHC ACKs, up to MAX_ACK_REQUESTS.
The integrity of the fragmentation-reassembly process of a SCHC Packet
MUST be checked at the receive end. A Profile
MUST specify how integrity checking is performed.
It is
RECOMMENDED that integrity checking be performed by computing a Reassembly Check Sequence (RCS) based on the SCHC Packet at the sender side and transmitting it to the receiver for comparison with the RCS locally computed after reassembly.
The RCS supports UDP checksum elision by SCHC C/D (see
Section 10.11).
The CRC32 polynomial 0xEDB88320 (i.e., the reversed polynomial representation, which is used in the Ethernet standard [
ETHERNET]) is
RECOMMENDED as the default algorithm for computing the RCS.
The RCS
MUST be computed on the full SCHC Packet concatenated with the padding bits, if any, of the SCHC Fragment carrying the last tile. The rationale is that the SCHC reassembler has no way of knowing the boundary between the last tile and the padding bits. Indeed, this requires decompressing the SCHC Packet, which is out of the scope of the SCHC reassembler.
The concatenation of the complete SCHC Packet and any padding bits, if present, of the last SCHC Fragment does not generally constitute an integer number of bytes. CRC libraries are usually byte oriented. It is
RECOMMENDED that the concatenation of the complete SCHC Packet and any last fragment padding bits be zero-extended to the next byte boundary and that the RCS be computed on that byte array.
The SCHC F/R messages contain the following fields (see the formats in
Section 8.3):
-
RuleID:
-
this field is present in all the SCHC F/R messages. The Rule identifies:
-
that a SCHC F/R message is being carried, as opposed to an unfragmented SCHC Packet,
-
which SCHC F/R mode is used,
-
in case this mode uses windows, what the value of WINDOW_SIZE is, and
-
what other optional fields are present and what the field sizes are.
The Rule tells apart a non-fragmented SCHC Packet from SCHC Fragments. It will also tell apart SCHC Fragments of fragmented SCHC Packets that use different SCHC F/R modes or different parameters. Therefore, interleaved transmission of these is possible.
All SCHC F/R messages pertaining to the same SCHC Packet MUST bear the same RuleID.
-
Datagram Tag (DTag):
-
This field allows differentiating SCHC F/R messages belonging to different SCHC Packets that may be using the same RuleID simultaneously. Hence, it allows interleaving fragments of a new SCHC Packet with fragments of a previous SCHC Packet under the same RuleID.
The size of the DTag field (called "T", in bits) is defined by each Profile for each RuleID. When T is 0, the DTag field does not appear in the SCHC F/R messages and the DTag value is defined as 0.
When T is 0, there can be no more than one fragmented SCHC Packet in transit for each fragmentation RuleID.
If T is not 0, DTag:
-
MUST be set to the same value for all the SCHC F/R messages related to the same fragmented SCHC Packet, and
-
MUST be set to different values for SCHC F/R messages related to different SCHC Packets that are being fragmented under the same RuleID and whose transmission may overlap.
-
W:
-
The W field is optional. It is only present if windows are used. Its presence and size (called "M", in bits) is defined by each SCHC F/R mode and each Profile for each RuleID.
This field carries information pertaining to the window a SCHC F/R message relates to. If present, W MUST carry the same value for all the SCHC F/R messages related to the same window. Depending on the mode and Profile, W may carry the full window number, or just the LSB or any other partial representation of the window number.
-
Fragment Compressed Number (FCN):
-
The FCN field is present in the SCHC Fragment Header. Its size (called "N", in bits) is defined by each Profile for each RuleID.
This field conveys information about the progress in the sequence of tiles being transmitted by SCHC Fragment messages. For example, it can contain a partial, efficient representation of a larger-sized tile index. The description of the exact use of the FCN field is left to each SCHC F/R mode. However, two values are reserved for special purposes. They help control the SCHC F/R process:
-
The FCN value with all the bits equal to 1 (called "All-1") signals that the very last tile of a SCHC Packet has been transmitted. By extension, if windows are used, the last window of a packet is called the "All-1" window.
-
If windows are used, the FCN value with all the bits equal to 0 (called "All-0") signals the last tile of a window that is not the last one of the SCHC packet. By extension, such a window is called an "All-0 window".
-
Reassembly Check Sequence (RCS):
-
This field only appears in the All-1 SCHC Fragments. Its size (called "U", in bits) is defined by each Profile for each RuleID.
See Section 8.2.3 for the RCS default size, default polynomial and details on RCS computation.
-
C (integrity Check):
-
C is a 1-bit field. This field is used in the SCHC ACK message to report on the reassembled SCHC Packet integrity check (see Section 8.2.3).
A value of 1 tells that the integrity check was performed and is successful. A value of 0 tells that the integrity check was not performed or that it was a failure.
-
Compressed Bitmap:
-
The Compressed Bitmap is used together with windows and Bitmaps (see Section 8.2.2.3). Its presence and size is defined for each SCHC F/R mode for each RuleID.
This field appears in the SCHC ACK message to report on the receiver Bitmap (see Section 8.3.2.1).
This section defines the SCHC Fragment formats, the SCHC ACK format, the SCHC ACK REQ format and the SCHC Abort formats.
A SCHC Fragment conforms to the general format shown in
Figure 12. It comprises a SCHC Fragment Header and a SCHC Fragment Payload. The SCHC Fragment Payload carries one or several tile(s).
+-----------------+-----------------------+~~~~~~~~~~~~~~~~~~~~~
| Fragment Header | Fragment Payload | padding (as needed)
+-----------------+-----------------------+~~~~~~~~~~~~~~~~~~~~~
The Regular SCHC Fragment format is shown in
Figure 13. Regular SCHC Fragments are generally used to carry tiles that are not the last one of a SCHC Packet. The DTag field and the W field are
OPTIONAL, their presence is specified by each mode and Profile.
|-- SCHC Fragment Header ----|
|-- T --|-M-|-- N --|
+-- ... -+- ... -+---+- ... -+--------...-------+~~~~~~~~~~~~~~~~~~~~
| RuleID | DTag | W | FCN | Fragment Payload | padding (as needed)
+-- ... -+- ... -+---+- ... -+--------...-------+~~~~~~~~~~~~~~~~~~~~
The FCN field
MUST NOT contain all bits set to 1.
Profiles
MUST ensure that a SCHC Fragment with FCN equal to 0 (called an "All-0 SCHC Fragment") is distinguishable by size, even in the presence of padding, from a SCHC ACK REQ message (see
Section 8.3.3) with the same RuleID value and with the same T, M, and N values. This condition is met if the Payload is at least the size of an L2 Word. This condition is also met if the SCHC Fragment Header is a multiple of L2 Words.
The All-1 SCHC Fragment format is shown in
Figure 14. The sender uses the All-1 SCHC Fragment format for the message that completes the emission of a fragmented SCHC Packet. The DTag field, the W field, the RCS field and the Payload are
OPTIONAL, their presence is specified by each mode and Profile. At least one of RCS field or Fragment Payload
MUST be present. The FCN field is all ones.
|------- SCHC Fragment Header -------|
|-- T --|-M-|-- N --|-- U --|
+-- ... -+- ... -+---+- ... -+- ... -+-----...-----+~~~~~~~~~~~~~~~~~
| RuleID | DTag | W | 11..1 | RCS | FragPayload | pad. (as needed)
+-- ... -+- ... -+---+- ... -+- ... -+-----...-----+~~~~~~~~~~~~~~~~~
(FCN)
Profiles
MUST ensure that an All-1 SCHC Fragment message is distinguishable by size, even in the presence of padding, from a SCHC Sender-Abort message (see
Section 8.3.4) with the same RuleID value and with the same T, M, and N values. This condition is met if the RCS is present and is at least the size of an L2 Word or if the Payload is present and is at least the size an L2 Word. This condition is also met if the SCHC Sender-Abort Header is a multiple of L2 Words.
The SCHC ACK message is shown in
Figure 15. The DTag field and the W field are
OPTIONAL, their presence is specified by each mode and Profile. The Compressed Bitmap field
MUST be present in SCHC F/R modes that use windows and
MUST NOT be present in other modes.
|--- SCHC ACK Header ----|
|-- T --|-M-| 1 |
+-- ... -+- ... -+---+---+~~~~~~~~~~~~~~~~~~
| RuleID | DTag | W |C=1| padding as needed (success)
+-- ... -+- ... -+---+---+~~~~~~~~~~~~~~~~~~
+-- ... -+- ... -+---+---+------ ... ------+~~~~~~~~~~~~~~~
| RuleID | DTag | W |C=0|Compressed Bitmap| pad. as needed (failure)
+-- ... -+- ... -+---+---+------ ... ------+~~~~~~~~~~~~~~~
The SCHC ACK Header contains a C bit (see
Section 8.2.4).
If the C bit is set to 1 (integrity check successful), no Bitmap is carried.
If the C bit is set to 0 (integrity check not performed or failed) and if windows are used, a Compressed Bitmap for the window referred to by the W field is transmitted as specified in
Section 8.3.2.1.
For transmission, the Compressed Bitmap in the SCHC ACK message is defined by the following algorithm (see
Figure 16 for a follow-along example):
-
Build a temporary SCHC ACK message that contains the Header followed by the original Bitmap (see Section 8.2.2.3 for a description of Bitmaps).
-
Position scissors at the end of the Bitmap, after its last bit.
-
While the bit on the left of the scissors is 1 and belongs to the Bitmap, keep moving left, then stop.
-
Then, while the scissors are not on an L2 Word boundary of the SCHC ACK message and there is a Bitmap bit on the right of the scissors, keep moving right, then stop.
-
At this point, cut and drop off any bits to the right of the scissors.
When one or more bits have effectively been dropped off as a result of the above algorithm, the SCHC ACK message is a multiple of L2 Words; no padding bits will be appended.
Because the SCHC Fragment sender knows the size of the original Bitmap, it can reconstruct the original Bitmap from the Compressed Bitmap received in the SCHC ACK message.
Figure 16 shows an example where L2 Words are actually bytes and where the original Bitmap contains 17 bits, the last 15 of which are all set to 1.
|--- SCHC ACK Header ----|-------- Bitmap --------|
|-- T --|-M-| 1 |
+-- ... -+- ... -+---+---+---------------------------------+
| RuleID | DTag | W |C=0|1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1|
+-- ... -+- ... -+---+---+---------------------------------+
next L2 Word boundary ->|
Figure 17 shows that the last 14 bits are not sent.
|--- SCHC ACK Header ----|CpBmp|
|-- T --|-M-| 1 |
+-- ... -+- ... -+---+---+-----+
| RuleID | DTag | W |C=0|1 0 1|
+-- ... -+- ... -+---+---+-----+
next L2 Word boundary ->|
Figure 18 shows an example of a SCHC ACK with tile indices ranging from 6 down to 0, where the Bitmap indicates that the second and the fourth tile of the window have not been correctly received.
|--- SCHC ACK Header ----|--- Bitmap --|
|-- T --|-M-| 1 |6 5 4 3 2 1 0| (tile #)
+--------+-------+---+---+-------------+
| RuleID | DTag | W |C=0|1 0 1 0 1 1 1| uncompressed Bitmap
+--------+-------+---+---+-------------+
next L2 Word boundary ->|<-- L2 Word --->|
+--------+-------+---+---+-------------+~~~~+
| RuleID | DTag | W |C=0|1 0 1 0 1 1 1|pad.| transmitted SCHC ACK
+--------+-------+---+---+-------------+~~~~+
next L2 Word boundary ->|<-- L2 Word --->|
Figure 19 shows an example of a SCHC ACK with tile indices ranging from 6 down to 0, where integrity check has not been performed or has failed and the Bitmap indicates that there is no missing tile in that window.
|--- SCHC ACK Header ----|--- Bitmap --|
|-- T --|-M-| 1 |6 5 4 3 2 1 0| (tile #)
+--------+-------+---+---+-------------+
| RuleID | DTag | W |C=0|1 1 1 1 1 1 1| with uncompressed Bitmap
+--------+-------+---+---+-------------+
next L2 Word boundary ->|
+-- ... -+- ... -+---+---+-+
| RuleID | DTag | W |C=0|1| transmitted SCHC ACK
+-- ... -+- ... -+---+---+-+
next L2 Word boundary ->|
The SCHC ACK REQ is used by a sender to request a SCHC ACK from the receiver. Its format is shown in
Figure 20. The DTag field and the W field are
OPTIONAL, their presence is specified by each mode and Profile. The FCN field is all zero.
|--- SCHC ACK REQ Header ----|
|-- T --|-M-|-- N --|
+-- ... -+- ... -+---+- ... -+~~~~~~~~~~~~~~~~~~~~~
| RuleID | DTag | W | 0..0 | padding (as needed) (no payload)
+-- ... -+- ... -+---+- ... -+~~~~~~~~~~~~~~~~~~~~~
When a SCHC Fragment sender needs to abort an ongoing fragmented SCHC Packet transmission, it sends a SCHC Sender-Abort message to the SCHC Fragment receiver.
The SCHC Sender-Abort format is shown in
Figure 21. The DTag field and the W field are
OPTIONAL, their presence is specified by each mode and Profile. The FCN field is all ones.
|--- Sender-Abort Header ----|
|-- T --|-M-|-- N --|
+-- ... -+- ... -+---+- ... -+~~~~~~~~~~~~~~~~~~~~~
| RuleID | DTag | W | 11..1 | padding (as needed)
+-- ... -+- ... -+---+- ... -+~~~~~~~~~~~~~~~~~~~~~
If the W field is present:
-
the fragment sender MUST set it to all ones. Other values are RESERVED.
-
the fragment receiver MUST check its value. If the value is different from all ones, the message MUST be ignored.
The SCHC Sender-Abort
MUST NOT be acknowledged.
When a SCHC Fragment receiver needs to abort an ongoing fragmented SCHC Packet transmission, it transmits a SCHC Receiver-Abort message to the SCHC Fragment sender.
The SCHC Receiver-Abort format is shown in
Figure 22. The DTag field and the W field are
OPTIONAL, their presence is specified by each mode and Profile.
|-- Receiver-Abort Header ---|
|--- T ---|-M-| 1 |
+--- ... --+-- ... --+---+---+-+-+-+-+-+-+-+-+-+-+-+
| RuleID | DTag | W |C=1| 1..1| 1..1 |
+--- ... --+-- ... --+---+---+-+-+-+-+-+-+-+-+-+-+-+
next L2 Word boundary ->|<-- L2 Word -->|
If the W field is present:
-
the fragment receiver MUST set it to all ones. Other values are RESERVED.
-
if the value is different from all ones, the fragment sender MUST ignore the message.
The SCHC Receiver-Abort has the same header as a SCHC ACK message. The bits that follow the SCHC Receiver-Abort Header
MUST be as follows:
-
if the Header does not end at an L2 Word boundary, append bits set to 1 as needed to reach the next L2 Word boundary.
-
append exactly one more L2 Word with bits all set to ones.
Such a bit pattern never occurs in a legitimate SCHC ACK. This is how the fragment sender recognizes a SCHC Receiver-Abort.
The SCHC Receiver-Abort
MUST NOT be acknowledged.
This specification includes several SCHC F/R modes that:
-
allow for a range of reliability options, such as optional SCHC Fragment retransmission.
-
support various LPWAN characteristics, such as links with variable MTU or unidirectional links.
More modes may be defined in the future.
Appendix B provides examples of fragmentation sessions based on the modes described hereafter.
Appendix C provides examples of Finite State Machines implementing the SCHC F/R modes described hereafter.
The No-ACK mode has been designed under the assumption that data unit out-of-sequence delivery does not occur between the entity performing fragmentation and the entity performing reassembly. This mode supports L2 technologies that have a variable MTU.
In No-ACK mode, there is no communication from the fragment receiver to the fragment sender. The sender transmits all the SCHC Fragments without expecting any acknowledgement. Therefore, No-ACK does not require bidirectional links: unidirectional links are just fine.
In No-ACK mode, only the All-1 SCHC Fragment is padded as needed. The other SCHC Fragments are intrinsically aligned to L2 Words.
The tile sizes are not required to be uniform. Windows are not used. The Retransmission Timer is not used. The Attempts counter is not used.
Each Profile
MUST specify which RuleID value(s) corresponds to SCHC F/R messages operating in this mode.
The W field
MUST NOT be present in the SCHC F/R messages. SCHC ACK
MUST NOT be sent. SCHC ACK REQ
MUST NOT be sent. SCHC Sender-Abort
MAY be sent. SCHC Receiver-Abort
MUST NOT be sent.
The value of N (size of the FCN field) is
RECOMMENDED to be 1.
Each Profile, for each RuleID value,
MUST define:
-
the size of the DTag field,
-
the size and algorithm for the RCS field, and
-
the expiration time of the Inactivity Timer.
Each Profile, for each RuleID value,
MAY define
-
a value of N different from the recommended one, and
-
the meaning of values sent in the FCN field, for values different from the All-1 value.
For each active pair of RuleID and DTag values, the receiver
MUST maintain an Inactivity Timer. If the receiver is under-resourced to do this, it
MUST silently drop the related messages.
At the beginning of the fragmentation of a new SCHC Packet, the fragment sender
MUST select a RuleID and DTag value pair for this SCHC Packet.
Each SCHC Fragment
MUST contain exactly one tile in its Payload. The tile
MUST be at least the size of an L2 Word. The sender
MUST transmit the SCHC Fragments messages in the order that the tiles appear in the SCHC Packet. Except for the last tile of a SCHC Packet, each tile
MUST be of a size that complements the SCHC Fragment Header so that the SCHC Fragment is a multiple of L2 Words without the need for padding bits. Except for the last one, the SCHC Fragments
MUST use the Regular SCHC Fragment format specified in
Section 8.3.1.1. The SCHC Fragment that carries the last tile
MUST be an All-1 SCHC Fragment, described in
Section 8.3.1.2.
The sender
MAY transmit a SCHC Sender-Abort.
Figure 39 shows an example of a corresponding state machine.
Upon receiving each Regular SCHC Fragment:
-
the receiver MUST reset the Inactivity Timer.
-
the receiver assembles the payloads of the SCHC Fragments.
On receiving an All-1 SCHC Fragment:
-
the receiver MUST append the All-1 SCHC Fragment Payload and the padding bits to the previously received SCHC Fragment Payloads for this SCHC Packet.
-
the receiver MUST perform the integrity check.
-
if integrity checking fails, the receiver MUST drop the reassembled SCHC Packet.
-
the reassembly operation concludes.
On expiration of the Inactivity Timer, the receiver
MUST drop the SCHC Packet being reassembled.
On receiving a SCHC Sender-Abort, the receiver
MAY drop the SCHC Packet being reassembled.
Figure 40 shows an example of a corresponding state machine.
The ACK-Always mode has been designed under the following assumptions:
-
Data unit out-of-sequence delivery does not occur between the entity performing fragmentation and the entity performing reassembly,
-
The L2 MTU value does not change while the fragments of a SCHC Packet are being transmitted, and
-
There is a feedback path from the reassembler to the fragmenter. See Appendix F for a discussion on using ACK-Always mode on quasi-bidirectional links.
In ACK-Always mode, windows are used. An acknowledgement, positive or negative, is transmitted by the fragment receiver to the fragment sender at the end of the transmission of each window of SCHC Fragments.
The tiles are not required to be of uniform size. In ACK-Always mode, only the All-1 SCHC Fragment is padded as needed. The other SCHC Fragments are intrinsically aligned to L2 Words.
Briefly, the algorithm is as follows: after a first blind transmission of all the tiles of a window, the fragment sender iterates retransmitting the tiles that are reported missing until the fragment receiver reports that all the tiles belonging to the window have been correctly received or until too many attempts were made. The fragment sender only advances to the next window of tiles when it has ascertained that all the tiles belonging to the current window have been fully and correctly received. This results in a per-window lock-step behavior between the sender and the receiver.
Each Profile
MUST specify which RuleID value(s) correspond to SCHC F/R messages operating in this mode.
The W field
MUST be present and its size M
MUST be 1 bit.
Each Profile, for each RuleID value,
MUST define:
-
the value of N,
-
the value of WINDOW_SIZE, which MUST be strictly less than 2^N,
-
the size and algorithm for the RCS field,
-
the value of T,
-
the value of MAX_ACK_REQUESTS,
-
the expiration time of the Retransmission Timer, and
-
the expiration time of the Inactivity Timer.
For each active pair of RuleID and DTag values, the sender
MUST maintain:
-
one Attempts counter
-
one Retransmission Timer
For each active pair of RuleID and DTag values, the receiver
MUST maintain
-
one Inactivity Timer, and
-
one Attempts counter.
At the beginning of the fragmentation of a new SCHC Packet, the fragment sender
MUST select a RuleID and DTag value pair for this SCHC Packet.
Each SCHC Fragment
MUST contain exactly one tile in its Payload. All tiles with the index 0, as well as the last tile,
MUST be at least the size of an L2 Word.
In all SCHC Fragment messages, the W field
MUST be filled with the LSB of the window number that the sender is currently processing.
For a SCHC Fragment that carries a tile other than the last one of the SCHC Packet:
-
the Fragment MUST be of the Regular type specified in Section 8.3.1.1.
-
the FCN field MUST contain the tile index.
-
each tile MUST be of a size that complements the SCHC Fragment Header so that the SCHC Fragment is a multiple of L2 Words without the need for padding bits.
The SCHC Fragment that carries the last tile
MUST be an All-1 SCHC Fragment, described in
Section 8.3.1.2.
The fragment sender
MUST start by transmitting the window numbered 0.
All message receptions being discussed in the rest of this section are to be understood as "matching the RuleID and DTag pair being processed", even if not spelled out, for brevity.
The sender starts by a "blind transmission" phase, in which it
MUST transmit all the tiles composing the window, in decreasing tile index order.
Then, it enters a "retransmission phase" in which it
MUST initialize an Attempts counter to 0, it
MUST start a Retransmission Timer and it
MUST await a SCHC ACK.
-
Then, upon receiving a SCHC ACK:
-
if the SCHC ACK indicates that some tiles are missing at the receiver, then the sender MUST transmit all the tiles that have been reported missing, it MUST increment Attempts, it MUST reset the Retransmission Timer, and MUST await the next SCHC ACK.
-
if the current window is not the last one and the SCHC ACK indicates that all tiles were correctly received, the sender MUST stop the Retransmission Timer, it MUST advance to the next fragmentation window, and it MUST start a blind transmission phase as described above.
-
if the current window is the last one and the SCHC ACK indicates that more tiles were received than the sender sent, the fragment sender MUST send a SCHC Sender-Abort, and it MAY exit with an error condition.
-
if the current window is the last one and the SCHC ACK indicates that all tiles were correctly received, yet the integrity check was a failure, the fragment sender MUST send a SCHC Sender-Abort, and it MAY exit with an error condition.
-
if the current window is the last one and the SCHC ACK indicates that integrity checking was successful, the sender exits successfully.
-
on Retransmission Timer expiration:
-
if Attempts is strictly less that MAX_ACK_REQUESTS, the fragment sender MUST send a SCHC ACK REQ and MUST increment the Attempts counter.
-
otherwise, the fragment sender MUST send a SCHC Sender-Abort, and it MAY exit with an error condition.
At any time:
-
on receiving a SCHC Receiver-Abort, the fragment sender MAY exit with an error condition.
-
on receiving a SCHC ACK that bears a W value different from the W value that it currently uses, the fragment sender MUST silently discard and ignore that SCHC ACK.
Figure 41 shows an example of a corresponding state machine.
On receiving a SCHC Fragment with a RuleID and DTag pair not being processed at that time:
-
the receiver SHOULD check if the DTag value has not recently been used for that RuleID value, thereby ensuring that the received SCHC Fragment is not a remnant of a prior fragmented SCHC Packet transmission. The initial value of the Inactivity Timer is the RECOMMENDED lifetime for the DTag value at the receiver. If the SCHC Fragment is determined to be such a remnant, the receiver MAY silently ignore it and discard it.
-
the receiver MUST start a process to assemble a new SCHC Packet with that RuleID and DTag value pair.
-
the receiver MUST start an Inactivity Timer for that RuleID and DTag pair. It MUST initialize an Attempts counter to 0 for that RuleID and DTag pair. It MUST initialize a window counter to 0. If the receiver is under-resourced to do this, it MUST respond to the sender with a SCHC Receiver-Abort.
In the rest of this section, "local W bit" means the least significant bit of the window counter of the receiver.
On reception of any SCHC F/R message for the RuleID and DTag pair being processed, the receiver
MUST reset the Inactivity Timer pertaining to that RuleID and DTag pair.
All message receptions being discussed in the rest of this section are to be understood as "matching the RuleID and DTag pair being processed", even if not spelled out, for brevity.
The receiver
MUST first initialize an empty Bitmap for the first window then enter an "acceptance phase", in which:
-
on receiving a SCHC Fragment or a SCHC ACK REQ, either one having the W bit different from the local W bit, the receiver MUST silently ignore and discard that message.
-
on receiving a SCHC ACK REQ with the W bit equal to the local W bit, the receiver MUST send a SCHC ACK for this window.
-
on receiving a SCHC Fragment with the W bit equal to the local W bit, the receiver MUST assemble the received tile based on the window counter and on the FCN field in the SCHC Fragment, and it MUST update the Bitmap.
-
if the SCHC Fragment received is an All-0 SCHC Fragment, the current window is determined to be a not-last window, the receiver MUST send a SCHC ACK for this window and it MUST enter the "retransmission phase" for this window.
-
if the SCHC Fragment received is an All-1 SCHC Fragment, the current window is determined to be the last window, the padding bits of the All-1 SCHC Fragment MUST be assembled after the received tile, the receiver MUST perform the integrity check and it MUST send a SCHC ACK for this window. Then:
-
If the integrity check indicates that the full SCHC Packet has been correctly reassembled, the receiver MUST enter the "clean-up phase" for this window.
-
If the integrity check indicates that the full SCHC Packet has not been correctly reassembled, the receiver enters the "retransmission phase" for this window.
In the "retransmission phase":
-
if the window is a not-last window:
-
on receiving a SCHC Fragment that is not All-0 or All-1 and that has a W bit different from the local W bit, the receiver MUST increment its window counter and allocate a fresh Bitmap, it MUST assemble the tile received and update the Bitmap, and it MUST enter the "acceptance phase" for that new window.
-
on receiving a SCHC ACK REQ with a W bit different from the local W bit, the receiver MUST increment its window counter and allocate a fresh Bitmap, it MUST send a SCHC ACK for that new window, and it MUST enter the "acceptance phase" for that new window.
-
on receiving a SCHC All-0 Fragment with a W bit different from the local W bit, the receiver MUST increment its window counter and allocate a fresh Bitmap, it MUST assemble the tile received and update the Bitmap, it MUST send a SCHC ACK for that new window, and it MUST stay in the "retransmission phase" for that new window.
-
on receiving a SCHC All-1 Fragment with a W bit different from the local W bit, the receiver MUST increment its window counter and allocate a fresh Bitmap; it MUST assemble the tile received, including the padding bits; it MUST update the Bitmap and perform the integrity check; it MUST send a SCHC ACK for the new window, which is determined to be the last window. Then:
-
If the integrity check indicates that the full SCHC Packet has been correctly reassembled, the receiver MUST enter the "clean-up phase" for that new window.
-
If the integrity check indicates that the full SCHC Packet has not been correctly reassembled, the receiver enters the "retransmission phase" for that new window.
-
on receiving a SCHC Fragment with a W bit equal to the local W bit:
-
if the SCHC Fragment received is an All-1 SCHC Fragment, the receiver MUST silently ignore it and discard it.
-
otherwise, the receiver MUST assemble the tile received and update the Bitmap. If the Bitmap becomes fully populated with 1's or if the SCHC Fragment is an All-0, the receiver MUST send a SCHC ACK for this window.
-
on receiving a SCHC ACK REQ with the W bit equal to the local W bit, the receiver MUST send a SCHC ACK for this window.
-
if the window is the last window:
-
on receiving a SCHC Fragment or a SCHC ACK REQ, either one having a W bit different from the local W bit, the receiver MUST silently ignore and discard that message.
-
on receiving a SCHC ACK REQ with the W bit equal to the local W bit, the receiver MUST send a SCHC ACK for this window.
-
on receiving a SCHC Fragment with a W bit equal to the local W bit:
-
if the SCHC Fragment received is an All-0 SCHC Fragment, the receiver MUST silently ignore it and discard it.
-
otherwise, the receiver MUST update the Bitmap, and it MUST assemble the tile received. If the SCHC Fragment received is an All-1 SCHC Fragment, the receiver MUST assemble the padding bits of the All-1 SCHC Fragment after the received tile, it MUST perform the integrity check and:
-
if the integrity check indicates that the full SCHC Packet has been correctly reassembled, the receiver MUST send a SCHC ACK and it enters the "clean-up phase".
-
if the integrity check indicates that the full SCHC Packet has not been correctly reassembled:
-
if the SCHC Fragment received was an All-1 SCHC Fragment, the receiver MUST send a SCHC ACK for this window.
In the "clean-up phase":
-
On receiving an All-1 SCHC Fragment or a SCHC ACK REQ, either one having the W bit equal to the local W bit, the receiver MUST send a SCHC ACK.
-
Any other SCHC Fragment received MUST be silently ignored and discarded.
At any time, on sending a SCHC ACK, the receiver
MUST increment the Attempts counter.
At any time, on incrementing its window counter, the receiver
MUST reset the Attempts counter.
At any time, on expiration of the Inactivity Timer, on receiving a SCHC Sender-Abort or when Attempts reaches MAX_ACK_REQUESTS, the receiver
MUST send a SCHC Receiver-Abort, and it
MAY exit the receive process for that SCHC Packet.
Figure 42 shows an example of a corresponding state machine.
The ACK-on-Error mode supports L2 technologies that have variable MTU and out-of-order delivery. It requires an L2 that provides a feedback path from the reassembler to the fragmenter. See
Appendix F for a discussion on using ACK-on-Error mode on quasi-bidirectional links.
In ACK-on-Error mode, windows are used.
All tiles except the last one and the penultimate one
MUST be of equal size, hereafter called "regular". The size of the last tile
MUST be smaller than or equal to the regular tile size. Regarding the penultimate tile, a Profile
MUST pick one of the following two options:
-
The penultimate tile size MUST be the regular tile size, or
-
the penultimate tile size MUST be either the regular tile size or the regular tile size minus one L2 Word.
A SCHC Fragment message carries one or several contiguous tiles, which may span multiple windows. A SCHC ACK reports on the reception of exactly one window of tiles.
See
Figure 23 for an example.
+---------------------------------------------...-----------+
| SCHC Packet |
+---------------------------------------------...-----------+
Tile# | 4 | 3 | 2 | 1 | 0 | 4 | 3 | 2 | 1 | 0 | 4 | | 0 | 4 |3|
Window# |-------- 0 --------|-------- 1 --------|- 2 ... 27 -|- 28-|
SCHC Fragment msg |-----------|
The W field is wide enough that it unambiguously represents an absolute window number. The fragment receiver sends SCHC ACKs to the fragment sender about windows for which tiles are missing. No SCHC ACK is sent by the fragment receiver for windows that it knows have been fully received.
The fragment sender retransmits SCHC Fragments for tiles that are reported missing. It can advance to next windows even before it has ascertained that all tiles belonging to previous windows have been correctly received, and it can still later retransmit SCHC Fragments with tiles belonging to previous windows. Therefore, the sender and the receiver may operate in a decoupled fashion. The fragmented SCHC Packet transmission concludes when:
-
integrity checking shows that the fragmented SCHC Packet has been correctly reassembled at the receive end, and this information has been conveyed back to the sender, or
-
too many retransmission attempts were made, or
-
the receiver determines that the transmission of this fragmented SCHC Packet has been inactive for too long.
Each Profile
MUST specify which RuleID value(s) corresponds to SCHC F/R messages operating in this mode.
The W field
MUST be present in the SCHC F/R messages.
Each Profile, for each RuleID value,
MUST define:
-
the tile size (a tile does not need to be multiple of an L2 Word, but it MUST be at least the size of an L2 Word),
-
the value of M,
-
the value of N,
-
the value of WINDOW_SIZE, which MUST be strictly less than 2^N,
-
the size and algorithm for the RCS field,
-
the value of T,
-
the value of MAX_ACK_REQUESTS,
-
the expiration time of the Retransmission Timer,
-
the expiration time of the Inactivity Timer,
-
if the last tile is carried in a Regular SCHC Fragment or an All-1 SCHC Fragment (see Section 8.4.3.1), and
-
if the penultimate tile MAY be one L2 Word smaller than the regular tile size. In this case, the regular tile size MUST be at least twice the L2 Word size.
For each active pair of RuleID and DTag values, the sender
MUST maintain:
-
one Attempts counter, and
-
one Retransmission Timer.
For each active pair of RuleID and DTag values, the receiver
MUST maintain:
-
one Inactivity Timer, and
-
one Attempts counter.
At the beginning of the fragmentation of a new SCHC Packet:
-
the fragment sender MUST select a RuleID and DTag value pair for this SCHC Packet. A Rule MUST NOT be selected if the values of M and WINDOW_SIZE for that Rule are such that the SCHC Packet cannot be fragmented in (2^M) * WINDOW_SIZE tiles or less.
-
the fragment sender MUST initialize the Attempts counter to 0 for that RuleID and DTag value pair.
A Regular SCHC Fragment message carries in its payload one or more tiles. If more than one tile is carried in one Regular SCHC Fragment:
-
the selected tiles MUST be contiguous in the original SCHC Packet, and
-
they MUST be placed in the SCHC Fragment Payload adjacent to one another, in the order they appear in the SCHC Packet, from the start of the SCHC Packet toward its end.
Tiles that are not the last one
MUST be sent in Regular SCHC Fragments specified in
Section 8.3.1.1. The FCN field
MUST contain the tile index of the first tile sent in that SCHC Fragment.
In a Regular SCHC Fragment message, the sender
MUST fill the W field with the window number of the first tile sent in that SCHC Fragment.
A Profile
MUST define if the last tile of a SCHC Packet is sent:
-
in a Regular SCHC Fragment, alone or as part of a multi-tiles Payload,
-
alone in an All-1 SCHC Fragment, or
-
with any of the above two methods.
In an All-1 SCHC Fragment message, the sender
MUST fill the W field with the window number of the last tile of the SCHC Packet.
The fragment sender
MUST send SCHC Fragments such that, all together, they contain all the tiles of the fragmented SCHC Packet.
The fragment sender
MUST send at least one All-1 SCHC Fragment.
In doing the two items above, the sender
MUST ascertain that the receiver will not receive the last tile through both a Regular SCHC Fragment and an All-1 SCHC Fragment.
The fragment sender
MUST listen for SCHC ACK messages after having sent:
-
an All-1 SCHC Fragment, or
-
a SCHC ACK REQ.
A Profile
MAY specify other times at which the fragment sender
MUST listen for SCHC ACK messages. For example, this could be after sending a complete window of tiles.
Each time a fragment sender sends an All-1 SCHC Fragment or a SCHC ACK REQ:
-
it MUST increment the Attempts counter, and
-
it MUST reset the Retransmission Timer.
On Retransmission Timer expiration:
-
if the Attempts counter is strictly less than MAX_ACK_REQUESTS, the fragment sender MUST send either the All-1 SCHC Fragment or a SCHC ACK REQ with the W field corresponding to the last window,
-
otherwise, the fragment sender MUST send a SCHC Sender-Abort, and it MAY exit with an error condition.
All message receptions being discussed in the rest of this section are to be understood as "matching the RuleID and DTag pair being processed", even if not spelled out, for brevity.
On receiving a SCHC ACK:
-
if the W field in the SCHC ACK corresponds to the last window of the SCHC Packet:
-
if the C bit is set, the sender MAY exit successfully.
-
otherwise:
-
if the Profile mandates that the last tile be sent in an All-1 SCHC Fragment:
-
if the SCHC ACK shows no missing tile at the receiver, the sender:
-
MUST send a SCHC Sender-Abort, and
-
MAY exit with an error condition.
-
otherwise:
-
the fragment sender MUST send SCHC Fragment messages containing all the tiles that are reported missing in the SCHC ACK.
-
if the last of these SCHC Fragment messages is not an All-1 SCHC Fragment, then the fragment sender MUST in addition send after it a SCHC ACK REQ with the W field corresponding to the last window.
-
in doing the two items above, the sender MUST ascertain that the receiver will not receive the last tile through both a Regular SCHC Fragment and an All-1 SCHC Fragment.
-
otherwise:
-
if the SCHC ACK shows no missing tile at the receiver, the sender MUST send the All-1 SCHC Fragment
-
otherwise:
-
the fragment sender MUST send SCHC Fragment messages containing all the tiles that are reported missing in the SCHC ACK.
-
the fragment sender MUST then send either the All-1 SCHC Fragment or a SCHC ACK REQ with the W field corresponding to the last window.
-
otherwise, the fragment sender:
-
MUST send SCHC Fragment messages containing the tiles that are reported missing in the SCHC ACK.
-
then, it MAY send a SCHC ACK REQ with the W field corresponding to the last window.
See
Figure 43 for one among several possible examples of a Finite State Machine implementing a sender behavior obeying this specification.
On receiving a SCHC Fragment with a RuleID and DTag pair not being processed at that time:
-
the receiver SHOULD check if the DTag value has not recently been used for that RuleID value, thereby ensuring that the received SCHC Fragment is not a remnant of a prior fragmented SCHC Packet transmission. The initial value of the Inactivity Timer is the RECOMMENDED lifetime for the DTag value at the receiver. If the SCHC Fragment is determined to be such a remnant, the receiver MAY silently ignore it and discard it.
-
the receiver MUST start a process to assemble a new SCHC Packet with that RuleID and DTag value pair. The receiver MUST start an Inactivity Timer for that RuleID and DTag value pair. It MUST initialize an Attempts counter to 0 for that RuleID and DTag value pair. If the receiver is under-resourced to do this, it MUST respond to the sender with a SCHC Receiver-Abort.
On reception of any SCHC F/R message for the RuleID and DTag pair being processed, the receiver
MUST reset the Inactivity Timer pertaining to that RuleID and DTag pair.
All message receptions being discussed in the rest of this section are to be understood as "matching the RuleID and DTag pair being processed", even if not spelled out, for brevity.
On receiving a SCHC Fragment message, the receiver determines what tiles were received, based on the payload length and on the W and FCN fields of the SCHC Fragment.
-
if the FCN is All-1, if a Payload is present, the full SCHC Fragment Payload MUST be assembled including the padding bits. This is because the size of the last tile is not known by the receiver; therefore, padding bits are indistinguishable from the tile data bits, at this stage. They will be removed by the SCHC C/D sublayer. If the size of the SCHC Fragment Payload exceeds or equals the size of one regular tile plus the size of an L2 Word, this SHOULD raise an error flag.
-
otherwise, tiles MUST be assembled based on the a priori known tile size.
-
If allowed by the Profile, the end of the payload MAY contain the last tile, which may be shorter. Padding bits are indistinguishable from the tile data bits, at this stage.
-
The payload may contain the penultimate tile that, if allowed by the Profile, MAY be exactly one L2 Word shorter than the regular tile size.
-
Otherwise, padding bits MUST be discarded. This is possible because:
-
the size of the tiles is known a priori,
-
tiles are larger than an L2 Word, and
-
padding bits are always strictly less than an L2 Word.
On receiving a SCHC ACK REQ or an All-1 SCHC Fragment:
-
if the receiver knows of any windows with missing tiles for the packet being reassembled, it MUST return a SCHC ACK for the lowest-numbered such window:
-
otherwise:
-
if it has received at least one tile, it MUST return a SCHC ACK for the highest-numbered window it currently has tiles for,
-
otherwise, it MUST return a SCHC ACK for window numbered 0.
A Profile
MAY specify other times and circumstances at which a receiver sends a SCHC ACK, and which window the SCHC ACK reports about in these circumstances.
Upon sending a SCHC ACK, the receiver
MUST increase the Attempts counter.
After receiving an All-1 SCHC Fragment, a receiver
MUST check the integrity of the reassembled SCHC Packet at least every time it prepares for sending a SCHC ACK for the last window.
Upon receiving a SCHC Sender-Abort, the receiver
MAY exit with an error condition.
Upon expiration of the Inactivity Timer, the receiver
MUST send a SCHC Receiver-Abort, and it
MAY exit with an error condition.
On the Attempts counter exceeding MAX_ACK_REQUESTS, the receiver
MUST send a SCHC Receiver-Abort, and it
MAY exit with an error condition.
Reassembly of the SCHC Packet concludes when:
-
a Sender-Abort has been received, or
-
the Inactivity Timer has expired, or
-
the Attempts counter has exceeded MAX_ACK_REQUESTS, or
-
at least an All-1 SCHC Fragment has been received and integrity checking of the reassembled SCHC Packet is successful.
See
Figure 44 for one among several possible examples of a Finite State Machine implementing a receiver behavior obeying this specification. The example provided is meant to match the sender Finite State Machine of
Figure 43.