Problem about Output of RLC dldatatrace in LTE

467 views
Skip to first unread message

Jona Huang

unread,
Dec 30, 2014, 8:09:40 AM12/30/14
to ns-3-...@googlegroups.com
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 ();
      }


Tommaso Pecorella

unread,
Dec 30, 2014, 10:04:42 AM12/30/14
to ns-3-...@googlegroups.com, nba...@cttc.es
Hi,

dunno about the issue, maybe there's still something to fine tune. I guess Nicola can take a look at it.

Cheers,

T.

Jona Huang

unread,
Dec 30, 2014, 10:10:22 PM12/30/14
to ns-3-...@googlegroups.com
  According to the output files, "DlRxPhyStats.txt“ "DlTxPhyStats.txt"  ,  I made a table to compare the calculation of Tx and Rx . 
  PHY-Tx 1347 is the number of RV==0  while 452 is the number of rv=1,2 or 3 . 
  PHY-Rx 1352 is the number of Correct==1 while 447 is the number of Correct==0 .
  It shows that the RLC-Tx is almost equal to PHY-Tx(first transmission), so how about the RLC-Rx ?  It makes me more confused, how to calculate the RLC-Rx .
  If  I want to calculate the rate of loss packet, what data should I use ? 
  Any comment and advice is appreciated ~~~~ 

IMSI

1

2

3

4

5

6

7

8

9

10

11

12

RLC-Tx

1347

1022

1016

1011

932

909

 

913

 

940

 

919

 

901

 

902

 

870

 

RLC-Rx

1356

1389

1210

1094

929

764

 

742

 

756

808

882

862

792

PHY-Tx

1347

(452)

1022

(1190)

1016

(1218)

1011

(1202)

931

(1238)

909

(1257)

912

(1251)

939

(1228)

919

(1200)

901

(1139)

902

(1087)

868

(1055)

PHY-Rx

1352

(447)

1020

(1192)

919

(1315)

862

(1350)

671

(1495)

536

(1619)

520

(1618)

563

(1566)

561

(1475)

598

(1321)

756

(1193)

511

(1072)

MAC

 

 

 

 

 

 

 

 

 

 

 

 

Jona Huang

unread,
Jan 4, 2015, 11:56:53 PM1/4/15
to ns-3-...@googlegroups.com
Hi ~ All
   I have solved this problem.  Finally, I found there was logic bug in the file"pf-ff-mac-scheduler.cc", source code file, line965 ,  as showing below:
              else
                {
                  // HARQ retx cannot be performed on this TTI -> store it
                  dlInfoListUntxed.push_back (m_dlInfoListBuffered.at (i));
                  NS_LOG_INFO (this << " No resource for this retx -> buffer it");
                }
            }
          // retrieve RLC PDU list for retx TBsize and update DCI
          BuildDataListElement_s newEl;
          std::map <uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu =  m_dlHarqProcessesRlcPduListBuffer.find (rnti);
          if (itRlcPdu == m_dlHarqProcessesRlcPduListBuffer.end ())
            {
              NS_FATAL_ERROR ("Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
            }

         ........
   when the condition of “else” is met, this "dlInfo" should be buffered without resource. But, it would be restransmitted anyway as the codes below (line973) ,  
    BuildDataListElement_s newEl;
   It means that no matter there are resource for retx or not , this retransmission would be transmitted.
   Attention here, if the HARQ retransmission is always allocated resource, this bug won't cause any problem. However, when
" No resource for this retx", it would be retx at every TTI  untill it get the MaxRetxTime . That's why the Rx data calculated is more than Tx.

Tommaso Pecorella

unread,
Jan 5, 2015, 3:03:36 AM1/5/15
to ns-3-...@googlegroups.com, nba...@cttc.es
Hi,

thanks for finding this. Mind opening a bug in Bugzilla ?
The web address is here: https://www.nsnam.org/bugzilla/

If you can't, please let me know and I'll open one.

Thanks,

T.

Jona Huang

unread,
Jan 20, 2015, 7:11:18 AM1/20/15
to ns-3-...@googlegroups.com, nba...@cttc.es

 Sorry for the late reply. If you can open one is nice~

Tommaso Pecorella

unread,
Jan 20, 2015, 10:45:27 AM1/20/15
to ns-3-...@googlegroups.com, nba...@cttc.es

Nicola Baldo

unread,
Jan 28, 2015, 6:04:31 AM1/28/15
to ns-3-...@googlegroups.com, nba...@cttc.es
Hi Jona,

thanks a lot for reporting this bug and investigating the issue. I understand you already fixed the problem in your code, could you please share a patch so that we can review it and possibly commit to ns-3-dev?

Regards,

Nicola

Pinewood Liu

unread,
Jul 20, 2017, 8:13:42 AM7/20/17
to ns-3-users
sorry to bother you after two years,you said you have solved this bug.could tell me how you fixed it?Because the bug is still in ns3.26.....

在 2015年1月5日星期一 UTC+8下午12:56:53,Joanna Huang写道:
Reply all
Reply to author
Forward
0 new messages