[Ns-developers] OLSR/AODV routing fails with mobility induced path changes
Abdul Jabbar
jabbar314 at gmail.com
Tue Dec 22 14:28:15 PST 2009
Hi all,
I finished testing my simulation scenario with the latest ns-3-dev, and it
seems to work correctly as far as simple 3 node case is concerned. I have
spent some time working with traces to make sure that the number of
transmitted and received packets make sense. I get 100% packet delivery
ratio with both OLSR and AODV. Hoorray!!
I would like to thank all the developers (Pavel, Gustavo, Tom, Mathieu) for
their great support.
However, this was a toy example that we were using to debug the simulations.
Over the next couple of days I will be running more involved scenarios and
generating plots. I will be looking at PDR, delay, overhead (putting the
OLSR and AODV behavior under a microscope), and packet losses. The idea is
get some baseline results (hopefully sensible ones) that we will use to
compare some of the new protocols that we are developing. Since there are no
detailed examples in the current ns-3 release, I would be more than happy to
contribute a few well tested/documented examples along with the expected
results.
Thanks,
Abdul.
On Tue, Dec 22, 2009 at 12:51 AM, Pavel Boyko <boyko at iitp.ru> wrote:
> Hi, Abdul,
>
> OLSR bug you have discovered is fixed by Gustavo Carneiro, please update
> ns-3-dev and confirm that now both OLSR and AODV work as you expect.
>
> Best regards,
>
> Pavel
>
> On Thursday 17 December 2009 12:10:43 am Abdul Jabbar wrote:
>
> > Hi all,
>
> >
>
> > I posted the following message to ns-3 users list, but realized that it
> is
>
> > perhaps better suited to the developers list.
>
> >
>
> > We have been running mobile adhoc simulations with ns3 in order to
> document
>
> > baseline performance in certain mobility scenarios. Unfortunately, we are
>
> > seeing very low performance (in terms of packet delivery ratios) in cases
>
> > where the mobility results in one or more path changes. We ruled out (or
>
> > so we think) the usual suspects by considering factors such as constant
>
> > rate controller, 1Mbps mode for 802.11b, unicast/non-unicast modes,
>
> > RTS/CTS, analytically calculated and experimentally verified transmission
>
> > ranges. The short description of the issue that we observed is that both
>
> > OLSR and AODV (using the latest ns-3-dev version) have very high route
>
> > reconvergence times (45 - 90 seconds) and in many cases don't converge at
>
> > all. Furthermore, the convergence seems flaky at best - meaning that in
>
> > some cases routes are discovered as intended, in some cases there is a
>
> > really long delay and in some case, no routes are found.
>
> >
>
> > In a simulation scenario where paths between nodes change every so often
>
> > (a.k.a MANETs), this reduces the throughput/PDR to almost zero. We were
>
> > wondering if any of the users or developers have tested a full fledged
>
> > mobile adhoc scenario with success. By full fledged, we mean in terms of
>
> > mobility - with more than a few mobile nodes such that routes change over
>
> > the duration of the simulation.
>
> >
>
> > Thats the short story. Now for the long one, here is an example that
>
> > demonstrates this problem and the simulation script we are using.
>
> >
>
> > We place 3 nodes in a linear fashion.
>
> >
>
> > 1 ----------------- 2 ----------------- 3
>
> > (0,0) (250,0) (500,0)
>
> > d=250 m d=250m
>
> >
>
> > After an initial settling time of 50 seconds (just to be safe), we start
>
> > both the traffic and mobility (constant velocity mobility model via
>
> > SetVelocity method).
>
> >
>
> > The transmission range is set to 300-350 meters and we send traffic from
>
> > every node to every other node (staggered in time, of course) at a rate
> of
>
> > 1 pkt/sec. With a pkt size of 500 B, this results in an aggregate traffic
>
> > rate of 24Kbps , which is far less than (approx.) 0.5 Mbps expected
>
> > throughput from a 1 Mbps 802.11b network.
>
> >
>
> > We then move nodes 2 and 3 such that they end up interchanging their
>
> > positions...
>
> >
>
> > First we bring node 3 very close to node 2. In fact, we bring 2 to the
> same
>
> > node coordinates as 3.
>
> >
>
> > 1 ----------------- 2 -3
>
> >
>
> > And then move the node 2 away until it reaches the original position of
>
> > node 3.
>
> >
>
> > 1 ----------------- 3 ----------------- 2
>
> > (0,0) (250,0) (500,0)
>
> >
>
> > At this point, we set the velocity of all the nodes to zero, till the end
>
> > of the simulation. We let the simulation run for couple hundred seconds
>
> > after this point. And OLSR still doesn't converge on the routes! Note
> that
>
> > throughout the simulation, there are no network partitions. There is
>
> > always a path between every node pair.
>
> >
>
> > We expected to see 100% packet delivery ratio in this case. However, what
>
> > we see is much less. We used both flow monitor as well as our own scripts
>
> > to process the ascii trace files to calculate PDRs. The exact number
>
> > depends on the specific scenario. During the mobility part of the
>
> > simulation, the PDR is as low as 0.5. AODV ultimately reconverges after
> 70
>
> > seconds and OLSR never reconverges and PDR remains 0.666 throughout the
>
> > simulation. Again, this behaviour is flaky.
>
> >
>
> > I am assuming that we are making some fundamental mistake in the
>
> > simulation. Could anyone please point us to what we are doing wrong? Any
>
> > help is highly appreciated. Below is our simulation script:
>
> >
>
> > Thanks,
>
> > Abdul.
>
> >
>
> > ======================
>
> >
>
> > /*This program is free software; you can redistribute it and/or modify
>
> > * it under the terms of the GNU General Public License version 2 as
>
> > * published by the Free Software Foundation;
>
> > *
>
> > * This program is distributed in the hope that it will be useful,
>
> > * but WITHOUT ANY WARRANTY; without even the implied warranty of
>
> > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>
> > * GNU General Public License for more details.
>
> > *
>
> > * You should have received a copy of the GNU General Public License
>
> > * along with this program; if not, write to the Free Software
>
> > * Foundation, Inc., 59 Texport
>
> > 'NS_LOG=*=level_function|prefix_func|prefix_time'emple Place, Suite
>
> > 330,
>
> > Boston, MA 02111-1307 USA
>
> > *
>
> > */
>
> >
>
> > #include <fstream>
>
> > #include <iostream>
>
> > #include "ns3/core-module.h"
>
> > #include "ns3/common-module.h"
>
> > #include "ns3/node-module.h"
>
> > #include "ns3/helper-module.h"
>
> > #include "ns3/mobility-module.h"
>
> > #include "ns3/contrib-module.h"
>
> > #include "ns3/wifi-module.h"
>
> > #include "ns3/global-route-manager.h"
>
> >
>
> > using namespace ns3;
>
> > NS_LOG_COMPONENT_DEFINE ("adhoc_simple_test");
>
> >
>
> > static void
>
> > SetVelocity (Ptr<Node> node, Vector vel)
>
> > {
>
> > Ptr<ConstantVelocityMobilityModel> mobility =
>
> > node->GetObject<ConstantVelocityMobilityModel> ();
>
> > mobility->SetVelocity (vel);
>
> > }
>
> >
>
> >
>
> > int main (int argc, char *argv[])
>
> > {
>
> >
>
> > //srand(time(NULL));
>
> > SeedManager::SetSeed(time(NULL));
>
> >
>
> > int nWifis = 3;
>
> > double SimTime = 200.0;
>
> > std::string phyMode ("wifib-1mbs");
>
> >
>
> > //sending one packets per sec
>
> >
>
> > Config::SetDefault ("ns3::OnOffApplication::PacketSize",StringValue
>
> > ("500"));
>
> > Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue
>
> > ("4kb/s"));
>
> >
>
> > // Fix non-unicast data rate to be the same as that of unicast
>
> > Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold",
>
> > StringValue ("400"));
>
> >
>
> > //Set Non-unicastMode rate to unicast mode
>
> > //Config::SetDefault
>
> > ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue (phyMode));
>
> >
>
> > NS_LOG_INFO ("creating nodes");
>
> > CommandLine cmd;
>
> > cmd.AddValue ("nWifis", "Number of wifi networks", nWifis);
>
> > cmd.AddValue ("SimTime", "Total Simulation time", SimTime);
>
> > cmd.Parse (argc, argv);
>
> >
>
> > NodeContainer adhocNodes;
>
> > adhocNodes.Create (nWifis);
>
> >
>
> > NS_LOG_INFO ("setting the default phy and channel parameters ");
>
> > WifiHelper wifi;
>
> > YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
>
> > YansWifiChannelHelper wifiChannel ;
>
> > wifiChannel.SetPropagationDelay
>
> > ("ns3::ConstantSpeedPropagationDelayModel");
>
> > wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
>
> > wifiPhy.SetChannel (wifiChannel.Create ());
>
> >
>
> > // Add a non-QoS upper mac, and disable rate control
>
> > NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
>
> > wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
>
> > "DataMode",StringValue(phyMode),
>
> > "ControlMode",StringValue(phyMode));
>
> >
>
> > //set the tx range to 300
>
> > wifiPhy.Set ("TxPowerStart",DoubleValue (-0.1615));
>
> > wifiPhy.Set ("TxPowerEnd", DoubleValue (-0.1615));
>
> >
>
> > // Set it to adhoc mode
>
> > wifiMac.SetType ("ns3::AdhocWifiMac");
>
> > NetDeviceContainer adhocDevices = wifi.Install (wifiPhy, wifiMac,
>
> > adhocNodes);
>
> >
>
> > AodvHelper aodv;
>
> > OlsrHelper olsr;
>
> > Ipv4StaticRoutingHelper staticRouting;
>
> >
>
> > Ipv4ListRoutingHelper list;
>
> > list.Add (staticRouting, 0);
>
> > list.Add (olsr, 10);
>
> > //list.Add (aodv,10);
>
> >
>
> > InternetStackHelper internet;
>
> > internet.SetRoutingHelper (list);
>
> > internet.Install (adhocNodes);
>
> >
>
> > NS_LOG_INFO ("setting the address");
>
> > Ipv4AddressHelper addressAdhoc;
>
> > addressAdhoc.SetBase ("10.1.1.0", "255.255.255.0");
>
> > Ipv4InterfaceContainer adhocInterfaces;
>
> > adhocInterfaces = addressAdhoc.Assign (adhocDevices);
>
> >
>
> > MobilityHelper mobilityAdhoc;
>
> > NS_LOG_INFO ("Installing the mobility model");
>
> >
>
> > Ptr<ListPositionAllocator> positionAlloc_Adhoc =
>
> > CreateObject<ListPositionAllocator>();
>
> > double distance = 0.0;
>
> > for (uint32_t i = 0;i <= adhocNodes.GetN();i++){
>
> > positionAlloc_Adhoc->Add(Vector(distance,0.0,0.0));
>
> > distance += 250.0;
>
> > }
>
> >
>
> > mobilityAdhoc.SetMobilityModel ("ns3::ConstantVelocityMobilityModel");
>
> > mobilityAdhoc.SetPositionAllocator(positionAlloc_Adhoc);
>
> > mobilityAdhoc.Install (adhocNodes);
>
> >
>
> > //At 50 sec node 3 moves towards node 2
>
> > Simulator::Schedule (Seconds (50.0), &SetVelocity, adhocNodes.Get(2)
>
> > ,Vector(-5.0,0.0,0.0));
>
> >
>
> > //AT 100 sec set node 3 with zero velocity
>
> > Simulator::Schedule (Seconds (100.0), &SetVelocity, adhocNodes.Get(2)
>
> > ,Vector(0.0,0.0,0.0));
>
> >
>
> > //Move node2 away from node 3
>
> > Simulator::Schedule (Seconds (100.0), &SetVelocity, adhocNodes.Get(1)
>
> > ,Vector(5.0,0.0,0.0));
>
> >
>
> > //AT 150 sec set node 2 with zero velocity
>
> > Simulator::Schedule (Seconds (150.0), &SetVelocity, adhocNodes.Get(1) ,
>
> > Vector(0.0,0.0,0.0));
>
> >
>
> > //Configure the application on each node
>
> >
>
> > uint16_t port = 9;
>
> >
>
> > for(int i =0; i< nWifis-1; i++)
>
> > {
>
> > PacketSinkHelper sink ("ns3::UdpSocketFactory",
>
> > InetSocketAddress(Ipv4Address::GetAny (), port));
>
> > ApplicationContainer apps_sink = sink.Install (adhocNodes.Get (i));
>
> > apps_sink.Start (Seconds (0.0));
>
> > apps_sink.Stop (Seconds (SimTime));
>
> > }
>
> >
>
> >
>
> > for(int clientNode=0; clientNode <= nWifis-1;clientNode++)
>
> > {
>
> > for (int j=0;j<=nWifis-1;j++)
>
> > {
>
> > std::cout << "J::" << j << std::endl;
>
> > OnOffHelper onoff1 ("ns3::UdpSocketFactory",Address (InetSocketAddress
>
> > (adhocInterfaces.GetAddress (j), port)));
>
> > onoff1.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable
>
> > (1)));
>
> > onoff1.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable
>
> > (0)));
>
> >
>
> > if (j!= clientNode)
>
> > {
>
> > std::cout << "cleint node:" << clientNode << std::endl;
>
> > ApplicationContainer apps1 = onoff1.Install (adhocNodes.Get
>
> > (clientNode));
>
> > //apps1.Start (Seconds (90.0));
>
> > UniformVariable var;
>
> > //std::cout <<"random :" << var.GetValue(50.0,51.0) <<std::endl;
>
> > apps1.Start (Seconds (var.GetValue(50.0,51.0)));
>
> > apps1.Stop (Seconds (SimTime));
>
> > }
>
> > }
>
> > }
>
> >
>
> > //configure flowmonitor
>
> >
>
> > Ptr<FlowMonitor> flowmon;
>
> > FlowMonitorHelper flowmonHelper;
>
> > flowmon = flowmonHelper.InstallAll ();
>
> >
>
> > NS_LOG_INFO ("Configure Tracing.");
>
> > std::ofstream ascii;
>
> > ascii.open ("adhoc_olsr_mob_test.tr");
>
> > YansWifiPhyHelper::EnableAsciiAll (ascii);
>
> > MobilityHelper::EnableAsciiAll (ascii);
>
> > //YansWifiPhyHelper::EnablePcapAll ("adhoc_test_case1_200");
>
> >
>
> > NS_LOG_INFO ("Run Simulation.");
>
> > Simulator::Stop (Seconds (SimTime));
>
> > Simulator::Run ();
>
> > flowmon->SerializeToXmlFile ("mobtest_aovd-flowmon.xml", true, true);
>
> > Simulator::Destroy ();
>
> > }
>
> > =========================================
>
> >
>
>
More information about the Ns-developers
mailing list