sat-handover-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: Bastien TAURAN <bastien.tauran@viveris.fr>
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 
40 NS_LOG_COMPONENT_DEFINE("sat-handover-example");
41 
42 int
43 main(int argc, char* argv[])
44 {
46  Config::SetDefault("ns3::SatConf::ForwardLinkRegenerationMode",
47  EnumValue(SatEnums::REGENERATION_PHY));
48  Config::SetDefault("ns3::SatConf::ReturnLinkRegenerationMode",
49  EnumValue(SatEnums::REGENERATION_PHY));
50 
51  Config::SetDefault("ns3::SatGeoFeederPhy::QueueSize", UintegerValue(100000));
52 
54  Config::SetDefault("ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(true));
55 
57  Config::SetDefault("ns3::SatHelper::PacketTraceEnabled", BooleanValue(true));
58  Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>("example-handover");
59  Ptr<SimulationHelperConf> simulationConf = CreateObject<SimulationHelperConf>();
60  simulationHelper->SetSimulationTime(Seconds(60));
61  simulationHelper->SetGwUserCount(2);
62  simulationHelper->SetUtCountPerBeam(5);
63  simulationHelper->SetUserCountPerUt(1);
64  simulationHelper->SetBeams("12 13 26 27 38 39");
65  simulationHelper->SetUserCountPerMobileUt(simulationConf->m_utMobileUserCount);
66 
67  std::string mobileUtFolder =
68  Singleton<SatEnvVariables>::Get()->LocateDataDirectory() + "/utpositions/mobiles/scenario5";
69  Ptr<SatHelper> helper = simulationHelper->CreateSatScenario(SatHelper::NONE, mobileUtFolder);
70 
71  Config::SetDefault("ns3::CbrApplication::Interval", StringValue("100ms"));
72  Config::SetDefault("ns3::CbrApplication::PacketSize", UintegerValue(512));
73 
74  simulationHelper->InstallTrafficModel(SimulationHelper::CBR,
77  Seconds(1.0),
78  Seconds(60.0));
79 
80  // To store attributes to file
81  Config::SetDefault("ns3::ConfigStore::Filename", StringValue("output-attributes.xml"));
82  Config::SetDefault("ns3::ConfigStore::FileFormat", StringValue("Xml"));
83  Config::SetDefault("ns3::ConfigStore::Mode", StringValue("Save"));
84  ConfigStore outputConfig;
85  outputConfig.ConfigureDefaults();
86 
87  Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
88 
89  s->AddPerBeamFwdAppThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
90  s->AddPerBeamFwdUserDevThroughput(SatStatsHelper::OUTPUT_SCATTER_FILE);
91  s->AddPerBeamBeamServiceTime(SatStatsHelper::OUTPUT_SCALAR_FILE);
92 
93  simulationHelper->EnableProgressLogs();
94  simulationHelper->RunSimulation();
95 
96  return 0;
97 }
@ NONE
NONE Not used.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.