Bug 2152

Summary: Uplink HARQ retransmissions out of synch at the MAC layer
Product: ns-3 Reporter: rouil
Component: lteAssignee: Marco Miozzo <mmiozzo>
Status: RESOLVED FIXED    
Severity: normal CC: bbojovic, ns-bugs
Priority: P5    
Version: ns-3.23   
Hardware: All   
OS: All   
Attachments: Test scenario
Patch to maintain process synchronization in uplink

Description rouil 2015-07-08 15:34:08 UTC
Under certain situations, an uplink HARQ retransmission is missed/erroneous because the HARQ process ID has changed between the transmission and the retransmission of packet bursts.

When a UE receives an allocation, the MAC saves a copy of the PDUs in the current HARQ process ID (lte-ue-mac:287) identified by the variable m_harqProcessId. When an HARQ retransmission occurs (lte-ue-mac:709), the variable m_harqProcessId is used to retrieve the packets to retransmit. If the UE receives more packets from the upper layers between the transmission and the retransmission, a report buffer status is called (lte-ue-mac:301). In turn, this causes the m_harqProcessId to be increased at the next subframe (lte-ue-mac:786).
When the UE retrieves the packets to retransmit, it has lost the correct HARQ process ID. The result is that the retransmissions do not occur or the wrong packets are transmitted.
Comment 1 rouil 2015-07-08 15:40:34 UTC
Created attachment 2090 [details]
Test scenario

To run the test, it is also necessary to modify the lte-spectrum-phy.cc to force packet corruption by modifying the function EndRxData at line 972 to:
 (*itTb).second.corrupt = true;

By calling the script as follows
./waf --run "harq-test --interPacketInterval=9 --maxPackets=2"

The following output is generated 

% time  cellId  IMSI    RNTI    layer   mcs     size    rv      ndi     correct
112     1       1       1       0       28      2292    0       1       0
120     1       1       1       0       28      2292    0       1       0
127     1       1       1       0       28      2292    1       0       0
134     1       1       1       0       28      2292    1       0       0
141     1       1       1       0       28      2292    1       0       0

Based on the HARQ retransmission timing, there should have been a retransmission at time 119 (7m after the first transmission). However, because a second packet was received from upper layers, the HARQ process ID had changed and the packet was not found.
Comment 2 rouil 2015-08-13 10:49:49 UTC
Created attachment 2116 [details]
Patch to maintain process synchronization in uplink

The patch makes the increment of the harq process ID occur every subframe.

% time	cellId	IMSI	RNTI	layer	mcs	size	rv	ndi	correct
112	1	1	1	0	28	2292	0	1	0
119	1	1	1	0	28	2292	1	0	0
120	1	1	1	0	28	2292	0	1	0
126	1	1	1	0	28	2292	1	0	0
127	1	1	1	0	28	2292	1	0	0
133	1	1	1	0	28	2292	1	0	0
134	1	1	1	0	28	2292	1	0	0
141	1	1	1	0	28	2292	1	0	0
Comment 3 Marco Miozzo 2017-11-09 07:40:36 UTC
The patch is fine with me, the HARQ process Id has to be updated each subframe in order to maintain the synchronization.
Comment 4 Biljana Bojović 2017-11-16 13:23:06 UTC
Pushed to changeset 13177:175ba8bb79c0.