Loading...
Searching...
No Matches
sat-rtn-link-ra-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
29using namespace ns3;
30
37
38NS_LOG_COMPONENT_DEFINE("sat-rtn-link-ra-example");
39
40int
41main(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-ra-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->DisableAllCapacityAssignmentCategories();
62 simulationHelper->EnableCrdsa();
63
64 simulationHelper->SetBeams("1 3 5 7 9 22 24 26 28 30 44 46 48 50 59 61 70 72");
65
66 /* Simulation tags *****************************************************************/
67
68 std::stringstream sstag;
69 sstag << simulationName << "UTs=" << utsPerBeam;
70 simulationHelper->SetOutputTag(sstag.str());
71
72 simulationHelper->LoadScenario("geo-33E");
73
74 // Create satellite scenario
75 simulationHelper->CreateSatScenario();
76
77 // >>> Start of actual test using Full scenario >>>
78 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
81 MilliSeconds(33),
82 20,
83 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
84 Singleton<SatTopology>::Get()->GetUtUserNodes(),
85 Seconds(1),
86 simLength,
87 Seconds(0.05));
88
89 // Create RTN link statistics
90 simulationHelper->CreateDefaultRtnLinkStats();
91
92 // Enable logs
93 simulationHelper->EnableProgressLogs();
94
95 // Run
96 simulationHelper->RunSimulation();
97
98 return 0;
99}
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.