A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
burst-profile-manager.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007,2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7
*/
8
9
#include "
burst-profile-manager.h
"
10
11
#include "
bs-net-device.h
"
12
#include "
mac-messages.h
"
13
#include "
ss-manager.h
"
14
#include "
ss-net-device.h
"
15
#include "
ss-record.h
"
16
17
#include "ns3/log.h"
18
19
#include <stdint.h>
20
21
namespace
ns3
22
{
23
24
NS_LOG_COMPONENT_DEFINE
(
"BurstProfileManager"
);
25
26
NS_OBJECT_ENSURE_REGISTERED
(BurstProfileManager);
27
28
TypeId
29
BurstProfileManager::GetTypeId
()
30
{
31
static
TypeId
tid =
32
TypeId
(
"ns3::BurstProfileManager"
).
SetParent
<
Object
>().SetGroupName(
"Wimax"
);
33
return
tid;
34
}
35
36
BurstProfileManager::BurstProfileManager
(
Ptr<WimaxNetDevice>
device)
37
: m_device(device)
38
{
39
}
40
41
BurstProfileManager::~BurstProfileManager
()
42
{
43
m_device
=
nullptr
;
44
}
45
46
void
47
BurstProfileManager::DoDispose
()
48
{
49
m_device
=
nullptr
;
50
}
51
52
uint16_t
53
BurstProfileManager::GetNrBurstProfilesToDefine
()
54
{
55
/*
56
* 7 modulation types
57
*/
58
return
7;
59
}
60
61
WimaxPhy::ModulationType
62
BurstProfileManager::GetModulationType
(uint8_t
iuc
,
WimaxNetDevice::Direction
direction)
const
63
{
64
if
(direction ==
WimaxNetDevice::DIRECTION_DOWNLINK
)
65
{
66
std::vector<OfdmDlBurstProfile>
dlBurstProfiles
=
67
m_device
->GetCurrentDcd().GetDlBurstProfiles();
68
for
(
auto
iter
=
dlBurstProfiles
.begin();
iter
!=
dlBurstProfiles
.end(); ++
iter
)
69
{
70
if
(
iter
->GetDiuc() ==
iuc
)
71
{
72
return
(
WimaxPhy::ModulationType
)
iter
->GetFecCodeType();
73
}
74
}
75
}
76
else
77
{
78
std::vector<OfdmUlBurstProfile>
ulBurstProfiles
=
79
m_device
->GetCurrentUcd().GetUlBurstProfiles();
80
for
(
auto
iter
=
ulBurstProfiles
.begin();
iter
!=
ulBurstProfiles
.end(); ++
iter
)
81
{
82
if
(
iter
->GetUiuc() ==
iuc
)
83
{
84
return
(
WimaxPhy::ModulationType
)
iter
->GetFecCodeType();
85
}
86
}
87
}
88
89
// burst profile got to be there in DCD/UCD, assuming always all profiles are defined in DCD/UCD
90
NS_FATAL_ERROR
(
"burst profile got to be there in DCD/UCD"
);
91
92
return
(
WimaxPhy::ModulationType
)-1;
93
}
94
95
uint8_t
96
BurstProfileManager::GetBurstProfile
(
WimaxPhy::ModulationType
modulationType
,
97
WimaxNetDevice::Direction
direction)
const
98
{
99
if
(direction ==
WimaxNetDevice::DIRECTION_DOWNLINK
)
100
{
101
std::vector<OfdmDlBurstProfile>
dlBurstProfiles
=
102
m_device
->GetCurrentDcd().GetDlBurstProfiles();
103
for
(
auto
iter
=
dlBurstProfiles
.begin();
iter
!=
dlBurstProfiles
.end(); ++
iter
)
104
{
105
if
(
iter
->GetFecCodeType() ==
modulationType
)
106
{
107
return
iter
->GetDiuc();
108
}
109
}
110
}
111
else
112
{
113
std::vector<OfdmUlBurstProfile>
ulBurstProfiles
=
114
m_device
->GetCurrentUcd().GetUlBurstProfiles();
115
for
(
auto
iter
=
ulBurstProfiles
.begin();
iter
!=
ulBurstProfiles
.end(); ++
iter
)
116
{
117
if
(
iter
->GetFecCodeType() ==
modulationType
)
118
{
119
return
iter
->GetUiuc();
120
}
121
}
122
}
123
124
// burst profile got to be there in DCD/UCD, assuming always all profiles are defined in DCD/UCD
125
NS_FATAL_ERROR
(
"burst profile got to be there in DCD/UCD"
);
126
127
return
~0;
128
}
129
130
uint8_t
131
BurstProfileManager::GetBurstProfileForSS
(
const
SSRecord
*
ssRecord
,
132
const
RngReq
*
rngreq
,
133
WimaxPhy::ModulationType
&
modulationType
)
const
134
{
135
/*during initial ranging or periodic ranging (or when RNG-REQ is used instead of
136
DBPC) calculates the least robust burst profile for SS, e.g., based on distance,
137
power, signal etc, temporarily choosing same burst profile SS requested in RNG-REQ*/
138
139
modulationType
=
GetModulationTypeForSS
(
ssRecord
,
rngreq
);
140
return
GetBurstProfile
(
modulationType
,
WimaxNetDevice::DIRECTION_DOWNLINK
);
141
}
142
143
WimaxPhy::ModulationType
144
BurstProfileManager::GetModulationTypeForSS
(
const
SSRecord
*
ssRecord
,
const
RngReq
*
rngreq
)
const
145
{
146
return
GetModulationType
(
rngreq
->GetReqDlBurstProfile(),
WimaxNetDevice::DIRECTION_DOWNLINK
);
147
}
148
149
uint8_t
150
BurstProfileManager::GetBurstProfileToRequest
()
151
{
152
/*modulation type is currently set by user in simulation script, shall
153
actually be determined based on SS's distance, power, signal etc*/
154
155
return
GetBurstProfile
(
m_device
->GetObject<
SubscriberStationNetDevice
>()->
GetModulationType
(),
156
WimaxNetDevice::DIRECTION_DOWNLINK
);
157
}
158
159
}
// namespace ns3
bs-net-device.h
burst-profile-manager.h
ns3::BurstProfileManager::m_device
Ptr< WimaxNetDevice > m_device
the device
Definition
burst-profile-manager.h:98
ns3::BurstProfileManager::BurstProfileManager
BurstProfileManager(Ptr< WimaxNetDevice > device)
Constructor.
Definition
burst-profile-manager.cc:36
ns3::BurstProfileManager::GetModulationTypeForSS
WimaxPhy::ModulationType GetModulationTypeForSS(const SSRecord *ssRecord, const RngReq *rngreq) const
Get module ation type for SS.
Definition
burst-profile-manager.cc:144
ns3::BurstProfileManager::GetBurstProfile
uint8_t GetBurstProfile(WimaxPhy::ModulationType modulationType, WimaxNetDevice::Direction direction) const
returns the burst profile
Definition
burst-profile-manager.cc:96
ns3::BurstProfileManager::GetBurstProfileToRequest
uint8_t GetBurstProfileToRequest()
Get burst profile to request.
Definition
burst-profile-manager.cc:150
ns3::BurstProfileManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
burst-profile-manager.cc:29
ns3::BurstProfileManager::~BurstProfileManager
~BurstProfileManager() override
Definition
burst-profile-manager.cc:41
ns3::BurstProfileManager::GetNrBurstProfilesToDefine
uint16_t GetNrBurstProfilesToDefine()
Definition
burst-profile-manager.cc:53
ns3::BurstProfileManager::GetBurstProfileForSS
uint8_t GetBurstProfileForSS(const SSRecord *ssRecord, const RngReq *rngreq, WimaxPhy::ModulationType &modulationType) const
Get burst profile for SS.
Definition
burst-profile-manager.cc:131
ns3::BurstProfileManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition
burst-profile-manager.cc:47
ns3::BurstProfileManager::GetModulationType
WimaxPhy::ModulationType GetModulationType(uint8_t iuc, WimaxNetDevice::Direction direction) const
returns the modulation type of a given iuc
Definition
burst-profile-manager.cc:62
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::RngReq
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
Definition
mac-messages.h:652
ns3::SSRecord
This class is used by the base station to store some information related to subscriber station in the...
Definition
ss-record.h:35
ns3::SubscriberStationNetDevice
SubscriberStationNetDevice subclass of WimaxNetDevice.
Definition
ss-net-device.h:39
ns3::SubscriberStationNetDevice::GetModulationType
WimaxPhy::ModulationType GetModulationType() const
Definition
ss-net-device.cc:528
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::WimaxNetDevice::Direction
Direction
Direction enumeration.
Definition
wimax-net-device.h:64
ns3::WimaxNetDevice::DIRECTION_DOWNLINK
@ DIRECTION_DOWNLINK
Definition
wimax-net-device.h:65
ns3::WimaxPhy::ModulationType
ModulationType
ModulationType enumeration.
Definition
wimax-phy.h:43
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition
fatal-error.h:168
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
mac-messages.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ss-manager.h
ss-net-device.h
ss-record.h
src
wimax
model
burst-profile-manager.cc
Generated on Mon Dec 15 2025 15:22:11 for ns-3 by
1.9.8