Low packet delivery ratio (PDR) and throughput

121 views
Skip to first unread message

Chikh Mouici

unread,
May 26, 2023, 7:28:44 AM5/26/23
to ns-3-...@googlegroups.com
Hello everyone,
I'm experiencing a low packet delivery ratio (PDR) and also a low throughput on an implemented clustering algorithm in Ns3.38 for the FANET network compared to MANET network protocols : AODV, OLSR and DSDV.
Please help me figure out the cause of loss packets and low average throughput, the same scenario is used for various protocols : 10 nodes sending packets of 1 KO size to 10 other nodes at 500 kb/s data rate.
The mobility model is the 3D Gauss Markov model.  Transmission range is 300 meters.
Below an extrait of the target code.

Thank you in advance for your help!

Best regards,
Mouici

uint32_t nWifis = 20; // number of UAVs 20
double simTime = 30 ; // simulation time 30 seconds
std::string phyMode ("OfdmRate6MbpsBW10MHz");
Config::SetDefault("ns3::OnOffApplication::PacketSize", StringValue("1024")); 
Config::SetDefault("ns3::OnOffApplication::DataRate", StringValue("500kb/s"));

/*-------------------- Set explicitly default values -------------------*/
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold",
StringValue ("2200"));
// turn off RTS/CTS for frames below 2200 bytes
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold",
StringValue ("2200"));
// Fix non-unicast data rate to be the same as that of unicast
Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
StringValue (phyMode));
/*----------------------------------------------------------------------*/
NodeContainer adhocNodes;
adhocNodes.Create(nWifis);
/*---------------------- Simulation Default Values ---------------------*/
double minimumTdmaSlot = 0.001; /// Time difference between 2 transmissions
double clusterTimeMetric = 3.0; /// Clustering Time Metric for Waiting Time calculation
double incidentWindow = 30.0;
/*-------------------------- Setup Wifi nodes --------------------------*/
// The below set of helpers will help us to put together the wifi NICs we want
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default();
Ptr<YansWifiChannel> channel = wifiChannel.Create ();
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); //
wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel"); //
YansWifiPhyHelper wifiPhy; // corrected, eliminating Default method
wifiPhy.SetChannel (channel);
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11);
wifiPhy.Set ("TxPowerStart", DoubleValue(32));
wifiPhy.Set ("TxPowerEnd", DoubleValue(32));
wifiPhy.Set ("TxGain", DoubleValue(12));
wifiPhy.Set ("RxGain", DoubleValue(12));
wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue(-61.8));
wifiPhy.Set ("CcaMode1Threshold", DoubleValue(-64.8));

NqosWaveMacHelper wifi80211pMac = NqosWaveMacHelper::Default ();
Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();
wifi80211p.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode",StringValue (phyMode),
"ControlMode",StringValue (phyMode));
NetDeviceContainer adhocDevices = wifi80211p.Install (wifiPhy, wifi80211pMac, adhocNodes);
uint16_t controlPort = 3999;
ApplicationContainer controlApps;
for (uint32_t u = 0; u < adhocNodes.GetN(); ++u) {

//!< Initial TDMA UE synchronization Function
double tdmaStart = (u+1)*minimumTdmaSlot;

Ptr<GaussMarkovMobilityModel> mobilityModel = adhocNodes.Get(u)->GetObject<GaussMarkovMobilityModel>(); // changed to GaussMarkovMobilityModel
V2vControlClientHelper ueClient("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address::GetBroadcast(), controlPort)),
"ns3::UdpSocketFactory",InetSocketAddress(Ipv4Address::GetAny(), controlPort),
mobilityModel, tdmaStart, nWifis, minimumTdmaSlot, clusterTimeMetric);
ueClient.SetAttribute ("IncidentWindow", DoubleValue(incidentWindow));
controlApps.Add(ueClient.Install(adhocNodes.Get(u)));
}

controlApps.Start (Seconds(0.1));
controlApps.Stop (Seconds(simTime-0.1));
// scenario 10 nodes sends packets to 10 nodes
OnOffHelper onoff1("ns3::UdpSocketFactory", Address());
onoff1.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1.0]"));
onoff1.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0.0]"));

for (int i = 0; i < nSinks; i++)
{
Ptr<Socket> sink = SetupPacketReceive(adhocInterfaces.GetAddress(i), adhocNodes.Get(i)); // changed 0 to i

AddressValue remoteAddress(InetSocketAddress(adhocInterfaces.GetAddress(i), port));
onoff1.SetAttribute("Remote", remoteAddress);

Ptr<UniformRandomVariable> var = CreateObject<UniformRandomVariable>();
ApplicationContainer temp = onoff1.Install(adhocNodes.Get(i + nSinks));
temp.Start(Seconds(var->GetValue(20.0, 21.0)));
temp.Stop(Seconds(simTime));
}
Simulator::Stop(Seconds(simTime));
Simulator::Run();
Reply all
Reply to author
Forward
0 new messages