Using Quagga-ospfv2 over wireless with on-off application / tcp.

108 views
Skip to first unread message

Dean Mumme

unread,
Jun 12, 2014, 4:06:19 PM6/12/14
to ns-3-...@googlegroups.com
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

Hajime Tazaki

unread,
Jul 15, 2014, 1:53:41 AM7/15/14
to ns-3-...@googlegroups.com

Hi Dean,

DCE quagga should work fine with ns-3's wifi.

I recently found that Quagga with Ns3SocketFdFactory (ns3
network stack) has an issue synchronizing ifindex value and
uses odd MTU value from different interface, resulting can't
exchange LSA in ospfd in some case.

the following post (by Guo Chen) reported that the timing of
InternetStack installation does the trick ;)

https://groups.google.com/d/msg/ns-3-users/ZzJYoVraIws/hGEBTcSJVUQJ

and since you're enabling debug option of zebra and ospfd,
please share your debug output (generated around
files-X/var/log/(pid)/stdout under the executed directory),
if possible.

another work around is using LinuxSocketFdFactory, instead
of Ns3SocketFdFactory. that also should work fine.

thank you.

-- Hajime

At Thu, 12 Jun 2014 13:06:18 -0700 (PDT),
Dean Mumme wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [2 <text/html; UTF-8 (7bit)>]
>
Reply all
Reply to author
Forward
0 new messages