tutorial/tutorial-linear-dumbbell.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 17 Apr 2008 15:40:25 -0700
changeset 2971 75780f899be3
parent 2965 4b28e9740e3b
child 2997 caf9d364c6fc
permissions -rw-r--r--
output the initial value of the attributes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * This program is free software; you can redistribute it and/or modify
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 * it under the terms of the GNU General Public License version 2 as
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * published by the Free Software Foundation;
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 *
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * This program is distributed in the hope that it will be useful,
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * GNU General Public License for more details.
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 *
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * You should have received a copy of the GNU General Public License
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 * along with this program; if not, write to the Free Software
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 */
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    17
#include <fstream>
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    18
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    19
#include "ns3/core-module.h"
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    20
#include "ns3/node-module.h"
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    21
#include "ns3/helper-module.h"
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    22
#include "ns3/simulator-module.h"
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#include "ns3/global-route-manager.h"
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    24
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
1539
69d32521f6b8 tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 1529
diff changeset
    26
NS_LOG_COMPONENT_DEFINE ("DumbbellSimulation");
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
using namespace ns3;
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
// Network topology
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
//
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
//                       point to point
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
//                      +--------------+
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
//                      |              |
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
//       n0   n1   n2   n3             n4   n5   n6   n7
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
//       |    |    |    |              |    |    |    |
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
//       ================              ================
1539
69d32521f6b8 tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 1529
diff changeset
    38
//             lan1                          lan2
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
//
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
int 
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
main (int argc, char *argv[])
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
{
1539
69d32521f6b8 tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 1529
diff changeset
    43
  LogComponentEnable ("DumbbellSimulation", LOG_LEVEL_INFO);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
1539
69d32521f6b8 tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 1529
diff changeset
    45
  NS_LOG_INFO ("Dumbbell Topology Simulation");
1843
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    46
//
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    47
// Create the lan on the left side of the dumbbell.
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    48
//
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    49
  NodeContainer lan1;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    50
  lan1.Create (4);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    52
  InternetStackHelper internet;
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
    53
  internet.Install (lan1);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    54
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    55
  CsmaHelper csma;
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    56
  csma.SetChannelParameter ("BitRate", StringValue ("10Mbps"));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    57
  csma.SetChannelParameter ("Delay", StringValue ("2ms"));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
    58
  NetDeviceContainer dev1 = csma.Install (lan1);
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    59
  Ipv4AddressHelper ipv4;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    60
  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
2888
872dc8466352 Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    61
  Ipv4InterfaceContainer i1 = ipv4.Assign (dev1);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
1843
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    64
//
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    65
// Create the lan on the right side of the dumbbell.
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    66
//
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    67
  NodeContainer lan2;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    68
  lan2.Create (4);
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
    69
  internet.Install (lan2);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
    71
  NetDeviceContainer dev2 = csma.Install (lan2);
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    72
  ipv4.SetBase ("10.1.2.0", "255.255.255.0");
2888
872dc8466352 Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    73
  Ipv4InterfaceContainer i2 = ipv4.Assign (dev2);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
1843
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    76
//
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    77
// Create the point-to-point link to connect the two lans.
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    78
//
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    79
  NodeContainer backbone = NodeContainer (lan1.Get (3), lan2.Get (0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    80
  PointToPointHelper p2p;
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    81
  p2p.SetChannelParameter ("BitRate", StringValue ("38400bps"));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    82
  p2p.SetChannelParameter ("Delay", StringValue ("20ms"));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
    83
  NetDeviceContainer dev3 = p2p.Install (backbone);
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    84
  ipv4.SetBase ("10.1.3.0", "255.255.255.0");
2888
872dc8466352 Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2887
diff changeset
    85
  ipv4.Assign (dev3);
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    86
1843
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    87
//
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    88
// Create data flows across the link:
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    89
//   n0 ==> n4 ==> n0
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    90
//   n1 ==> n5 ==> n1
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    91
//   n2 ==> n6 ==> n2
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    92
//   n3 ==> n7 ==> n3
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
    93
//
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
  uint16_t port = 7;
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    96
  UdpEchoClientHelper client;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    97
  client.SetRemote (i2.GetAddress (0), port);
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    98
  client.SetAppAttribute ("MaxPackets", UintegerValue (100));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
    99
  client.SetAppAttribute ("Interval", StringValue ("10ms"));
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2888
diff changeset
   100
  client.SetAppAttribute ("PacketSize", UintegerValue (1024));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   101
  ApplicationContainer apps = client.Install (lan1.Get (0));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   102
  apps.Start (Seconds(2.));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   103
  apps.Stop (Seconds (10.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   104
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   105
  client.SetRemote (i2.GetAddress (1), port);
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   106
  apps = client.Install (lan1.Get (1));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   107
  apps.Start (Seconds(2.1));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   108
  apps.Stop (Seconds (10.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   109
  
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   110
  client.SetRemote (i2.GetAddress (2), port);
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   111
  apps = client.Install (lan1.Get (2));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   112
  apps.Start (Seconds(2.2));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   113
  apps.Stop (Seconds (10.0));
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   115
  client.SetRemote (i2.GetAddress (3), port);
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   116
  apps = client.Install (lan1.Get (3));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   117
  apps.Start (Seconds(2.3));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   118
  apps.Stop (Seconds (10.0));
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
1843
1267bcc23b04 tutorial topologies
Craig Dowell <craigdo@ee.washington.edu>
parents: 1839
diff changeset
   120
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   121
  UdpEchoServerHelper server;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   122
  server.SetPort (port);
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   123
  apps = server.Install (lan2.Get (0));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   124
  apps.Start (Seconds (1.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   125
  apps.Stop (Seconds (10.0));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   126
  apps = server.Install (lan2.Get (1));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   127
  apps.Start (Seconds (1.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   128
  apps.Stop (Seconds (10.0));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   129
  apps = server.Install (lan2.Get (2));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   130
  apps.Start (Seconds (1.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   131
  apps.Stop (Seconds (10.0));
2887
9a637e6daee0 Build -> Install
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2837
diff changeset
   132
  apps = server.Install (lan2.Get (3));
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   133
  apps.Start (Seconds (1.0));
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   134
  apps.Stop (Seconds (10.0));
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
  GlobalRouteManager::PopulateRoutingTables ();
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   138
  std::ofstream os;
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   139
  os.open ("tutorial.tr");
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   140
  PointToPointHelper::EnableAscii (os);
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   141
  CsmaHelper::EnableAscii (os);
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   142
2837
67b88d7bad6c change pcap filename template to be slightly more coherent.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2812
diff changeset
   143
  PointToPointHelper::EnablePcap ("tutorial");
67b88d7bad6c change pcap filename template to be slightly more coherent.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2812
diff changeset
   144
  CsmaHelper::EnablePcap ("tutorial");
2812
5f2d7dcb31d2 port to helper API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   145
1529
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
  Simulator::Run ();
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
  Simulator::Destroy ();
042ae54d795c tutorial files
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
}