Throughput exceeding data rate

1,087 views
Skip to first unread message

Verotiana Hanitriniala Rabarijaona

unread,
Nov 13, 2009, 4:44:39 AM11/13/09
to ns-3-...@googlegroups.com
Hi!

I create an on/off application with this code

 OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (100)));
  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
  onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6e6)));
  onoff.SetAttribute ("PacketSize", UintegerValue (1500));

In this configuration, the on time is 100s but what is the packet birth rate or packet arrival rate at the Mac layer?

Then I install the same application on 4 different nodes :

 ApplicationContainer apps = onoff.Install (stas.Get (0));
  apps.Start (Seconds (0.1));
  apps.Stop (Seconds (101.0));

  ApplicationContainer apps1 = onoff.Install (stas.Get (1));
  apps1.Start (Seconds (0.1));
  apps1.Stop (Seconds (101.0));

  ApplicationContainer apps2 = onoff.Install (stas.Get (2));
  apps2.Start (Seconds (0.1));
  apps2.Stop (Seconds (101.0));

  ApplicationContainer apps3 = onoff.Install (stas.Get (3));
  apps3.Start (Seconds (0.1));
  apps3.Stop (Seconds (101.0));

However even if the data rate is 6Mbps, the throughput I get at the receiver is which is technically not possible.

Time 0 Throughput 0 Mbps
Time 10 Throughput 14.3141 Mbps
Time 20 Throughput 12.9225 Mbps
Time 30 Throughput 7.81402 Mbps
Time 40 Throughput 7.6229 Mbps
Time 50 Throughput 7.66871 Mbps
Time 60 Throughput 8.41788 Mbps
Time 70 Throughput 9.6974 Mbps
Time 80 Throughput 10.4933 Mbps
Time 90 Throughput 10.8762 Mbps
Time 100 Throughput 10.578 Mbps

Does anyone know what would cause that?

Thanks in advance,

V.

duy

unread,
Nov 13, 2009, 12:09:59 PM11/13/09
to ns-3-users
It looks like aggregate throughput, how do you calculate it? can you
post your full script?

On Nov 13, 1:44 am, Verotiana Hanitriniala Rabarijaona

Verotiana Hanitriniala Rabarijaona

unread,
Nov 15, 2009, 10:42:08 PM11/15/09
to ns-3-...@googlegroups.com
I use the following functions to calculate the throughput :

static void
Throughput () // in seconds
{
  double mbps = (((m_bytesTotal * 8.0) / 1000000)/10);
  Time time = Simulator::Now ();
  m_bytesTotal = 0;
  std::cout << "Time "<< time.GetSeconds() << " Throughput "<< mbps << " Mbps "<< std::endl;
  Simulator::Schedule (Seconds (10), &Throughput);
}

//calculate the received payload at the receiver
void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
{
  Ptr<Packet> m_currentPacket;
  WifiMacHeader hdr;
  m_currentPacket = packet->Copy();
  m_currentPacket->RemoveHeader (hdr);

      m_bytesTotal += m_currentPacket->GetSize ();
    
  }
}

I looked into my code and I found out that the problem was the rate control algorithm. I used the Arfwifimanager. When I use the
ConstantRateWifiManager I have throughput under 6Mbps.
I think this is because in the ARF algorithm, the data rate is increased when there is no error for a certain duration, hence the increased throughput. Am I mistaken?

So in that case, the rate defined in the OnOffApplication is the arrival rate of the packets at the nodes and not the data rate for communication. Am I correct?

Thanks

V.


LAU

unread,
Nov 16, 2009, 11:03:42 AM11/16/09
to ns-3-users
Hi Verotiana,

I am also dealing with the measurement of throughput of wireless
nodes. But I am in trouble in how to calculate the throughput in NS3.
I think your method is very useful. May I have your full code.

Regards,
Vincent

On Nov 16, 11:42 am, Verotiana Hanitriniala Rabarijaona

Verotiana Hanitriniala Rabarijaona

unread,
Nov 17, 2009, 12:06:10 AM11/17/09
to ns-3-...@googlegroups.com

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

#include "ns3/core-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
#include "ns3/simulator-module.h"

#include "ns3/node-module.h"
#include "ns3/wifi-module.h"
#include "ns3/common-module.h"

#include <fstream>
#include <iostream>
#include <iomanip>

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("MainRandomWalk");

static uint32_t m_bytesTotal;

static void
Throughput () // in Mbps calculated every 10s
{

  double mbps = (((m_bytesTotal * 8.0) / 1000000)/10);
  Time time = Simulator::Now ();
  m_bytesTotal = 0;
 
  Simulator::Schedule (Seconds (10), &Throughput);
}


void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
{
  Ptr<Packet> m_currentPacket;
  WifiMacHeader hdr;
  m_currentPacket = packet->Copy();
  m_currentPacket->RemoveHeader (hdr);
 
   if (hdr.IsData()){

        m_bytesTotal += m_currentPacket->GetSize ();
  }
}


int main (int argc, char *argv[])
{

  // enable rts cts all the time.
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
  // disable fragmentation
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("3000"));

  Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", DoubleValue(2));

  CommandLine cmd;
  cmd.Parse (argc, argv);

  NodeContainer c;
  c.Create (3);

  //-------------------Mobility Management--------------//
  MobilityHelper mobility;
  mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator",
                                 "X", StringValue ("100.0"),
                                 "Y", StringValue ("100.0"),
                                 "Rho", StringValue ("Uniform:0:30"));
  mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
                             "Mode", StringValue ("Time"),
                             "Time", StringValue ("2s"),
                             "Speed", StringValue ("Constant:1.0"),
                             "Bounds", StringValue ("0|200|0|200"));
  mobility.Install (c);
  //-------------------Fin Mobility Management--------------//


  WifiHelper wifi = WifiHelper::Default ();
  NetDeviceContainer staDevs;
  PacketSocketHelper packetSocket;
  // give packet socket powers to nodes.
  packetSocket.Install (c);

  NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
  wifiPhy.SetChannel (wifiChannel.Create ());
  Ssid ssid = Ssid ("wifi-default");
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
                                "DataMode", StringValue ("wifia-54mbs"));

  // setup stas.
  wifiMac.SetType ("ns3::AdhocWifiMac");
  staDevs = wifi.Install (wifiPhy, wifiMac, c);

  //-----------Tx T1->T3---------------//
  PacketSocketAddress socket;
  socket.SetSingleDevice(staDevs.Get (0)->GetIfIndex ());       //source
  socket.SetPhysicalAddress (staDevs.Get (2)->GetAddress ());   //destination
  socket.SetProtocol (1);

  OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket)); //destination T3
  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (2)));

  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
  onoff.SetAttribute ("DataRate", DataRateValue (DataRate (54e6)));
  onoff.SetAttribute ("PacketSize", UintegerValue (2250));

  ApplicationContainer apps = onoff.Install (c.Get(0));     //source T1
  apps.Start (Seconds (0.5));
  apps.Stop (Seconds (2.0));
  ApplicationContainer apps2 = onoff.Install (c.Get(1));     //source T2
  apps2.Start (Seconds (0.5));
  apps2.Stop (Seconds (2.0));
  //-----------Tx T1->T3---------------//

 //Trace the received packets at the chosen terminal
  Config::Connect ("/NodeList/2/DeviceList/*/Phy/State/RxOk", MakeCallback (&PhyRxOkTrace));
 
  Throughput ();

  Simulator::Stop (Seconds (301.0));

  Simulator::Run ();
  Simulator::Destroy();

  return 0;
}

V.

2009/11/17 LAU <egl...@gmail.com>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en
-~----------~----~----~----~------~----~------~--~---




--
***************************
RABARIJAONA Verotiana Hanitriniala
Graduate School of Global Information and Telecommunication Studies (GITS)
Waseda University
Tokyo
Japan
***************************

LAU

unread,
Nov 17, 2009, 6:39:38 AM11/17/09
to ns-3-users
Dear RABARIJAONA Verotiana Hanitriniala,

Thank for your help. Your code can help me to understand the
measurement part.
It is hoped that you can get answer from other users soon.

Regards,
Vincent

On Nov 17, 1:06 pm, Verotiana Hanitriniala Rabarijaona
> 2009/11/17 LAU <egls...@gmail.com>
> > ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>

vaibhav tayal

unread,
Dec 2, 2009, 6:32:50 AM12/2/09
to ns-3-...@googlegroups.com
Which analysis tool you are using...Can I know the details of it...
Regards
Vaibhav Tayal




V.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com

Verotiana Hanitriniala Rabarijaona

unread,
Dec 2, 2009, 8:23:04 AM12/2/09
to ns-3-...@googlegroups.com
What do you mean by analysis tool.
You can see the code in the previous email.

V.

2009/12/2 vaibhav tayal <vaibhav...@gmail.com>

--

You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--

Patxi Azpiroz

unread,
Feb 24, 2010, 12:51:40 PM2/24/10
to Verotiana Hanitriniala Rabarijaona, ns-3-...@googlegroups.com
Hi Verotiana:
I think that it get it.
You created an OnOffApplication but you installed it in 4 different
nodes, thus you have 4 identical applications working at the same
time. Is you are working on wifia-54mbs, is normal to have a total
throughput above from 6Mbps.

Regards,

Patxi


On Dec 2 2009, 2:23 pm, Verotiana Hanitriniala Rabarijaona


<rabarijaona.veroti...@gmail.com> wrote:
> What do you mean by analysis tool.
> You can see the code in the previous email.
>
> V.
>

> 2009/12/2 vaibhav tayal <vaibhavtaya...@gmail.com>

> >> ns-3-users+...@googlegroups.com<ns-3-users%2Bunsubscribe@googlegrou ps.com>


> >> For more options, visit this group at
> >>http://groups.google.com/group/ns-3-users?hl=en
> >> -~----------~----~----~----~------~----~------~--~---
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "ns-3-users" group.
> > To post to this group, send email to ns-3-...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > ns-3-users+...@googlegroups.com<ns-3-users%2Bunsubscribe@googlegrou ps.com>

ankush

unread,
Mar 5, 2010, 11:05:44 PM3/5/10
to ns-3-users
hi i tried to plugin the throughput in the code i am posting but i am
not getting throughput can someone please guide me

Waf: Entering directory `/home/ankush/ns-allinone-3.7/ns-3.7/build'
[378/788] cxx: scratch/help.cc -> build/debug/scratch/help_5.o
[786/788] cxx_link: build/debug/scratch/help_5.o -> build/debug/
scratch/help
Waf: Leaving directory `/home/ankush/ns-allinone-3.7/ns-3.7/build'
'build' finished successfully (3.833s)
Time 0 Throughput 0Mbps
Time 10 Throughput 0Mbps
Time 20 Throughput 0Mbps
Time 30 Throughput 0Mbps
Time 40 Throughput 0Mbps

/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */

/*
* Copyright (c) 2005,2006,2007 INRIA
*
* 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 Temple Place, Suite 330, Boston, MA
02111-1307 USA
*
* Author: Mathieu Lacage <mathieu...@sophia.inria.fr>
*/


#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/athstats-helper.h"

#include <iostream>

using namespace ns3;

static bool g_verbose = true;
static uint32_t m_bytesTotal;

void
DevTxTrace (std::string context, Ptr<const Packet> p)
{
if (g_verbose)
{
std::cout << " TX p: " << *p << std::endl;
}
}
void
DevRxTrace (std::string context, Ptr<const Packet> p)
{
if (g_verbose)
{
std::cout << " RX p: " << *p << std::endl;


}
}
void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double
snr, WifiMode mode, enum WifiPreamble preamble)
{

if (g_verbose)
{
std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " <<
*packet << std::endl;
}
Ptr<Socket> socket;

while (packet = socket->Recv ())
{
m_bytesTotal += packet->GetSize ();
//NS_LOG_INFO ("m_bytesTotal: "<< m_bytesTotal);
//std::cout << "m_bytesTotal: "<< m_bytesTotal << std::endl;
}


}
void
PhyRxErrorTrace (std::string context, Ptr<const Packet> packet, double
snr)
{
if (g_verbose)
{
std::cout << "PHYRXERROR snr=" << snr << " " << *packet <<
std::endl;
}
}
void
PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode
mode, WifiPreamble preamble, uint8_t txPower)
{
if (g_verbose)
{
std::cout << "PHYTX mode=" << mode << " " << *packet <<
std::endl;
}
}
void
PhyStateTrace (std::string context, Time start, Time duration, enum
WifiPhy::State state)
{
if (g_verbose)
{
std::cout << " state=" << state << " start=" << start << "
duration=" << duration << std::endl;
}
}

static void
SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}

static Vector
GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}

static void
AdvancePosition (Ptr<Node> node)
{
Vector pos = GetPosition (node);
pos.x += 5.0;
if (pos.x >= 210.0)
{
return;
}
SetPosition (node, pos);

if (g_verbose)
{
//std::cout << "x="<<pos.x << std::endl;
}
Simulator::Schedule (Seconds (1.0), &AdvancePosition, node);


}
static void
Throughput () // in seconds
{
double mbps = (((m_bytesTotal * 8.0) / 1000000)/10);
Time time = Simulator::Now ();
m_bytesTotal = 0;
std::cout << "Time "<< time.GetSeconds() << " Throughput "<< mbps <<
"Mbps "<< std::endl;
Simulator::Schedule (Seconds (10), &Throughput);

}

/*class Test{

public:
void Throughput(double interval);
void ReceivePacket (Ptr<Socket> socket);
void ReceivePacket (Ptr<Socket> socket);
Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
uint32_t m_bytesTotal;
Gnuplot2dDataset m_output;
};
void Test:: Throughput (double interval) // in seconds
{

double rate = (((m_bytesTotal * 8.0) / 1000000)/interval);


Time time = Simulator::Now ();

// m_bytesTotal = 0;
std::cout<< "Time "<< time << " Throughput "<< rate << " Mbps
"<<std::endl;
//NS_LOG_INFO ("Time "<< time << " Throughput "<< rate << " Mbps ");
m_output.Add (time.GetSeconds (), rate);
Simulator::Schedule (Seconds (interval), &Test::Throughput ,this,
interval);

}

void
TestNet::ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_INFO ("Receive Packet: socket "<< socket);
Ptr<Packet> packet;
while (packet = socket->Recv ())
{
m_bytesTotal += packet->GetSize ();
NS_LOG_INFO ("m_bytesTotal: "<< m_bytesTotal);
}

}

Ptr<Socket>
TestNet::SetupPacketReceive (Ptr<Node> node)
{
NS_LOG_INFO ("Setup Packet Receive - ID: " << node->GetId ());
TypeId tid = TypeId::LookupByName ("ns3::PacketSocketFactory");
Ptr<Socket> sink = Socket::CreateSocket (node, tid);
sink->Bind ();
sink->SetRecvCallback (MakeCallback (&TestNet::ReceivePacket,this));
return sink;

}
*/


int main (int argc, char *argv[])
{

CommandLine cmd;
cmd.AddValue ("verbose", "Print trace information if true",
g_verbose);

cmd.Parse (argc, argv);

Packet::EnablePrinting ();

// enable rts cts all the time.
Config::SetDefault
("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
// disable fragmentation
Config::SetDefault
("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue

("2200"));

WifiHelper wifi = WifiHelper::Default ();

MobilityHelper mobility;
NodeContainer stas;
NodeContainer ap;
NetDeviceContainer staDevs;
PacketSocketHelper packetSocket;

stas.Create (2);
ap.Create (1);

// give packet socket powers to nodes.

packetSocket.Install (stas);
packetSocket.Install (ap);

NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default
();
wifiPhy.SetChannel (wifiChannel.Create ());
Ssid ssid = Ssid ("wifi-default");

wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
// setup stas.
wifiMac.SetType ("ns3::NqstaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
staDevs = wifi.Install (wifiPhy, wifiMac, stas);
// setup ap.
wifiMac.SetType ("ns3::NqapWifiMac", "Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue (Seconds (2.5)));
wifi.Install (wifiPhy, wifiMac, ap);

// mobility.
mobility.Install (stas);
mobility.Install (ap);

Simulator::Schedule (Seconds (1.0), &AdvancePosition, ap.Get (0));

PacketSocketAddress socket;
socket.SetSingleDevice(staDevs.Get (0)->GetIfIndex ());

socket.SetPhysicalAddress (staDevs.Get (1)->GetAddress ());
socket.SetProtocol (1);

OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable

(42)));


onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable
(0)));

ApplicationContainer apps = onoff.Install (stas.Get (0));
apps.Start (Seconds (0.5));
apps.Stop (Seconds (43.0));

Simulator::Stop (Seconds (44.0));

//Config::Connect ("/NodeList/*/DeviceList/*/Mac/MacTx",
MakeCallback (&DevTxTrace));
//Config::Connect ("/NodeList/*/DeviceList/*/Mac/MacRx",
MakeCallback (&DevRxTrace));
//Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxOk",
MakeCallback (&PhyRxOkTrace));
//Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxError",
MakeCallback (&PhyRxErrorTrace));
//Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/Tx",
MakeCallback (&PhyTxTrace));
//Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/State",
MakeCallback (&PhyStateTrace));
Throughput();
// Test test;
//test.Throughput(0.01);
/*AthstatsHelper athstats;
athstats.EnableAthstats("athstats-sta", stas);
athstats.EnableAthstats("athstats-ap", ap);
*/
Simulator::Run ();

Simulator::Destroy ();

return 0;
}

//calculate the received payload at the receiver


On Feb 24, 10:51 pm, Patxi Azpiroz <patxiazpi...@gmail.com> wrote:
> Hi Verotiana:
> I think that it get it.
> You created an OnOffApplication but you installed it in 4 different
> nodes, thus you have 4 identical applications working at the same

> time. Is you are working on wifia-54mbs, is normal to have a totalthroughputabove from 6Mbps.

> > >> However even if the data rate is 6Mbps, thethroughputI get at the


> > >> receiver is which is technically not possible.
>
> > >> Time 0Throughput0 Mbps
> > >> Time 10Throughput14.3141 Mbps
> > >> Time 20Throughput12.9225 Mbps
> > >> Time 30Throughput7.81402 Mbps
> > >> Time 40Throughput7.6229 Mbps
> > >> Time 50Throughput7.66871 Mbps
> > >> Time 60Throughput8.41788 Mbps
> > >> Time 70Throughput9.6974 Mbps
> > >> Time 80Throughput10.4933 Mbps
> > >> Time 90Throughput10.8762 Mbps

> > >> Time 100Throughput10.578 Mbps

ankush

unread,
Mar 7, 2010, 1:23:01 AM3/7/10
to ns-3-users
hi here is my output

Time 0 Throughput 0Mbps
Time 10 Throughput 0.485853Mbps
Time 20 Throughput 0.511843Mbps
Time 30 Throughput 0.511843Mbps
Time 40 Throughput 0.0997696Mbps
Time 50 Throughput 0Mbps
Time 60 Throughput 0Mbps
Time 70 Throughput 0Mbps
Time 80 Throughput 0Mbps
Time 90 Throughput 0Mbps

why isnt it simulating beyond 40

i tried changing all start stop parametres

>  * Author: Mathieu Lacage <mathieu.lac...@sophia.inria.fr>

> ...
>
> read more »

Lalith Suresh

unread,
Mar 7, 2010, 2:10:55 AM3/7/10
to ns-3-...@googlegroups.com
Hi Ankush,

You sure you changed Simulator::Stop (Seconds (44.0))?

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
Thanks and regards,
Lalith Suresh
Department of Computer Engineering
Malaviya National Institute of Technology, Jaipur
+91-9982190365 , www.lalith.in

Verotiana Hanitriniala Rabarijaona

unread,
Mar 7, 2010, 2:24:14 AM3/7/10
to ns-3-...@googlegroups.com
You're function PhyRxOkTrace is wrong i think. You don't need to use a new socket. The callback itself tells you when a packet is received at the socket. Try

void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double
snr, WifiMode mode, enum WifiPreamble preamble)
{
 if (g_verbose)
   {
     std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " <<
*packet << std::endl;
   }
  
     m_bytesTotal += packet->GetSize ();
     //NS_LOG_INFO ("m_bytesTotal:  "<< m_bytesTotal);
     //std::cout << "m_bytesTotal:  "<< m_bytesTotal << std::endl;

}


2010/3/7 Lalith Suresh <suresh...@gmail.com>



--

ankush

unread,
Mar 7, 2010, 2:43:28 AM3/7/10
to ns-3-users
thanx a ton
here is my output can u please tell me whether it is intuitively
correct or something is wrong?

me 0 Throughput 0Mbps
Time 2 Throughput 1.64787Mbps
Time 4 Throughput 0.000512Mbps
Time 6 Throughput 0.000512Mbps
Time 8 Throughput 0.000512Mbps
Time 10 Throughput 0Mbps
Time 12 Throughput 0.000512Mbps
Time 14 Throughput 0.000512Mbps
Time 16 Throughput 0.000512Mbps
Time 18 Throughput 0.000512Mbps
Time 20 Throughput 0Mbps
Time 22 Throughput 0.000512Mbps
Time 24 Throughput 0.000512Mbps
Time 26 Throughput 0.000512Mbps
Time 28 Throughput 0.000512Mbps
Time 30 Throughput 0Mbps
Time 32 Throughput 0.000512Mbps
Time 34 Throughput 0.000256Mbps
Time 36 Throughput 0Mbps
Time 38 Throughput 0Mbps
Time 40 Throughput 0Mbps
Time 42 Throughput 0Mbps
Time 44 Throughput 0Mbps
Time 46 Throughput 0Mbps
Time 48 Throughput 0Mbps
Time 50 Throughput 0Mbps
Time 52 Throughput 0Mbps
Time 54 Throughput 0Mbps
Time 56 Throughput 0.004368Mbps
Time 58 Throughput 0.010608Mbps
Time 60 Throughput 0.01664Mbps
Time 62 Throughput 0.01664Mbps
Time 64 Throughput 0.01664Mbps
Time 66 Throughput 0.01664Mbps
Time 68 Throughput 0.01664Mbps
Time 70 Throughput 0.01664Mbps
Time 72 Throughput 0.01664Mbps
Time 74 Throughput 0.01664Mbps
Time 76 Throughput 0.01664Mbps
Time 78 Throughput 0.01664Mbps
Time 80 Throughput 0.01664Mbps
Time 82 Throughput 0.01664Mbps
Time 84 Throughput 0.01664Mbps
Time 86 Throughput 0.01664Mbps
Time 88 Throughput 0.01664Mbps
Time 90 Throughput 0.01664Mbps
Time 92 Throughput 0.01664Mbps
Time 94 Throughput 0.01664Mbps
Time 96 Throughput 0.01664Mbps
Time 98 Throughput 0.01664Mbps
Time 100 Throughput 0.01664Mbps
Time 102 Throughput 0.01664Mbps
Time 104 Throughput 0.01664Mbps
Time 106 Throughput 0.01664Mbps
Time 108 Throughput 0.01664Mbps
Time 110 Throughput 0.01664Mbps
Time 112 Throughput 0.01664Mbps
Time 114 Throughput 0.01664Mbps
Time 116 Throughput 0.01664Mbps
Time 118 Throughput 0.01664Mbps
Time 120 Throughput 0.01664Mbps
Time 122 Throughput 0.01664Mbps
Time 124 Throughput 0.01664Mbps
Time 126 Throughput 0.01664Mbps
Time 128 Throughput 0.01664Mbps
Time 130 Throughput 0.01664Mbps
Time 132 Throughput 0.01664Mbps
Time 134 Throughput 0.01664Mbps
Time 136 Throughput 0.01664Mbps
Time 138 Throughput 0.01664Mbps
Time 140 Throughput 0.01664Mbps
Time 142 Throughput 0.01664Mbps


On Mar 7, 12:24 pm, Verotiana Hanitriniala Rabarijaona


<rabarijaona.veroti...@gmail.com> wrote:
> You're function PhyRxOkTrace is wrong i think. You don't need to use a new
> socket. The callback itself tells you when a packet is received at the
> socket. Try
>
> void
> PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double
> snr, WifiMode mode, enum WifiPreamble preamble)
> {
>  if (g_verbose)
>    {
>      std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " <<
> *packet << std::endl;
>    }
>
>      m_bytesTotal += packet->GetSize ();
>      //NS_LOG_INFO ("m_bytesTotal:  "<< m_bytesTotal);
>      //std::cout << "m_bytesTotal:  "<< m_bytesTotal << std::endl;
>
> }
>

> 2010/3/7 Lalith Suresh <suresh.lal...@gmail.com>


>
> > Hi Ankush,
>
> > You sure you changed Simulator::Stop (Seconds (44.0))?
>

> ...
>
> read more »

ankush

unread,
Mar 7, 2010, 2:57:02 AM3/7/10
to ns-3-users
there is another problem with or without RTS it is showing the same
throughput...

> ...
>
> read more »

ankush

unread,
Mar 7, 2010, 4:45:03 AM3/7/10
to ns-3-users
ok the thru put varies as we increase the number of stations

> ...
>
> read more »

Verotiana Hanitriniala Rabarijaona

unread,
Mar 7, 2010, 8:59:17 PM3/7/10
to ns-3-...@googlegroups.com
You're throughput you get is correct. It's very low because you didn't set the data bit rate and the default value is 500b/s.
To get higher throughput you have to increase this bit rate.

2010/3/7 ankush <anks...@gmail.com>
> ...
>
> read more »

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

ankush

unread,
Mar 8, 2010, 1:03:23 AM3/8/10
to ns-3-...@googlegroups.com
thanx....
without fear|without remorse|without pity

Reply all
Reply to author
Forward
0 new messages