RLC header not included into BSR
The standard says we should not include RLC header into BSR. The code doesn't handle that properly. When calling mac_rlc_status_ind
we include the RLC header in the reported buffer size, so the according BSR includes the RLC header. But if there is segmentation, the size of remaining buffer for a given LCID doesn't include the RLC header anymore since we just do:
lc_info->LCID_buffer_remain -= sdu_length;
In any case, the gNB seems not to accommodate enough resources to include the RLC header in the following trasmission as shown in this example for RRCSetupComplete message. This leads to an increase in latency since the UE needs 1 ULSCH allocation more to send the full messsage.
[NR_MAC] [UE 0] PDCCH Tick : LCID 1 LCGID 0 has data to transmit 46 bytes at frame 971 slot 17
[NR_MAC] [UE 0] MAC BSR Triggered LCID 1 LCGID 0 data become available at frame 971 slot 17
[NR_MAC] [UE 0] [971.17] process UL transport block at with size TBS = 24 bytes
[NR_MAC] [UE 0] [971.17] UL-DXCH -> ULSCH, RLC with LCID 0x01 (TBS 24 bytes, sdu_length_total 0 bytes, MAC header len 2 bytes,buflen_remain 19 bytes)
[NR_MAC] [UE 0] [971.17] lcp round = 0, remaining mac pdu length = 19, lcid buffer remaining = 46, lcid = 1
[NR_MAC] number of bytes requested for lcid 1 is 19
[NR_MAC] decrement Bj of the lcid 1 by size of sdu length = 19 and new Bj for lcid 1 is 2147483628
[NR_MAC] [UE 0] Frame 971 subframe 17 BSR Trig=3 report SHORT BSR with level 4 for LCGID 0
[NR_MAC] [UE 0] 971.17 MAC BSR type 3 Sent!! bsr (ce1,hdr1) buff_len 24
[NR_MAC] [UE 0] PDCCH Tick : LCID 1 LCGID 0 has data to transmit 31 bytes at frame 971 slot 18
In this example the UE reports a BSR for <=28 bytes since it has to transmit 27 more after the 19 sent together with the BSR, but that is not enough if we consider the 4 bytes necessary for the RLC header.