Subject: [lp-wan] Ack on error with fragment count when ambiguous window

From: Edgar Ramos <[email-masked]>
Date: Tue, 18 Sep 2018 15:08:22 +0000

Hi all,

I have given more thoughts to the idea of using an absolute counter for  IP fragments and I think the loss of synchronization can be solve without a noticeable increase of overhead and following the majority of the current mechanisms.
The differences with the current mechanism would be:
     1. Receiver do not ignore packets from the next windows to the one with the initial packets lost.
    2. Introduction of a new ACK message that would include the absolute fragment counter of the last received packet in sequence and the window of the packet (ACK-cnt)
        a. Optionally, it could be appended the bitmap of the window also (if can be handled by the technology)
    3. ACK-cnt is sent when the Rx detects a window ambiguity (window wrap around for more fragments)
    4. If transmitter receives a ACK-cnt then it will retransmit the next fragment and the following ones to the end of the window if not bitmap is received . If bitmap is present, then the fragments indicated are retransmitted.
        a. Receiver must reply to a retransmission with an ACK for the window (either with a ALL_ACK, a bitmap, or a ACK-cnt if still ambiguity exist )
    5. The transmitter may abort the fragment transmission if not possible to recover (fragment not available for retransmission)

In my opinion , it is possible to solve the window ambiguity quite easy with this additions. It would also mean that the implementations that are more lazy and discover ambiguities can just send an abort, also depending of the memory that the device has available to store fragments. The only addition is the introduction of the ACK-cnt signal for the ambiguous cases mapped to a ruleid, which can be something like:

   +---- ... --+- ... -+-+-----+
   |  Rule ID  |  DTag |W| CNT | (no payload)
   +---- ... --+- ... -+-+-----+

   or

   +---- ... --+- ... -+-+-----+---- ... -----+
   |  Rule ID  |  DTag |W| CNT |encoded Bitmap| (no payload)
   +---- ... --+- ... -+-+-----+---- ... -----+

I analyzed some cases of how it would work, and I didn't notice any particular big impact in how many downlink transmissions are been used, specially comparing to a hard reset after an abort.

Let me know what do you think, is it still a solution to consider?

The first case is when the last fragment of a window is lost but the transmission window still do not wrap-around.
(It is basically following the same old algorithm, but without ignoring next window packets)
           CNT                  CNT
 W         Tx+               ++ Rx
+----+     1 +--------------->  1
|    |       |               |
| 0  |     2 +--------------->  2
|    |       |               |
+----+     3 +-------->X     |
             |               |
+----+     4 +--------------->  4
|    |       |               |
| 1  |     5 +--------------->  5
|    |       |               |
+----+     6 +--------------->  6
             |               |
+    +       |               |
|    |       <-+ACK-W0(bitmap|
|    |       |               |
|    |     3 +--------------->
|    |       |  ACK|all(W0)  |
|    |       <---------------+
+    +       |               |

+----+     7 +-------------->   7
|    |       |               |
| 0  |       |               |
|    |       |               |
+----+       |               |
             +               +

The next case is when the ack is lost. Similarly than previously here,  it start trying to recover only with bitmap, but when the window ambiguity is detected by the receiver, then the ACK with the absolute count and the window is transmitted.
In this example, the bitmap is not attached to the fragment count, then the rest of the window is retransmitted.

           CNT                  CNT
 W         Tx+               ++ Rx
+----+     1 +-------->X-    |  1
| 0  |     2 +--------------->  2
+----+     3 +-------------->+  3
             |  ACK|W0(bitmap|
             |    X^----------+
             |               |
+----+     4 +--------------->  4
| 1  |     5 +--------------->  5
+----+     6 +--------------->  6
             |               |
             |   ACK|W0(bitmap)
             <    X<---------+
             |               |
+----+     7 +--------------->  7
|    |       | ACK|CNT(W0|0) |
| 0  |       <---------------+
+----+                       |
|    |     1 +--------------->  1
|    |     2 +--------------->  2
+    ++    3 +--------------->  3
             |               |
             |               |
             |ACK-all(W0)    |
             <---------------+ (last fragment
             |               |  of packet ack)
             +               +

If the bitmap is also added to the ACK with the count then only the indicated fragments are retransmitted for that window

           CNT                  CNT
 W         Tx+               ++ Rx
+----+     1 +-------->X-    |  1
| 0  |     2 +--------------->  2
+----+     3 +-------------->+  3
             |  ACK|W0(bitmap|
             |    X^----------+
             |               |
+----+     4 +--------------->  4
| 1  |     5 +--------------->  5
+----+     6 +--------------->  6
             |               |
             |   ACK|W0(bitmap)
             <    X<---------+
             |               |
+----+     7 +--------------->  7
|    |       | ACK|CNT(W0|0| bitmap)
| 0  |       <---------------+
+----+                       |
|    |     1 +--------------->  1
|    |       |               |
|    |       |ACK-all(W0)    |
|    |       <---------------+ (last fragment
+    ++      |               |  of packet ack)
             +               +

Finally , in a multiple loss scenario (assuming bitmap in the ACK-cnt):

           CNT                  CNT
 W         Tx+               +  Rx
+----+     1 +-------->X-    |  1
|    |       |               |
| 0  |     2 +--------------->  2
|    |       |               |
+----+     3 +-------------->+  3
             |  ACK|W0(bitmap|
             |    X<----------+
             |               |
+----+     4 +------->X-     |
|    |       |               |
| 1  |     5 +--------------->  5
|    |       |               |
+----+     6 +-------->X     |
             |               +
             |   ACK|W0(bitmap)
             |    X<---------+
+----+       |               |
|    |     7 +------>X       |  7
|  0 |     8 +----------------> 8
+----+       |               +
             | ACK|CNT(W0|0| bitmap)
             <---------------+
             |               |
        RTX  |               |                                                                                                                     )
           1 +--------------->  1
             |ACK|W1 (bitmap)|
             <---------------+
        RTX  |               |
           4 +---------------+  4
           6 +--------------->  6
             |               |
             |ACK|W0 (bitmap)|
             <---------------+
             |               |
         RTX |               |
           7 +--------------->  7
             | ACK|all(W0)   |
             <---------------+
             +               +

Best Regards

Edgar R