Hi~ guys when I use NS3 to simulate the performance of scheduler algorithm of LTE system , I found that the DlRxPDU is more than the DlTxPDU as report in the file "DlRlcStats.txt", as following blow.
I saw some previous posts said the same problem, finally it was defined as a bug and it was reported to the NS3 Team. As the report said, this bug has been fixed.
post:
https://groups.google.com/forum/?fromgroups=#!topic/ns-3-users/mObbn4aD0vk bug report:
https://www.nsnam.org/bugzilla/show_bug.cgi?id=1630 The version of ns3 I used is 3.21. I didn't modify anything about the data trace. what I did is some modification about the process of scheduling
radio resource for HARQ retrasmission in MAC Layer( pf-ff-mac-scheduler.cc ). My codes have no error and my
script ran formally.
I wonder how it could happen. Any comment is appreciated~
% start end CellId IMSI RNTI LCID nTxPDUs TxBytes nRxPDUs RxBytes delay stdDev min max PduSize stdDev min max
0 3 1 1 4 3
1347 512470
1356 520131 0.00530457 0.00330751 0.003 0.012 383.577 250.379 81 2052
0 3 1 2 13 3
1022 354768
1389 505583 0.00960691 0.00276054 0.003 0.024 363.991 217.902 75 1095
0 3 1 3 2 3
1016 237656
1210 302052 0.00952727 0.00304523 0.003 0.018 249.63 150.527 47 775
0 3 1 4 16 3
1011 185332
1094 201833 0.00921755 0.00369444 0.003 0.024 184.491 116.988 32 775
0 3 1 5 1 3 932 152265 929 150791 0.00993649 0.00337927 0.003 0.024 162.315 105.46 22 621
0 3 1 6 24 3 909 126253 764 108795 0.00960864 0.0036602 0.003 0.024 142.402 90.9744 22 517
0 3 1 7 23 3 913 102571 742 84681 0.00951078 0.00355208 0.003 0.024 114.125 72.0141 22 453
0 3 1 8 21 3 940 88222 756 63232 0.00955026 0.00412023 0.003 0.024 83.6402 53.2919 22 317
0 3 1 9 22 3 919 78818 808 69829 0.00955569 0.00359703 0.003 0.024 86.422 58.7811 9 277
0 3 1 10 15 3 901 68331 882 66276 0.00961451 0.00347766 0.003 0.024 75.1429 48.8956 15 389
0 3 1 11 14 3 902 59817 862 60280 0.00982018 0.00378872 0.003 0.024 69.9304 44.9158 15 277
0 3 1 12 3 3 870 51156 792 48285 0.00947475 0.0033087 0.003 0.018 60.9659 41.7822 9 317
My script :
using namespace ns3 ;
int main(int argc, char *argv[])
{
uint16_t m_nmUser = 12;
uint16_t m_dist = 1800;
double speed = 10 ;
double ber = 0.03;// it doesn't work in fact
// Command line arguments
CommandLine cmd;
cmd.AddValue("m_nmUser", "Number of mobile UE", m_nmUser);
cmd.AddValue("m_dist", "Distance between eNBs [m]", m_dist);
cmd.Parse(argc, argv);
// Config::SetDefault ("ns3::LteEnbNetDevice::DlBandwidth ", UintegerValue(100));//build failed
Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber));
Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (true));
Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (true));
Config::SetDefault ("ns3::PfFfMacScheduler::HarqEnabled", BooleanValue (true));
//Config::SetDefault ("ns3::PfFfMacScheduler::HarqEnabled", BooleanValue (false));
// LogComponentEnable ("BLERofHarqRex", LOG_LEVEL_ALL);
// LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
// LogComponentEnable ("LteMiErrorModel", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUeMac", LOG_LEVEL_ALL);
// LogComponentEnable ("LteRlc", LOG_LEVEL_ALL);
// LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
// LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
LogComponentEnable("LteEnbNetDevice",LOG_LEVEL_ALL);
Ptr<LteHelper> lena = CreateObject<LteHelper> ();
// Create Nodes: eNodeB and UE
NodeContainer enbNodes;
// NodeContainer ueNodes;
NodeContainer ueMnodes;
enbNodes.Create (1);
ueMnodes.Create (m_nmUser);//creat mobile ue
// Install Mobility Model
MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (enbNodes);
BuildingsHelper::Install (enbNodes);
//set mobile UE
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
for (uint16_t i = 0; i < m_nmUser ; i++)
{
positionAlloc->Add (Vector(1000+2000*i, 1000*i, 1.0));
}
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel");
mobility.Install (ueMnodes);
BuildingsHelper::Install (ueMnodes);
for (uint16_t i = 0; i < m_nmUser ; i++)
{
ueMnodes.Get (i)->GetObject<ConstantVelocityMobilityModel> ()->SetVelocity (Vector (speed, 0, 0));
}
lena->SetAttribute ("FadingModel", StringValue ("ns3::TraceFadingLossModel"));
lena->SetFadingModelAttribute ("TraceFilename", StringValue ("src/lte/model/fading-traces/fading_trace_EVA_60kmph.fad"));
lena->SetFadingModelAttribute ("TraceLength", TimeValue (Seconds (10.0)));
lena->SetFadingModelAttribute ("SamplesNum", UintegerValue (10000));
lena->SetFadingModelAttribute ("WindowSize", TimeValue (Seconds (0.5)));
lena->SetFadingModelAttribute ("RbNum", UintegerValue (100));
// Create Devices and install them in the Nodes (eNB and UE)
NetDeviceContainer enbDevs;
NetDeviceContainer ueMDevs;
lena->SetSchedulerType ("ns3::PfFfMacScheduler");
lena->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
enbDevs = lena->InstallEnbDevice (enbNodes);
ueMDevs = lena->InstallUeDevice(ueMnodes);
// Attach a UE to a eNB
lena->Attach (ueMDevs, enbDevs.Get (0));
// Activate an EPS bearer
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
EpsBearer bearer (q);
lena->ActivateDataRadioBearer (ueMDevs, bearer);
Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
enbPhy->SetAttribute ("TxPower", DoubleValue (25));
enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
Ptr<MobilityModel> mm = enbNodes.Get (0)->GetObject<MobilityModel> ();
mm->SetPosition (Vector (0.0, 0.0, 30.0));
//config mobile UE
for (int i = 0; i < m_nmUser; i++)
{
Ptr<LteUeNetDevice> lteUeDev = ueMDevs.Get (i)->GetObject<LteUeNetDevice> ();
Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
uePhy->SetAttribute ("TxPower", DoubleValue (20.0));
uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
}
// Above is configing the mobile UE
lena->EnableRlcTraces ();
lena->EnableMacTraces();
lena->EnablePhyTraces();
Time simulationTime = Seconds (3.000);
Simulator::Stop (simulationTime);
Ptr<RadioBearerStatsCalculator> rlcStats = lena->GetRlcStats ();
rlcStats->SetAttribute ("EpochDuration", TimeValue (simulationTime));
Simulator::Run ();
Simulator::Destroy ();
}