Loading...
Searching...
No Matches
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
30using namespace ns3;
31
41
42NS_LOG_COMPONENT_DEFINE("sat-profiling-sim");
43
44int
45main(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
63 simulationHelper->LoadScenario("geo-33E");
64
65 simulationHelper->CreateSatScenario();
66
67 // ----------------------------------
68 // ----- CREATE CBR APPLICATION -----
69 // ----------------------------------
70 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
71
72 NS_ASSERT(utUsers.GetN() == 1);
73
74 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
77 Seconds(2),
78 64,
79 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
80 Singleton<SatTopology>::Get()->GetUtUserNodes(),
81 Seconds(1),
82 Seconds(simulationTime),
83 Seconds(0));
84
85 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
88 Seconds(2),
89 64,
90 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
91 Singleton<SatTopology>::Get()->GetUtUserNodes(),
92 Seconds(1),
93 Seconds(simulationTime),
94 Seconds(0));
95 // ----------------------------------
96 // ----- CREATE CBR APPLICATION -----
97 // ----------------------------------
98
99 simulationHelper->CreateDefaultRtnLinkStats();
100 simulationHelper->EnableProgressLogs();
101 simulationHelper->RunSimulation();
102
103 return 0;
104}
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.