To simulate traffic over a wireless grid I converted the "wifi-simple-adhoc-grid.cc" example to use
Quagga under DCE.
Although I can get example Quagga programs to run, using NS3's wifi module with Quagga
results in transmissions but no receptions. I noticed that the Quagga examples use
PointToPoint which I am not using since I believe it is not compatible with wifi channels.
So is the problem with Quagga not being compatible with NS3's wifi ? Or is there something
I am not doing correctly ?
I have included snippets of the code that I use for establishing connections below.
Thanks for any help you can give me.
Dean
// these are the nodes
NodeContainer allNodes = NodeContainer::GetGlobal();
////////////// setup of wifi
WifiHelper wifi = WifiHelper::Default();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();
wifiPhy.Set("RxGain", DoubleValue(-10));
YansWifiChannelHelper wifiChannel =YansWifiChannelHelper::Default();
wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss("ns3::FriisPropagationLossModel");
wifiPhy.SetChannel(wifiChannel.Create());
// including the wifi-mac
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default();
wifi.SetStandard(WIFI_PHY_STANDARD_80211n_5GHZ);
wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode",
StringValue(phyMode), "ControlMode", StringValue(phyMode));
// Set it to adhoc mode and install
wifiMac.SetType("ns3::AdhocWifiMac");
NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, allNodes);
//////////////////// Set up of DCE
DceManagerHelper processManager;
Ipv4AddressHelper ipv4AddrHelper;
// Internet stack install
InternetStackHelper stack; // IPv4 is required for GlobalRouteMan
Ipv4DceRoutingHelper ipv4RoutingHelper;
stack.SetRoutingHelper (ipv4RoutingHelper);
stack.Install (allNodes);
ipv4AddrHelper.SetBase ("105.25.1.0", "255.255.255.0");
Ipv4InterfaceContainer interfaces = ipv4AddrHelper.Assign (devices);
// Ipv4GlobalRoutingHelper::PopulateRoutingTables (); //////////// I have played with using vs disabling this
processManager.SetNetworkStack ("ns3::Ns3SocketFdFactory");
processManager.Install (allNodes);
processManager.SetNetworkStack ("ns3::Ns3SocketFdFactory");
processManager.Install (allNodes);
//////////////////// Quagga setup
QuaggaHelper quagga;
quagga.EnableOspf (allNodes, "
105.25.1.0/24");
quagga.EnableOspfDebug (allNodes);
quagga.EnableZebraDebug (allNodes);
quagga.Install (allNodes);
///////// Install Packet sinks: not sure this is really needed
for (uint32_t i = 0; i < numNodes; i++) {
PacketSinkHelper sink("ns3::TcpSocketFactory",
InetSocketAddress(Ipv4Address::GetAny(), port));
ApplicationContainer apps_sink = sink.Install(allNodes.Get(i)); // sink is installed on all nodes
apps_sink.Start(Seconds(SinkStartTime));
apps_sink.Stop(Seconds(SinkStopTime));
}
////////////////// Install constant bit-rate sources over TCP/IP between every pair of nodes
for (uint32_t i = 0; i < numNodes; i++) {
set<unsigned> targetIdSet;
AttackerAndTargetsMap::const_iterator cit = attackerAndTargetsMap.find(i);
if (cit != attackerAndTargetsMap.end()) {
targetIdSet = cit->second.targets;
}
// set up a constant bit rate (CBR) application between every pair of nodes
for (uint32_t j = 0; j < numNodes; j++) {
if (i != j) {
/// code to generate semi-random start times
Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable>();
x->SetAttribute("Min", DoubleValue(0));
x->SetAttribute("Max", DoubleValue(1));
double rn = x->GetValue();
/// get node "j" and use its address as the target for source "i"
Ptr<Node> n = allNodes.Get(j);
Ptr<Ipv4> ipv4 = n->GetObject<Ipv4>();
Ipv4InterfaceAddress ipv4_int_addr = ipv4->GetAddress(1, 0);
Ipv4Address ip_addr = ipv4_int_addr.GetLocal();
/// OnOffHelper is the CBR source
OnOffHelper onoff("ns3::TcpSocketFactory",
InetSocketAddress(ip_addr, port)); // traffic flows from node[i] to node[j]
onoff.SetConstantRate(DataRate(AppPacketRate));
ApplicationContainer apps = onoff.Install(allNodes.Get(i)); // traffic source installed at node i
apps.Start(Seconds(AppStartTime + rn));
apps.Stop(Seconds(AppStopTime));
}
}
}
///// The rest is setting up listener streams--which showed packet reception before using Quagga