A Discrete-Event Network Simulator
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
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
21namespace ns3
22{
23
24NS_LOG_COMPONENT_DEFINE("BurstProfileManager");
25
26NS_OBJECT_ENSURE_REGISTERED(BurstProfileManager);
27
28TypeId
30{
31 static TypeId tid =
32 TypeId("ns3::BurstProfileManager").SetParent<Object>().SetGroupName("Wimax");
33 return tid;
34}
35
40
45
46void
51
52uint16_t
54{
55 /*
56 * 7 modulation types
57 */
58 return 7;
59}
60
63{
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
95uint8_t
97 WimaxNetDevice::Direction direction) const
98{
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
130uint8_t
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);
141}
142
148
149uint8_t
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
157}
158
159} // namespace ns3
Ptr< WimaxNetDevice > m_device
the device
BurstProfileManager(Ptr< WimaxNetDevice > device)
Constructor.
WimaxPhy::ModulationType GetModulationTypeForSS(const SSRecord *ssRecord, const RngReq *rngreq) const
Get module ation type for SS.
uint8_t GetBurstProfile(WimaxPhy::ModulationType modulationType, WimaxNetDevice::Direction direction) const
returns the burst profile
uint8_t GetBurstProfileToRequest()
Get burst profile to request.
static TypeId GetTypeId()
Get the type ID.
uint8_t GetBurstProfileForSS(const SSRecord *ssRecord, const RngReq *rngreq, WimaxPhy::ModulationType &modulationType) const
Get burst profile for SS.
void DoDispose() override
Destructor implementation.
WimaxPhy::ModulationType GetModulationType(uint8_t iuc, WimaxNetDevice::Direction direction) const
returns the modulation type of a given iuc
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
This class implements the ranging request message described by "IEEE Standard forLocal and metropolit...
uint8_t GetReqDlBurstProfile() const
Get request DL burst profile field.
This class is used by the base station to store some information related to subscriber station in the...
Definition ss-record.h:35
SubscriberStationNetDevice subclass of WimaxNetDevice.
WimaxPhy::ModulationType GetModulationType() const
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Direction
Direction enumeration.
ModulationType
ModulationType enumeration.
Definition wimax-phy.h:43
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.