examples/wifi-adhoc.cc
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 08 Jul 2008 10:43:58 -0700
changeset 3408 2cc40b3e4fa5
parent 3166 f65af41d30db
child 3888 a15618dcd0eb
permissions -rw-r--r--
python bindings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2005,2006,2007 INRIA
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
2739
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    21
#include "ns3/core-module.h"
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    22
#include "ns3/common-module.h"
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    23
#include "ns3/node-module.h"
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    24
#include "ns3/helper-module.h"
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    25
#include "ns3/mobility-module.h"
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
    26
#include "ns3/contrib-module.h"
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
#include <iostream>
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    30
NS_LOG_COMPONENT_DEFINE ("Main");
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    32
using namespace ns3;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    33
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    34
class Experiment
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
{
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    36
public:
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    37
  Experiment ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    38
  Experiment (std::string name);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    39
  GnuplotDataset Run (const WifiHelper &wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    40
private:
3100
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    41
  void ReceivePacket (Ptr<Socket> socket);
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    42
  void SetPosition (Ptr<Node> node, Vector position);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    43
  Vector GetPosition (Ptr<Node> node);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    44
  void AdvancePosition (Ptr<Node> node);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    45
  Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    46
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    47
  uint32_t m_bytesTotal;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    48
  GnuplotDataset m_output;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    49
};
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    50
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    51
Experiment::Experiment ()
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    52
  : m_output ()
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    53
{}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    54
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    55
Experiment::Experiment (std::string name)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    56
  : m_output (name)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    57
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    58
  m_output.SetStyle (GnuplotDataset::LINES);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
}
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    61
void
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    62
Experiment::SetPosition (Ptr<Node> node, Vector position)
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
{
2257
71a58e70c671 QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2252
diff changeset
    64
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
2115
4be7e10e471e merge with Position -> Vector rename
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2084
diff changeset
    65
  mobility->SetPosition (position);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
}
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    67
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    68
Vector
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    69
Experiment::GetPosition (Ptr<Node> node)
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
{
2257
71a58e70c671 QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2252
diff changeset
    71
  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
2115
4be7e10e471e merge with Position -> Vector rename
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2084
diff changeset
    72
  return mobility->GetPosition ();
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    73
}
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    74
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    75
void 
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    76
Experiment::AdvancePosition (Ptr<Node> node) 
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    77
{
2115
4be7e10e471e merge with Position -> Vector rename
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2084
diff changeset
    78
  Vector pos = GetPosition (node);
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    79
  double mbs = ((m_bytesTotal * 8.0) / 1000000);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    80
  m_bytesTotal = 0;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    81
  m_output.Add (pos.x, mbs);
2082
d041fc198aad a real test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2081
diff changeset
    82
  pos.x += 1.0;
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
    83
  if (pos.x >= 210.0) 
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
    84
    {
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
    85
      return;
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
    86
    }
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    87
  SetPosition (node, pos);
1971
2f9ca80a8d74 fix position printing code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1964
diff changeset
    88
  //std::cout << "x="<<pos.x << std::endl;
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    89
  Simulator::Schedule (Seconds (1.0), &Experiment::AdvancePosition, this, node);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    90
}
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    91
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
    92
void
3100
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    93
Experiment::ReceivePacket (Ptr<Socket> socket)
2068
af5f03746dbe add throughput printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2019
diff changeset
    94
{
3100
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    95
  Ptr<Packet> packet;
3103
91c6fce46125 overloaded Recv() method suggested by Gustavo
Tom Henderson <tomh@tomh.org>
parents: 3102
diff changeset
    96
  while (packet = socket->Recv ())
3100
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    97
    {
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    98
      m_bytesTotal += packet->GetSize ();
70b98532fe5c remove previous socket receive methods
Tom Henderson <tomh@tomh.org>
parents: 2997
diff changeset
    99
    }
2068
af5f03746dbe add throughput printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2019
diff changeset
   100
}
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   101
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   102
Ptr<Socket>
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   103
Experiment::SetupPacketReceive (Ptr<Node> node)
2068
af5f03746dbe add throughput printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2019
diff changeset
   104
{
3166
f65af41d30db the TypeId for Packet sockets is PacketSocketFactory, not PacketSocket. fix bug introduced by changeset c33b6d2775b7.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3116
diff changeset
   105
  TypeId tid = TypeId::LookupByName ("ns3::PacketSocketFactory");
3116
c33b6d2775b7 Move API for socket factory to a Socket::CreateSocket () factory method
Tom Henderson <tomh@tomh.org>
parents: 3103
diff changeset
   106
  Ptr<Socket> sink = Socket::CreateSocket (node, tid);
2152
5c6c0f580aca use packet sockets and generate all graphics
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2149
diff changeset
   107
  sink->Bind ();
3102
a225be367c1d more cleanup
Tom Henderson <tomh@tomh.org>
parents: 3100
diff changeset
   108
  sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this));
2068
af5f03746dbe add throughput printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2019
diff changeset
   109
  return sink;
af5f03746dbe add throughput printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2019
diff changeset
   110
}
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   112
GnuplotDataset
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   113
Experiment::Run (const WifiHelper &wifi)
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   114
{
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   115
  m_bytesTotal = 0;
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   116
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   117
  NodeContainer c;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   118
  c.Create (2);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   119
2739
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
   120
  PacketSocketHelper packetSocket;
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2784
diff changeset
   121
  packetSocket.Install (c);
2739
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
   122
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2784
diff changeset
   123
  NetDeviceContainer devices = wifi.Install (c);
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   124
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   125
  MobilityHelper mobility;
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2575
diff changeset
   126
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   127
  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   128
  positionAlloc->Add (Vector (5.0, 0.0, 0.0));
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   129
  mobility.SetPositionAllocator (positionAlloc);
2615
09e459167dc3 use the right position attribute name.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2614
diff changeset
   130
  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   131
2995
b72805b3ca69 Align helper API use of Install()
Tom Henderson <tomh@tomh.org>
parents: 2890
diff changeset
   132
  mobility.Install (c);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
2890
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   134
  PacketSocketAddress socket;
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   135
  socket.SetSingleDevice(devices.Get (0)->GetIfIndex ());
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   136
  socket.SetPhysicalAddress (devices.Get (1)->GetAddress ());
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   137
  socket.SetProtocol (1);
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   138
3166
f65af41d30db the TypeId for Packet sockets is PacketSocketFactory, not PacketSocket. fix bug introduced by changeset c33b6d2775b7.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3116
diff changeset
   139
  OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   140
  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (250)));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   141
  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   142
  onoff.SetAttribute ("DataRate", DataRateValue (DataRate (60000000)));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   143
  onoff.SetAttribute ("PacketSize", UintegerValue (2000));
2890
172baa5960ff rework app constructors
Craig Dowell <craigdo@ee.washington.edu>
parents: 2887
diff changeset
   144
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2784
diff changeset
   145
  ApplicationContainer apps = onoff.Install (c.Get (0));
2739
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
   146
  apps.Start (Seconds (0.5));
5234783968ff convert PacketSocket scripts to PacketSocketHelper.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2700
diff changeset
   147
  apps.Stop (Seconds (250.0));
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   149
  Simulator::Schedule (Seconds (1.5), &Experiment::AdvancePosition, this, c.Get (1));
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   150
  Ptr<Socket> recvSink = SetupPacketReceive (c.Get (1));
1973
96673851351e configure correctly the ipv4 layer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1971
diff changeset
   151
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   152
  Simulator::Run ();
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   153
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   154
  Simulator::Destroy ();
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   155
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   156
  return m_output;
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   157
}
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   158
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   159
int main (int argc, char *argv[])
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   160
{
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   161
  // disable fragmentation
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   162
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   163
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   164
2575
1aae382e65e2 rewrite CommandLine to not handle DefaultValues anymore.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2559
diff changeset
   165
  CommandLine cmd;
1aae382e65e2 rewrite CommandLine to not handle DefaultValues anymore.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2559
diff changeset
   166
  cmd.Parse (argc, argv);
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   167
2152
5c6c0f580aca use packet sockets and generate all graphics
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2149
diff changeset
   168
  Gnuplot gnuplot = Gnuplot ("reference-rates.png");
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   169
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   170
  Experiment experiment;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   171
  WifiHelper wifi;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   172
  GnuplotDataset dataset;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   173
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   174
  wifi.SetMac ("ns3::AdhocWifiMac");
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   175
  wifi.SetPhy ("ns3::WifiPhy");
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   176
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   177
  NS_LOG_DEBUG ("54");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   178
  experiment = Experiment ("54mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   179
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   180
                                "DataMode", StringValue ("wifia-54mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   181
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   182
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   183
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   184
  NS_LOG_DEBUG ("48");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   185
  experiment = Experiment ("48mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   186
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   187
                                "DataMode", StringValue ("wifia-48mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   188
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   189
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   190
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   191
  NS_LOG_DEBUG ("36");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   192
  experiment = Experiment ("36mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   193
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   194
                                "DataMode", StringValue ("wifia-36mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   195
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   196
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   197
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   198
  NS_LOG_DEBUG ("24");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   199
  experiment = Experiment ("24mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   200
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   201
                                "DataMode", StringValue ("wifia-24mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   202
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   203
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   204
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   205
  NS_LOG_DEBUG ("18");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   206
  experiment = Experiment ("18mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   207
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   208
                                "DataMode", StringValue ("wifia-18mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   209
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   210
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   211
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   212
  NS_LOG_DEBUG ("12");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   213
  experiment = Experiment ("12mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   214
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   215
                                "DataMode", StringValue ("wifia-12mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   216
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   217
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   218
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   219
  NS_LOG_DEBUG ("9");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   220
  experiment = Experiment ("9mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   221
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   222
                                "DataMode", StringValue ("wifia-9mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   223
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   224
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   225
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   226
  NS_LOG_DEBUG ("6");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   227
  experiment = Experiment ("6mb");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   228
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   229
                                "DataMode", StringValue ("wifia-6mbs"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   230
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   231
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   232
2152
5c6c0f580aca use packet sockets and generate all graphics
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2149
diff changeset
   233
  gnuplot.GenerateOutput (std::cout);
5c6c0f580aca use packet sockets and generate all graphics
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2149
diff changeset
   234
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   235
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   236
  gnuplot = Gnuplot ("rate-control.png");
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2890
diff changeset
   237
  Config::SetDefault ("ns3::WifiPhy::Standard", StringValue ("holland"));
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   238
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   239
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   240
  NS_LOG_DEBUG ("arf");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   241
  experiment = Experiment ("arf");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   242
  wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   243
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   244
  gnuplot.AddDataset (dataset);
2149
6bf08d8a8eff plot the goodput for each data rate separately
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2115
diff changeset
   245
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   246
  NS_LOG_DEBUG ("aarf");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   247
  experiment = Experiment ("aarf");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   248
  wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   249
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   250
  gnuplot.AddDataset (dataset);
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   251
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   252
  NS_LOG_DEBUG ("ideal");
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   253
  experiment = Experiment ("ideal");
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   254
  wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   255
  dataset = experiment.Run (wifi);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2494
diff changeset
   256
  gnuplot.AddDataset (dataset);
2152
5c6c0f580aca use packet sockets and generate all graphics
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2149
diff changeset
   257
2079
673a34d2e3d7 use the gnuplot machinery to output a set of plots
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2075
diff changeset
   258
  gnuplot.GenerateOutput (std::cout);
1884
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   259
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   260
  return 0;
6056f112404c build wifi sample code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   261
}