Open amao2021 opened 1 year ago
Hi,
First of all, please be aware that the paper "End-to-End Simulation of 5G mmWave Networks" refers to an older version of the mmWave module. A lot of changes have been introduced since then, and this will already make very hard to reproduce results 1:1. Regarding question 1, I can take at the scheduler error. Did you modify only the mmwave-epc-tdma.cc file ? If that is the case, can you upload here or link your version ? Related to question 2, I can not find the specific distances either. They seem to be in the [20, 100] range by looking at the figures, but that is all I can say unfortunately.
BR, Matteo
Hi, pagmatt, Thank you very much for your advice!
Best, Mao
================================================================================================
using namespace ns3; using namespace mmwave;
/**
It also starts yet another flow between each UE pair. / NS_LOG_COMPONENT_DEFINE ("MmWaveEpcTdma"); int main (int argc, char argv[]) {
//LogComponentEnable ("MmWaveFlexTtiMacScheduler", LOG_LEVEL_DEBUG); //LogComponentEnable ("MmWaveFlexTtiMaxWeightMacScheduler", LOG_LEVEL_DEBUG); //LogComponentEnable ("MmWaveFlexTtiPfMacScheduler", LOG_LEVEL_DEBUG); //LogComponentEnable ("MmWaveFlexTtiMaxRateMacScheduler", LOG_LEVEL_DEBUG);
uint16_t numEnb = 1; uint16_t numUe = 7; double simTime = 1.0; double interPacketInterval = 100; double minDistance = 10.0; // eNB-UE distance in meters double maxDistance = 200; // eNB-UE distance in meters bool harqEnabled = true; bool rlcAmEnabled = false; bool fixedTti = false; //variable TTI // bool DlSchedOnly = true; bool UlSchedOnly = false; //
Time m_subframePeriod = Time (NanoSeconds (1e5));//!< time duration of a single subframe Time m_symbolPeriod = Time (NanoSeconds (4160)); //!< time duration of a single OFDM symbol // Command line arguments
CommandLine cmd; cmd.AddValue ("numEnb", "Number of eNBs", numEnb); cmd.AddValue ("numUe", "Number of UEs per eNB", numUe); cmd.AddValue ("simTime", "Total duration of the simulation [s])", simTime); cmd.AddValue ("interPacketInterval", "Inter-packet interval [us])", interPacketInterval); cmd.AddValue ("harq", "Enable Hybrid ARQ", harqEnabled); cmd.AddValue ("rlcAm", "Enable RLC-AM", rlcAmEnabled); cmd.AddValue ("fixedTti", "Fixed TTI scheduler", fixedTti);//variable TTI
cmd.Parse (argc, argv);
Config::SetDefault ("ns3::MmWaveHelper::RlcAmEnabled", BooleanValue (rlcAmEnabled)); Config::SetDefault ("ns3::MmWaveHelper::HarqEnabled", BooleanValue (harqEnabled));
Config::SetDefault ("ns3::MmWaveFlexTtiMacScheduler::HarqEnabled", BooleanValue (harqEnabled)); Config::SetDefault ("ns3::MmWaveFlexTtiMacScheduler::DlSchedOnly", BooleanValue (DlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMacScheduler::UlSchedOnly", BooleanValue (UlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMacScheduler::FixedTti", BooleanValue(fixedTti));
Config::SetDefault ("ns3::MmWaveFlexTtiPfMacScheduler::HarqEnabled", BooleanValue (harqEnabled)); Config::SetDefault ("ns3::MmWaveFlexTtiPfMacScheduler::DlSchedOnly", BooleanValue (DlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiPfMacScheduler::UlSchedOnly", BooleanValue (UlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiPfMacScheduler::FixedTti", BooleanValue(fixedTti));
Config::SetDefault ("ns3::MmWaveFlexTtiMaxWeightMacScheduler::HarqEnabled", BooleanValue (harqEnabled)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxWeightMacScheduler::FixedTti", BooleanValue(fixedTti)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxWeightMacScheduler::DlSchedOnly", BooleanValue (DlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxWeightMacScheduler::UlSchedOnly", BooleanValue (UlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxWeightMacScheduler::SymPerSlot", UintegerValue(6));
Config::SetDefault ("ns3::MmWaveFlexTtiMaxRateMacScheduler::HarqEnabled", BooleanValue (harqEnabled)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxRateMacScheduler::DlSchedOnly", BooleanValue (DlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxRateMacScheduler::UlSchedOnly", BooleanValue (UlSchedOnly)); Config::SetDefault ("ns3::MmWaveFlexTtiMaxRateMacScheduler::FixedTti", BooleanValue(fixedTti));
Config::SetDefault ("ns3::MmWavePhyMacCommon::TbDecodeLatency", UintegerValue (200.0)); Config::SetDefault ("ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue (MilliSeconds (100000.0))); Config::SetDefault ("ns3::LteEnbRrc::SystemInformationPeriodicity", TimeValue (MilliSeconds (5.0))); Config::SetDefault ("ns3::LteRlcAm::ReportBufferStatusTimer", TimeValue (MicroSeconds (100.0))); Config::SetDefault ("ns3::LteRlcUmLowLat::ReportBufferStatusTimer", TimeValue (MicroSeconds (100.0))); Config::SetDefault ("ns3::LteEnbRrc::SrsPeriodicity", UintegerValue (320)); Config::SetDefault ("ns3::LteEnbRrc::FirstSibTime", UintegerValue (2));
// the applications on this example start very early. // Use the IDEAL mode in RRC (no radio messages are exchanged for RRC control ops) // and set to the minimum the latency on the S1-AP link to speed up the link and bearers setup Config::SetDefault ("ns3::MmWaveHelper::UseIdealRrc", BooleanValue (true)); Config::SetDefault ("ns3::MmWavePointToPointEpcHelper::S1apLinkDelay", TimeValue (Seconds (0)));
Ptr
ConfigStore inputConfig; inputConfig.ConfigureDefaults ();
// parse again so you can override default values from the command line cmd.Parse (argc, argv);
// create MmWavePhyMacCommon object
Ptr
Ptr
// Create a single RemoteHost
NodeContainer remoteHostContainer;
remoteHostContainer.Create (1);
Ptr
// Create the Internet PointToPointHelper p2ph; p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));//带宽? p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500)); p2ph.SetChannelAttribute ("Delay", TimeValue (MicroSeconds (100.0)));//delay 100ms NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost); Ipv4AddressHelper ipv4h; ipv4h.SetBase ("1.0.0.0", "255.0.0.0"); Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
Ipv4StaticRoutingHelper ipv4RoutingHelper;
Ptr
NodeContainer ueNodes; NodeContainer enbNodes; enbNodes.Create (numEnb); ueNodes.Create (numUe);
// Install Mobility Model
Ptr
MobilityHelper uemobility;
Ptr
for (unsigned i = 0; i < numUe; i++) { // double dist = distRv->GetValue (minDistance, maxDistance); double dist = (i+1)* (maxDistance-minDistance)/numUe + minDistance; std::cout << "ue-dist:" << dist << "m"<<"\n";//mao see value uePositionAlloc->Add (Vector (dist, 0.0, 0.0)); //uePositionAlloc->Add (Vector (dist, -12.5, 0.0)); }
//uemobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); uemobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel"); uemobility.SetPositionAllocator (uePositionAlloc); uemobility.Install (ueNodes);
for (unsigned i = 0; i < numUe; i++)
{
double speed = 0;
std::cout << "ue-speed:" << speed << "m/s"<<"\n";//mao see value
ueNodes.Get(i)->GetObject
}
// Install mmWave Devices to the nodes NetDeviceContainer enbmmWaveDevs = mmwaveHelper->InstallEnbDevice (enbNodes); NetDeviceContainer uemmWaveDevs = mmwaveHelper->InstallUeDevice (ueNodes);
// Install the IP stack on the UEs
internet.Install (ueNodes);
Ipv4InterfaceContainer ueIpIface;
ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (uemmWaveDevs));
// Assign IP address to UEs, and install applications
for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
{
Ptr
mmwaveHelper->AttachToClosestEnb (uemmWaveDevs, enbmmWaveDevs);
// Install and start applications on UEs and remote host uint16_t dlPort = 1234; uint16_t ulPort = 2000; uint16_t otherPort = 3000; ApplicationContainer clientApps; ApplicationContainer serverApps; uint32_t packetSize = 1400;
double dataRateMB = 100e6; // 100 MBps mao // double dataRate = 1000e6; double onTimeSec = 5e-6; //packetSize / dataRateMB; std::stringstream ss; ss << "ns3::ConstantRandomVariable[Constant=" << onTimeSec << "]"; std::cout << "OnTime == " << ss.str () << std::endl; OnOffHelper dlClient ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort)); OnOffHelper ulClient ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort)); dlClient.SetAttribute ("PacketSize", UintegerValue (packetSize)); ulClient.SetAttribute ("PacketSize", UintegerValue (packetSize)); dlClient.SetAttribute ("DataRate", DataRateValue (8 dataRateMB)); //Byte 8 = bit bps ulClient.SetAttribute ("DataRate", DataRateValue (8 * dataRateMB));
// dlClient.SetAttribute ("DataRate", DataRateValue (dataRate)); // ulClient.SetAttribute ("DataRate", DataRateValue (dataRate));
dlClient.SetAttribute ("OnTime", StringValue (ss.str ())); ulClient.SetAttribute ("OnTime", StringValue (ss.str ())); ss.str (""); ss << "ns3::ExponentialRandomVariable[Mean=" << interPacketInterval * 1e-6 << "]"; std::cout << "OffTime == " << ss.str () << std::endl; dlClient.SetAttribute ("OffTime", StringValue (ss.str ())); ulClient.SetAttribute ("OffTime", StringValue (ss.str ()));
for (uint32_t u = 0; u < ueNodes.GetN (); ++u) { ++ulPort; ++otherPort; PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort)); PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort)); serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
// UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // dlClient.SetAttribute ("Interval", TimeValue (MicroSeconds(interPacketInterval))); // dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); // dlClient.SetAttribute ("PacketSize", UintegerValue(packetSize)); // // UdpClientHelper ulClient (remoteHostAddr, ulPort); // ulClient.SetAttribute ("Interval", TimeValue (MicroSeconds(interPacketInterval))); // ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); // ulClient.SetAttribute ("PacketSize", UintegerValue(packetSize));
// UdpClientHelper client (ueIpIface.GetAddress (u), otherPort); // client.SetAttribute ("Interval", TimeValue (MicroSeconds(interPacketInterval))); // client.SetAttribute ("MaxPackets", UintegerValue(1000000)); dlClient.SetAttribute ("Remote", AddressValue (InetSocketAddress (ueIpIface.GetAddress (u), dlPort))); // ulClient.SetAttribute ("Remote", AddressValue (InetSocketAddress (remoteHostAddr, ulPort)));
clientApps.Add (dlClient.Install (remoteHost));
clientApps.Add (ulClient.Install (ueNodes.Get(u)));
// if (u+1 < ueNodes.GetN ()) // { // clientApps.Add (client.Install (ueNodes.Get(u+1))); // } // else // { // clientApps.Add (client.Install (ueNodes.Get(0))); // } } serverApps.Start (Seconds (0.003)); clientApps.Start (Seconds (0.003)); mmwaveHelper->EnableTraces (); // Uncomment to enable PCAP tracing //p2ph.EnablePcapAll("mmwave-epc-simple");
Simulator::Stop (Seconds (simTime)); Simulator::Run ();
/GtkConfigStore config; config.ConfigureAttributes();/
Simulator::Destroy (); return 0;
}
Is there something I missed when I set up the scheduler? In the newest version, after I change the scheduler, mcs is still 0. Sometimes only DL has mcs value and UL is still 0.
Looking forward to hearing from you. Mao
Hi, Thank you for providing wonderful simulator. I'm doing my own project with ns3-mmwave. I want to reproduce your multi-user scheduling experiment in paper End-to-End Simulation of 5G mmWave Networks. So I started from mmWave-epc-tdma.cc. I use the file RxPacketTrace.txt to get the DL PHY Throughput. Here are some questions.
Looking forward to hearing from you.