5G-LENA - RSRP, RSRQ and RSSI measurements

310 views
Skip to first unread message

Daniel Lima

unread,
Oct 16, 2024, 10:11:45 AM10/16/24
to ns-3-users
Hello everybody.

I am trying to read the values of RSRP, RSRQ and RSSI using 5G-LENA.

I saw that there is a connection that can be used, but the program always says that the connection was not established. I am showing the code that I used to try to make the connect.

Config::Connect("/NodeList/2/DeviceList/0/$ns3::NrNetDevice/$ns3::NrUeNetDevice/"
"ComponentCarrierMapUe/*/NrUePhy/ReportUeMeasurements",
MakeBoundCallback(&ReportUeMeasurementsCallback, this));

void
ReportUeMeasurementsCallback(NrUeMeasurementsTestCase* testcase,
std::string path,
uint16_t rnti,
uint16_t cellId,
double rsrp,
double rsrq,
bool servingCell,
uint8_t componentCarrierId)
{
...
}

I am using as basis code the following file:

The fact of the handover is not implemented has some impact on this?
How can I use this connect? Is it ok?

-----
Meanwhile, I was able to read just the RSRP, using the code below:

Simulator::Schedule(Seconds(1.0), &ReportUeMeasurements, nrHelper, ueNetDev.Get(0));

void ReportUeMeasurements(Ptr<NrHelper> nrHelper, Ptr<NetDevice> ueNetDev)
{
    double rsrp = nrHelper->GetUePhy(ueNetDev, 0)->GetRsrp();

    double currentTime = Simulator::Now().GetSeconds();

    std::cout << "Time: " << currentTime << " s, RSRP: " << rsrp << " dBm" << std::endl;

    Simulator::Schedule(Seconds(1.0), &ReportUeMeasurements, nrHelper, ueNetDev);
}

How can I get the measurements of the three mentioned parameters: RSRP, RSRQ and RSSI?

Thank you in advance for your answers.





Gabriel Ferreira

unread,
Oct 16, 2024, 10:45:25 AM10/16/24
to ns-3-users
Hi Daniel,

The measurements are being collected and reported, but they don't mean much as of now.
It is just the initial work to enable handover, but needs to be updated from the LTE range to NR,
validated, etc, etc. I would discourage you from using it.

Regarding not connecting, make sure to use the proper function signature when connecting a callback.
You refer to a test callback, not the actual measurement one.

* Exporting RNTI, the ID of the measured cell, RSRP (in dBm), RSRQ (in dB),
* and whether the cell is the serving cell. Moreover it report the m_componentCarrierId.
*/
TracedCallback<uint16_t, uint16_t, double, double, bool, uint8_t> m_reportUeMeasurements;

The RSSI can be obtained with something like the following


void
UeRssiPerProcessedChunk(Ptr<SpectrumPhy> phy, double rssidBm)
{
std::cout << phy << " rssi " << rssidBm << std::endl;
}

Ptr<NrInterference> ueSpectrumPhyInterference = ueSpectrumPhy->GetNrInterference();
ueSpectrumPhyInterference->TraceConnectWithoutContext("RssiPerProcessedChunk", MakeBoundCallback(&UeRssiPerProcessedChunkTrace, ueSpectrumPhy));

Daniel Lima

unread,
Oct 18, 2024, 10:54:48 AM10/18/24
to ns-3-...@googlegroups.com
Hello Gabriel. Thanks for your fast reply.

Using your tips I was able to connect to UeRssiPerProcessedChunk.

But, I was not able to connect to ReportUeMeasurements.
I have tried 3 ways:

Config::Connect("/NodeList/*/DeviceList/0/$ns3::NrNetDevice/$ns3::NrUeNetDevice/"
"ComponentCarrierMapUe/*/NrUePhy/ReportUeMeasurements",
MakeBoundCallback(&ReportUeMeasurements2));

First:
void ReportUeMeasurements2(uint16_t rnti, uint16_t cellId, double
rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)

Second:
void ReportUeMeasurements2(uint16_t rnti, uint16_t cellId, double
rsrp, double rsrq, bool servingCell)

Third:
void ReportUeMeasurements2(std::string path, uint16_t rnti, uint16_t
cellId, double rsrp, double rsrq, bool servingCell, uint8_t
componentCarrierId)

All of them produce the same error message:
msg="Could not connect callback to
/NodeList/*/DeviceList/0/$ns3::NrNetDevice/$ns3::NrUeNetDevice/ComponentCarrierMapUe/*/NrUePhy/ReportUeMeasurements",
+
0.000000000s

Can you provide a correct interface for it?



Em qua., 16 de out. de 2024 às 11:45, Gabriel Ferreira
<gabriel...@gmail.com> escreveu:
> --
> Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/a054dbed-6c9f-48a2-a043-5bcf3aba1a0bn%40googlegroups.com.



--
Daniel S. Lima
Mestre em Ciência da Computação - UECE
Graduado em Ciência da Computação - UECE
Graduado em Engenharia da Computação - IFCE
Analista IV na Funceme
Lattes: http://lattes.cnpq.br/5895603879585668

"Bem-aventurado o homem que me dá ouvidos, velando dia a dia às minhas
portas, esperando às ombreiras da minha entrada."
Provérbios 8:34

Gabriel Ferreira

unread,
Oct 18, 2024, 12:13:03 PM10/18/24
to ns-3-users
void ReportUeMeasurements2(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId);
Config::ConnectWithoutContext("/NodeList/*/DeviceList/0/$ns3::NrNetDevice/$ns3::NrUeNetDevice/ComponentCarrierMapUe/*/NrUePhy/ReportUeMeasurements", MakeCallback(&ReportUeMeasurements2));

Should work just fine.
Only use MakeBoundCallback when passing arguments to the function. 
And the initial string parameter is the context passed along when connected via Config::Connect().

Daniel Lima

unread,
Oct 18, 2024, 12:41:42 PM10/18/24
to ns-3-...@googlegroups.com
Hello Gabriel. I tested the code that you mentioned, but it shows
connection errors:

I am sending the image attached.

msg="Could not connect callback to
/NodeList/*/DeviceList/0/$ns3::NrNetDevice/$ns3::NrUeNetDevice/ComponentCarrierMapUe/*/NrUePhy/ReportUeMea
surements", +0.000000000s -1
file=/home/daniel.sucupira/centralGitPersonal2/ns-3-dev/src/core/model/config.cc,
line=955
NS_FATAL, terminating
terminate called without an active exception
Command 'build/debug/scratch/rem/ns3-dev-rem-rsrp-rsqr-debug
--scenario_id=6' died with <Signals.SIGABRT: 6>.

Em sex., 18 de out. de 2024 às 13:13, Gabriel Ferreira
<gabriel...@gmail.com> escreveu:
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/1e52c1df-6856-456c-af43-6c8b55183d5cn%40googlegroups.com.
image.png
image.png
image.png

Gabriel Ferreira

unread,
Oct 19, 2024, 7:06:55 AM10/19/24
to ns-3-users
It works just fine. Try to set it up right before calling Simulator::Run().

Daniel Lima

unread,
Oct 22, 2024, 5:00:50 PM10/22/24
to ns-3-users
Hello Gabriel.
The connect command is, as you asked, right before calling Simulator::Run().

// Config::Connect(
Config::ConnectFailSafe(
"/NodeList/*/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
MakeBoundCallback(&ReportUeMeasurements2));

Simulator::Run();
Simulator::Destroy();

But, the connect is not working.

Looking at another emails, i saw this thread:

It teaches to save a file with the scenario config parameters. I used the following config:
// Output config store to txt format
Config::SetDefault ("ns3::ConfigStore::Filename", StringValue ("output-attributes.txt"));
Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText"));
Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Save"));
ConfigStore outputConfig2;
outputConfig2.ConfigureDefaults ();
outputConfig2.ConfigureAttributes ();


Then, it produced the file output-attributes.txt, that has the nodes config (I am sending it attached).
Looking at this file, do you identify some bad config or missing part?

print.png
output-attributes.txt

Daniel Lima

unread,
Oct 22, 2024, 5:05:39 PM10/22/24
to ns-3-...@googlegroups.com
Posting the connect that is being used:

image.png


Gabriel Ferreira

unread,
Oct 23, 2024, 2:00:21 PM10/23/24
to ns-3-users
Tested on cttc-nr-demo


void ReportUeMeasurements2(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)
{
std::cout << rnti << " " << cellId << " " << rsrp << " " << rsrq << " " << servingCell << " " << std::to_string(componentCarrierId) << std::endl;
}

int main(){
...
Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/NrUePhy/ReportUeMeasurements",
MakeCallback(&ReportUeMeasurements2));
Simulator::Stop(simTime);
Simulator::Run();
...
}

Output

$ ./ns3 run cttc-nr-demo --no-build
1 1 -62.7318 0 1 0
1 2 -68.6501 0 1 1
2 1 -61.2852 0 1 0
2 2 -68.9556 0 1 1
1 1 -62.734 0 1 0
1 2 -68.6501 0 1 1
2 1 -61.2846 0 1 0
2 2 -68.9556 0 1 1
1 1 -3956.04 0 1 0
1 2 -1886.69 0 1 1
2 1 -3864.64 0 1 0
2 2 -1895.09 0 1 1
1 1 -4077.71 0 1 0
1 2 -1716.25 0 1 1
2 1 -3983.5 0 1 0
2 2 -1723.89 0 1 1
Flow 1 (1.0.0.2:49153 -> 7.0.0.2:1234) proto UDP
  Tx Packets: 6000
  Tx Bytes:   768000
  TxOffered:  10.240000 Mbps
  Rx Bytes:   767744
  Throughput: 10.236587 Mbps
  Mean delay:  0.276044 ms
  Mean jitter:  0.030032 ms
  Rx Packets: 5998
Flow 2 (1.0.0.2:49154 -> 7.0.0.3:1235) proto UDP
  Tx Packets: 6000
  Tx Bytes:   7680000
  TxOffered:  102.400000 Mbps
  Rx Bytes:   7667200
  Throughput: 102.229333 Mbps
  Mean delay:  0.900967 ms
  Mean jitter:  0.119907 ms
  Rx Packets: 5990


  Mean flow throughput: 56.232960
  Mean flow delay: 0.588505

Process finished with exit code 0

Gabriel Ferreira

unread,
Oct 23, 2024, 2:03:27 PM10/23/24
to ns-3-users
I actually forgot $ns3::NrUeNetDevice in the path, but works anyways. Wizardry from Peter and other core developers.

Daniel Lima

unread,
Oct 23, 2024, 6:48:58 PM10/23/24
to ns-3-...@googlegroups.com
Thank you very much Gabriel. Following your tips I was able to reproduce the connect. :)

That function gives, in the UE side, the rsrp and rsrq, of the signal that the ue receives from the gnb that the ue is connected to.

I would like to get this values also of the others gnb that the UE can connect, by the UE side.
I saw that there is a connect that makes it, by the ENB side.

Config::Connect("/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
MakeBoundCallback(&RecvMeasurementReportCallback, this));

void
LteUeMeasurementsTestCase::RecvMeasurementReport(uint64_t imsi,
uint16_t cellId,
uint16_t rnti,
LteRrcSap::MeasurementReport meas)

How can I obtain this values in the UE side? There is a connect to achieve this?



Daniel Lima

unread,
Oct 24, 2024, 2:09:57 PM10/24/24
to ns-3-...@googlegroups.com
I have seen how to obtain the connect to read the data in the gnb side. I am sharing it here, in case someone needs it.

image.png
image.png

I would like to know how to read this data on the UE side.
For instance:
- which UE part triggers the send of the message?
- exists an interface to read this data in the ue side or it is hidden in the layers?



Reply all
Reply to author
Forward
0 new messages