This commit introduces several enhancements in X2AP and RRC to deal
with ENDC. The main goal is to deal with UE's on/off and with various
errors.
The following work is included:
- DC prep and DC overall X2 timers
- X2 messages for UE release and DC timers' timeout
Open problems:
- what to do when the UE sends an scg Failure? This commit removes
the UE. And this removal may not be correctly done
- UE removal in the gNB's PHY layer (a next commit is coming,
but it is hackish and will need a rework)
RLC has timers. We need to keep track of time. We chose to not use
realtime but 'processing time'. That is we send a tick to RLC for every
subframe when it is processed by the softmodem. Before this commit we
used to increase time in the function mac_rlc_status_ind which is called
for every subframe in the eNB, but not in the gNB (at least not in the
current gNB). So we need another way to keep track of time.
The function gNB_dlsch_ulsch_scheduler is called for every slot. It seems
to be the perfect candidate to send a tick to RLC for every subframe. We
take care of subcarrier spacing to send every subframe (one subframe is
always 1ms), not every slot (slot duration depends on subcarrier spacing).
It may not be the best solution. To be revised if needed.
Note: the UE has not been fixed. Some modification is needed for the UE
too, most probably.
c_SRS was 61, which does not fit for 106 PRBs as it seems. Value 0 works.
Maybe not the right thing to do though (see 38.211 6.4.1.4.3,
table 6.4.1.4.3-1).
Also it seems necessary to pass desired LTE/NR bands when requesting
LTE UE capabilities. Today this is hardcoded, to be done better at
some point. We should get the bands from the eNB configuration and
the eNB/gNB X2 exchanges.
c_SRS was 61, which does not fit for 106 PRBs as it seems. Value 0 works.
Maybe not the right thing to do though (see 38.211 6.4.1.4.3,
table 6.4.1.4.3-1).
Also it seems necessary to pass desired LTE/NR bands when requesting
LTE UE capabilities. Today this is hardcoded, to be done better at
some point. We should get the bands from the eNB configuration and
the eNB/gNB X2 exchanges.
When running the softmodem, we get the error:
fill_ulsch UE_id 0 nb_rb = 0
The code has changed some time ago and this log was left but is not
meaningful anymore.
hack: in schedule_ue_spec, 3 bytes are "reserved" (this should be
done better). An RLC AM entity may ask for only 2 bytes for
ACKing and get a TBS of 32 bits and due to these 3 reserved bytes we may
end up with only 1 byte left for RLC, which is not enough. This hack
prevents the problem. To be done better at some point. If the function
schedule_ue_spec is (has been) reworked, this hack can be removed.
Dig for "TBS - ta_len - header_length_total - sdu_length_total - 3"
in schedule_ue_spec.
This should be done better at some point.
Minor fixes, doesn't change anything. Not sure these are 'bugs' either,
but let's be polite with coverity scan...
One thing was not changed.
Coverity scan says:
*** CID 357991: Memory - illegal accesses (USE_AFTER_FREE)
/home/carabe/raphael/openairinterface5g/openair2/LAYER2/rlc_v2/rlc_entity_am.c: 507 in tx_list_remove_sn()
501 } else {
502 prev = cur;
503 cur = cur->next;
504 }
505 }
506
>>> CID 357991: Memory - illegal accesses (USE_AFTER_FREE)
>>> Using freed pointer "head.next".
507 return head.next;
508 }
509
510 void cleanup_sdu_list(rlc_entity_am_t *entity)
511 {
512 rlc_sdu_t head;
But as far as I understand, there is no problem. We don't access
head.next at all if it has been freed. Or is there some aliasing
going on there (pointer aliasing)? I doubt it. False positive?
Not sure if the problem is in the MAC layer or in the RLC v2 layer.
Maybe the buffer status reporting in RLC v2 is not good. Let's remove
two AssertFatal in the MAC for the time being.
Limitation: this fix only works if there is only one eNB,
because we force module_id = 0 in the function deliver_sdu where
(as the code is today) we have no way to know which module_id is
concerned. More generally, the rlc v2 does not work with more than
1 eNB.
The old method was wrong.
The new method is better, but not accurate, especially when the
TX buffer contains SDU of size > 2047 bytes.
Plus it's probably too slow.
To be refined at some point.
This commit introduces an alternative RLC implementation
based on 36.322 version 8. AM and UM done, TM not done.
See openair2/LAYER2/rlc_v2/TODO for missing parts.
Seems like the UEs in the CI don't like when asked to report NR UE
capabilities. So let's first ask for eutra capabilities and then
dig into them to check for en-dc support and only then ask for
NR capabilities. We chose to ask for NR capabilities after receiving
RRCConnectionReconfigurationComplete. That may not be the best thing
to do.
Today, we do nothing with those capabilities. We could completely skip
asking them to the UE, but since the code is there and since it may be
useful in the future, let's do it. Hopefully, it should not hurt too much.
An NR-capable UE will transmit some NR measurements.
Once received, the whole process on nr-cell addition is started.
It will fail quickly.
Many things are still missing.
What is not handled properly with this commit:
- in x2ap_eNB_handle_sgNB_add_req we hardcode the gNB ID
- nr triggering is done if we receive a measurement but this measurement is
not analyzed at all
- no timers (T_dc_overall, T_dc_prep) and as is the code fails and then the
next triggering after UE reconnection will not work (x2 ID are not well
handled here and there in the code)
Note also that the gNB part has not been looked at all for this commit.
This is work in progress...
In TDD mode, CQI requests are not possible in special subframes (at
least for some TDD configurations, see 36.213 7.2.3 that says "a
DL subframe is valid if it does not contain a DwPTS field if the
length is less than 7680 Ts").
In the code, we simply disable CQI requests in special subframes,
no matter what the length of DwPTS.
A problem can arise if the DCI0 for a given UE are sent only in
those special subframes. In this case the UE will never report
CQI and the eNB will use low MCS for this UE, impacting performances.
Another, related, problem is when there are several UEs. There again
one UE might always get its DCI0 in special subframes and thus never
report CQI. There again, performance issues.
This commit is an attempt to improve the situation.
It does two things.
1 - tag the UE as schedulable in the function UE_is_to_be_scheduled
if the cqi_req_timer is expired
2 - use cqi_req_timer as a criterium when ordering UEs for UL scheduling
The value chosen for the expiration of the cqi_req_timer in
UE_is_to_be_scheduled is quite high (300) because as the code is
today we may overschedule the UE for short bursts until we receive
a CQI from the UE. [TODO: fix the code properly to avoid this behavior.]
Note: the fairRR scheduler has not been analyzed and this commit may
not fix anything in case the fairRR scheduler is used.
- send RRC Connection Reconfiguration with dummy ENDC data by doing:
telnet localhost 9001
and press enter when the ENDC UE is connected to the eNB to send it
For whatever reason, ru->frame_parms was NULL and the RRU crashed.
Let's allocated memory.
Also, don't do fp = ru->frame_parms in ru_thread, it seems that it
takes the value before allocation (so: NULL) and the code crashes
later on.
Maybe it's not the correct solution. To be refined at some point.
The 5G phone OPPO has a very big UE capability (> 2KB).
We need bigger buffers to transfer this, especially in x2 handover.
Also the sctp messages need a bigger buffer.
Note: in sctp, we didn't check for partial messages, it's now
done. When detected, we exit. To be redone differently
if needed. (Look for "if (!(flags & MSG_EOR))".)
This used to be done to ease power estimation in the UE,
but this is not correct. Let's put no energy in the REs
with no DCI data, which is what needs to be done.
Plus it consumes a lot of CPU because of calling taus()
way too much.
To be used when you send data to another host.
On the other host, to avoid ICMP traffic about the port
not being open, do:
./nc -l -u -p 9999 > /dev/null
You need to restart this command each time you run macpdu2wireshark.
You can use any other program that will accept UDP packets on the
port 9999 (default port of macpdu2wireshark, change if you use another
port of course).
Some computation has been fixed in PUCCH reception.
SNR has been fixed, uses measurement instead of
a fixed value for the noise.
normalized_rx_power and target_rx_power have been removed,
replaced by snr and target_snr. All the files using those
variables have been updated.
The value was set to 20 which means -120 dB. Setting this value means
that the UE reports an event only if the RSRP of the serving cell
is lower than -120 dB.
In the lab, we get values of around -70, and to go as low as -120
means a very degraded environment. This is not practical.
Let's disactivate the setting of this parameter for the moment so that
the UE reports an event without taking into consideration the RSRP
of the serving cell.
With this hotfix, the X2 handover works much better.