sat-profiling-sim.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 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/config-store-module.h"
24 #include "ns3/core-module.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/network-module.h"
27 #include "ns3/satellite-module.h"
28 #include "ns3/traffic-module.h"
29 
30 using namespace ns3;
31 
42 NS_LOG_COMPONENT_DEFINE("sat-profiling-sim");
43 
44 int
45 main(int argc, char* argv[])
46 {
47  LogComponentEnable("CbrApplication", LOG_LEVEL_INFO);
48  LogComponentEnable("PacketSink", LOG_LEVEL_INFO);
49 
50  uint32_t utsPerBeam(1);
51  uint32_t endUsersPerUt(1);
52  double simulationTime(10.0);
53 
54  Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>("sat-profiling-sim");
55 
56  simulationHelper->SetDefaultValues();
57  simulationHelper->SetUtCountPerBeam(utsPerBeam);
58  simulationHelper->SetUserCountPerUt(endUsersPerUt);
59  simulationHelper->SetSimulationTime(simulationTime);
60 
61  simulationHelper->SetBeams("48");
62  Ptr<SatHelper> helper = simulationHelper->CreateSatScenario();
63 
64  // ----------------------------------
65  // ----- CREATE CBR APPLICATION -----
66  // ----------------------------------
67  NodeContainer utUsers = helper->GetUtUsers();
68 
69  NS_ASSERT(utUsers.GetN() == 1);
70 
71  Config::SetDefault("ns3::CbrApplication::PacketSize", UintegerValue(64));
72  Config::SetDefault("ns3::CbrApplication::Interval", TimeValue(Seconds(2)));
73  simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
76  Seconds(1));
77  simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
80  Seconds(1));
81  // ----------------------------------
82  // ----- CREATE CBR APPLICATION -----
83  // ----------------------------------
84 
85  simulationHelper->CreateDefaultRtnLinkStats();
86  simulationHelper->EnableProgressLogs();
87  simulationHelper->RunSimulation();
88 
89  return 0;
90 }
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.