Issues in building a LTE model via python bindings

66 views
Skip to first unread message

yang li

unread,
Feb 15, 2024, 5:52:56 AM2/15/24
to ns-3-users
Hello, everyone, I am using NS-3 to simulate my thesis project, the scenario is a LTE communication involving with two UEs (uenodes) and one BS (bsnodes), I followed the instruction from official documentations://www.nsnam.org/docs/models/html/lte-user.html, although it is using C++, but I manage to get them in python.

However, when I tried to execute the program, I am having the errors:
NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0", +0.000000000s -1 file=/home/lfyang/project-racecar/OMNET++/ns-3/ns-allinone-3.40/ns-3.40/src/core/model/type-id.cc, line=459
NS_FATAL, terminating

The code I am using is:


from ns import ns

import sys


#This file should represent the fundamental typology:
#
#There should have two nodes, one is staying in fixed position
#Another one should make some random movement
#
#The channel should be limited at data rate__
#
#






#####Setting BS node x1
bsnodes=ns.network.NodeContainer()

bsnodes.Create(1)


print(bsnodes.Get(0).GetTypeId())

#####Setting UE nodes x2
uenodes=ns.network.NodeContainer()
uenodes.Create(2)

print(uenodes.Get(0).GetTypeId())



# # #this section should be about position

mobility = ns.mobility.MobilityHelper()#This is where my project has to use
mobility.SetPositionAllocator("ns3::GridPositionAllocator", "MinX", ns.core.DoubleValue(0.0),
"MinY", ns.core.DoubleValue (0.0), "DeltaX", ns.core.DoubleValue(5.0), "DeltaY", ns.core.DoubleValue(10.0),
"GridWidth", ns.core.UintegerValue(3), "LayoutType", ns.core.StringValue("RowFirst"))



mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel")
mobility.Install(bsnodes)


mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", "Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle (-50, 50, -50, 50)))
mobility.Install(uenodes)





#The protocol here based on the example is LTE&&#This is the step to connect UEs to BS




lteHelper = ns.lte.LteHelper()
bsDevs = lteHelper.InstallEnbDevice(bsnodes)

ueDevs = lteHelper.InstallUeDevice(uenodes)
lteHelper.Attach(ueDevs, bsDevs.Get(0))
#troutbleshooting




#Data Radio bearer

qci=ns.lte.EpsBearer.GBR_CONV_VOICE

bearer=ns.lte.EpsBearer(qci)

lteHelper.ActivateDataRadioBearer(ueDevs,bearer)


ns.core.Simulator.Stop(ns.core.Seconds(0.005))
ns.core.Simulator.Run()

ns.core.Simulator.Destroy()




I would appreciate if anyone could share the advice since I wish to rely on Python to achieve the simulation process. The python binding is enabled and it works with three nodes just by using p2p and internet stack:

NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0", +0.000000000s -1 file=/home/lfyang/project-racecar/OMNET++/ns-3/ns-allinone-3.40/ns-3.40/src/core/model/type-id.cc, line=459
NS_FATAL, terminating

Gabriel Ferreira

unread,
Feb 15, 2024, 12:28:22 PM2/15/24
to ns-3-users
See your other post. I've answered there.
Reply all
Reply to author
Forward
0 new messages