Trouble observing packet loss in 5G mobility simulation with Error Model

129 views
Skip to first unread message

valentina campisi

unread,
May 12, 2025, 7:11:04 AM5/12/25
to ns-3-users

Hello fellow ns-3 developers,

I'm currently working on an ns-3 simulation involving a mobile User Equipment (UE) moving through an environment with four 5G base stations (gNBs). The simulation includes UE mobility, 5G module configuration, IP address assignment, and handover between gNBs. I'm also tracking metrics such as latency and throughput.

However, I'm encountering a persistent issue with introducing and observing packet loss. Despite applying an Error Model, the final statistics always show that all packets are received correctly, with no loss recorded.

I would greatly appreciate any guidance from those with experience in this area. Here are some aspects I’ve been considering so far:

  • Checking the received power at the UE.

  • Verifying the threshold configured to determine an outage or packet loss.

  • Evaluating link budget components (e.g., antenna gain settings).

  • Ensuring the noise configuration (thermal noise and interference) is accurate.

  • Understanding how interference from simultaneously transmitting terminals is modeled.

  • Reviewing the multiple access technique in use.

Any insights or suggestions—whether confirming or challenging these points—would be very helpful. I’m eager to understand what might be going wrong and how to correctly simulate packet loss in this scenario.

Thank you in advance for your time and support!

Best regards,

foreigntresy

valentina campisi

unread,
May 12, 2025, 7:20:20 AM5/12/25
to ns-3-users
attach the source code
5g_ultima_versione.cc

Tommaso Pecorella

unread,
May 12, 2025, 4:48:38 PM5/12/25
to ns-3-users
Next version will be "5g_ultimissima_versione.cc" or what?
For your own mental sanity I'd suggest to use a date versioning format (e.g., "5g_250512.cc") or a proper versioning system (git). The "inverse date" is to simplify the files ordering.

Anyway, I'd place an explicit log into the code to check if the error model works as intended, it should be in nr-net-device.cc at line 225.

Moreover, consider that the error rate is a Byte error rate (not a Bit error rate), just for the sake of the numbers.
However, you should still see dropped packets - but only the ones *received* by the ueNetDevice.Get(0) - the other devices are unaffected, and packets sent by ueNetDevice.Get(0) are unaffected too.

Biljana Bojović

unread,
May 13, 2025, 2:00:45 PM5/13/25
to ns-3-users
Hi Valentina,

Your example looks very good! Great work!

One issue I noticed is that you're trying to configure uplink traffic between the UE and the gNB. For this, you need to include a remote host. You can refer to the first figure in the overall architecture diagram here: https://cttc-lena.gitlab.io/nr/manual/nr-module.html. Also, take a look at the NR examples to see how this is typically done. If you're not trying to set up uplink traffic but instead focusing on downlink, I recommend reviewing the documentation for UdpClientHelper and UdpServerHelper to better understand the client/server roles. Once this part is corrected, you should start to see traffic flowing as expected. 

Additionally, please note that our work on the handover feature is not yet finalized, which is why it hasn’t been advertised or documented yet. In the meantime, you might consider exploring an alternative scenario, perhaps some of those shown in the NR module examples.

Kind regards,
Biljana
Reply all
Reply to author
Forward
0 new messages