Hi,
I am running the STDMA code in NS-3, but I am not getting any animation of flow of packets from one node to another node. Below is my configuration file.
ns3::SeedManager::SetSeed (1);
stdma::StdmaHelper stdma;
stdma.SetStandard(ns3::WIFI_PHY_STANDARD_80211p_CCH);
stdma::StdmaMacHelper stdmaMac = stdma::StdmaMacHelper::Default();
ns3::Config::SetDefault ("stdma::StdmaMac::FrameDuration", ns3::TimeValue(ns3::MilliSeconds(200.0)));
ns3::Config::SetDefault ("stdma::StdmaMac::MaximumPacketSize", ns3::UintegerValue(700));
ns3::Config::SetDefault ("stdma::StdmaMac::ReportRate", ns3::UintegerValue(1));
ns3::Config::SetDefault ("stdma::StdmaMac::Timeout", ns3::RandomVariableValue (ns3::UniformVariable(8, 8)));
// Create network nodes
ns3::NodeContainer m_nodes;
m_nodes.Create(2);
ns3::YansWifiChannelHelper wifiChannel;
wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel");
ns3::Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", ns3::DoubleValue(10));
wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
ns3::YansWifiPhyHelper wifiPhy = ns3::YansWifiPhyHelper::Default();
wifiPhy.SetChannel(wifiChannel.Create());
// Install wifiPhy and link it with STDMA medium access control layer implementation
NetDeviceContainer devices = stdma.Install(wifiPhy, stdmaMac, m_nodes);
// Define positions of the two nodes
ns3::MobilityHelper mobility;
ns3::Ptr<ns3::ListPositionAllocator> positionAlloc = ns3::CreateObject<ns3::ListPositionAllocator>();
for (uint32_t i = 0; i < 2; i++)
{
positionAlloc->Add(ns3::Vector(8.0 * i, 0.0, 0.0));
}
mobility.SetPositionAllocator(positionAlloc);
mobility.Install(m_nodes);
AnimationInterface anim("multi.xml");
anim.EnablePacketMetadata(true);
anim.EnableIpv4RouteTracking("routing-table.txt",Seconds(50.0),Seconds(80.0),Seconds(5.0));
AodvHelper aodv;
//install internet stack on all nodes
InternetStackHelper internet;
internet.SetRoutingHelper (aodv);
internet.Install (m_nodes);
//assign ip address to each node
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer inter = ipv4.Assign (devices);
InetSocketAddress remote = InetSocketAddress (Ipv4Address("10.1.1.2"), 9);
OnOffHelper onoff ("ns3::UdpSocketFactory", Address (remote));
onoff.SetConstantRate (DataRate ("10kbps"));
onoff.SetAttribute ("PacketSize", UintegerValue (500));
ApplicationContainer apps = onoff.Install(m_nodes.Get(0)) ;
apps.Start (Seconds (65.0));
apps.Stop (Seconds (70.0));
FlowMonitorHelper help;
Ptr<FlowMonitor> monitor;
monitor = help.InstallAll();
stdma.EnablePcap("multi-hop",devices,false);
ns3::Simulator::Stop(ns3::Seconds(100.0));
ns3::Simulator::Run ();
monitor -> SerializeToXmlFile("multi.flowmon",true,true);
ns3::Simulator::Destroy ();