sat-rtn-link-da-example.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jani Puttonen <jani.puttonen@magister.fi>
19  *
20  */
21 
22 #include "ns3/applications-module.h"
23 #include "ns3/core-module.h"
24 #include "ns3/internet-module.h"
25 #include "ns3/network-module.h"
26 #include "ns3/satellite-module.h"
27 #include "ns3/traffic-module.h"
28 
29 using namespace ns3;
30 
38 NS_LOG_COMPONENT_DEFINE("sat-rtn-link-da-example");
39 
40 int
41 main(int argc, char* argv[])
42 {
43  uint32_t endUsersPerUt(3);
44  uint32_t utsPerBeam(3);
45  Time simLength(Seconds(50.0));
46 
47  std::string simulationName = "sat-rtn-link-da-example";
48  auto simulationHelper = CreateObject<SimulationHelper>(simulationName);
49 
50  // read command line parameters given by user
51  CommandLine cmd;
52  cmd.AddValue("endUsersPerUt", "Number of end users per UT", endUsersPerUt);
53  cmd.AddValue("utsPerBeam", "Number of UTs per spot-beam", utsPerBeam);
54  simulationHelper->AddDefaultUiArguments(cmd);
55  cmd.Parse(argc, argv);
56 
57  simulationHelper->SetDefaultValues();
58  simulationHelper->SetUtCountPerBeam(utsPerBeam);
59  simulationHelper->SetUserCountPerUt(endUsersPerUt);
60  simulationHelper->SetSimulationTime(simLength.GetSeconds());
61  simulationHelper->EnableOnlyRbdc(3);
62 
63  simulationHelper->SetBeams("1 3 5 7 9 22 24 26 28 30 44 46 48 50 59 61 70 72");
64 
65  /* Simulation tags *****************************************************************/
66 
67  std::stringstream sstag;
68  sstag << simulationName << "UTs=" << utsPerBeam;
69  simulationHelper->SetOutputTag(sstag.str());
70 
71  // Create satellite scenario
72  simulationHelper->CreateSatScenario();
73 
74  // >>> Start of actual test using Full scenario >>>
75  Config::SetDefault("ns3::CbrApplication::Interval", TimeValue(MilliSeconds(5)));
76  Config::SetDefault("ns3::CbrApplication::PacketSize", UintegerValue(128));
77  simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
80  Seconds(1),
81  simLength,
82  Seconds(0.05));
83 
84  // Create RTN link statistics
85  simulationHelper->CreateDefaultRtnLinkStats();
86 
87  // Enable logs
88  simulationHelper->EnableProgressLogs();
89 
90  // Run
91  simulationHelper->RunSimulation();
92 
93  return 0;
94 }
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.