std::vector<uint8_t> tosValues = {0x70, 0x28, 0xB8, 0xC0};
for (uint32_t i = 0; i < nNodes; i++)
{
uint16_t portNumber = 4000;
uint32_t j = (i + 1) % nNodes;
for (uint8_t tosValue : tosValues)
{
auto ipv4 = staDevicesCont.Get (j)->GetObject<Ipv4> ();
const auto address = ipv4->GetAddress (1, 0).GetLocal ();
std::cout<<"Address: "<<address<<std::endl;
InetSocketAddress sinkSocket (address, portNumber++);
sinkSocket.SetTos (tosValue);
OnOffHelper onOffHelper ("ns3::UdpSocketFactory", sinkSocket);
onOffHelper.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1000]"));
onOffHelper.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
onOffHelper.SetAttribute ("DataRate", DataRateValue (3000000));
onOffHelper.SetAttribute ("PacketSize", UintegerValue (pktSize)); //bytes
sourceApps.Add (onOffHelper.Install (staDevicesCont.Get (i)));
PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", sinkSocket);
sinkApps.Add (packetSinkHelper.Install (staDevicesCont.Get (j)));
}
printDevMacParams(staNetDevices, i);
}Config::Connect("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VO_EdcaTxopN/Queue/Enqueue", MakeCallback(&Experiment::EnqueueCallback, this));
void
Experiment::EnqueueCallback (std::string context, ns3::Ptr<ns3::WifiMacQueueItem const> macQueue) {
std::cout << "Packet enqueued: "<< macQueue->GetAddress(WifiMacHeader::ADDR2)<< ", Size: "<< macQueue->GetSize()<<std::endl;
}
Can
some one help me in understanding why few nodes are not at all
transmitting and how can i generate saturation traffic for all the
VO_EdcaTxopN, VI_EdcaTxopN, BE_EdcaTxopN, BK_EdcaTxopN queues for every
node. Kindly let me know if any additional information is needed.