--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
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
--
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.For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
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>
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
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 »
--
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.
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 »
> ...
>
> read more »
> ...
>
> read more »
> ...
>
> 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.