A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ss-net-device.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007,2008,2009 INRIA, UDcast
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
* Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20
* <amine.ismail@UDcast.com>
21
*/
22
23
#ifndef WIMAX_SS_NET_DEVICE_H
24
#define WIMAX_SS_NET_DEVICE_H
25
26
#include "ns3/event-id.h"
27
#include "
wimax-net-device.h
"
28
#include "ns3/nstime.h"
29
#include "
wimax-mac-header.h
"
30
#include "ns3/uinteger.h"
31
#include "ns3/ss-service-flow-manager.h"
32
#include "
ipcs-classifier.h
"
33
34
namespace
ns3 {
35
36
class
Node;
37
class
OfdmDlBurstProfile;
38
class
OfdmUlBurstProfile;
39
class
SSScheduler;
40
class
SSLinkManager;
41
class
SsServiceFlowManager;
42
class
IpcsClassifier;
43
47
class
SubscriberStationNetDevice
:
public
WimaxNetDevice
48
{
49
public
:
50
enum
State
51
{
52
SS_STATE_IDLE
,
SS_STATE_SCANNING
,
SS_STATE_SYNCHRONIZING
,
SS_STATE_ACQUIRING_PARAMETERS
,
53
SS_STATE_WAITING_REG_RANG_INTRVL
,
// regular ranging interval
54
SS_STATE_WAITING_INV_RANG_INTRVL
,
// invited ranging interval
55
SS_STATE_WAITING_RNG_RSP
,
SS_STATE_ADJUSTING_PARAMETERS
,
SS_STATE_REGISTERED
,
SS_STATE_TRANSMITTING
,
// currently not being used anywhere
56
SS_STATE_STOPPED
57
};
58
59
enum
EventType
60
{
61
EVENT_NONE
,
EVENT_WAIT_FOR_RNG_RSP
,
EVENT_DL_MAP_SYNC_TIMEOUT
,
EVENT_LOST_DL_MAP
,
EVENT_LOST_UL_MAP
,
62
EVENT_DCD_WAIT_TIMEOUT
,
EVENT_UCD_WAIT_TIMEOUT
,
EVENT_RANG_OPP_WAIT_TIMEOUT
63
};
64
65
static
TypeId
GetTypeId
(
void
);
66
SubscriberStationNetDevice
(
void
);
67
SubscriberStationNetDevice
(
Ptr<Node>
,
Ptr<WimaxPhy>
);
68
~SubscriberStationNetDevice
(
void
);
69
73
void
InitSubscriberStationNetDevice
(
void
);
77
void
SetLostDlMapInterval
(
Time
lostDlMapInterval);
78
/*
79
* \returns the time since last received DL-MAP message before downlink synchronization is considered lost
80
*/
81
Time
GetLostDlMapInterval
(
void
)
const
;
85
void
SetLostUlMapInterval
(
Time
lostUlMapInterval);
89
Time
GetLostUlMapInterval
(
void
)
const
;
93
void
SetMaxDcdInterval
(
Time
maxDcdInterval);
97
Time
GetMaxDcdInterval
(
void
)
const
;
101
void
SetMaxUcdInterval
(
Time
maxUcdInterval);
105
Time
GetMaxUcdInterval
(
void
)
const
;
109
void
SetIntervalT1
(
Time
interval1);
113
Time
GetIntervalT1
(
void
)
const
;
117
void
SetIntervalT2
(
Time
interval2);
121
Time
GetIntervalT2
(
void
)
const
;
125
void
SetIntervalT3
(
Time
interval3);
129
Time
GetIntervalT3
(
void
)
const
;
133
void
SetIntervalT7
(
Time
interval7);
137
Time
GetIntervalT7
(
void
)
const
;
141
void
SetIntervalT12
(
Time
interval12);
145
Time
GetIntervalT12
(
void
)
const
;
149
void
SetIntervalT20
(
Time
interval20);
153
Time
GetIntervalT20
(
void
)
const
;
157
void
SetIntervalT21
(
Time
interval21);
161
Time
GetIntervalT21
(
void
)
const
;
165
void
SetMaxContentionRangingRetries
(uint8_t maxContentionRangingRetries);
169
uint8_t
GetMaxContentionRangingRetries
(
void
)
const
;
173
void
SetBasicConnection
(
Ptr<WimaxConnection>
basicConnection);
177
Ptr<WimaxConnection>
GetBasicConnection
(
void
)
const
;
181
void
SetPrimaryConnection
(
Ptr<WimaxConnection>
primaryConnection);
185
Ptr<WimaxConnection>
GetPrimaryConnection
(
void
)
const
;
189
Cid
GetBasicCid
(
void
)
const
;
193
Cid
GetPrimaryCid
(
void
)
const
;
194
199
void
SetModulationType
(
WimaxPhy::ModulationType
modulationType);
203
WimaxPhy::ModulationType
GetModulationType
(
void
)
const
;
207
void
SetAreManagementConnectionsAllocated
(
bool
areManagementConnectionsAllocated);
211
bool
GetAreManagementConnectionsAllocated
(
void
)
const
;
215
void
SetAreServiceFlowsAllocated
(
bool
areServiceFlowsAllocated);
219
bool
GetAreServiceFlowsAllocated
(
void
)
const
;
223
Ptr<SSScheduler>
GetScheduler
(
void
)
const
;
227
void
SetScheduler
(
Ptr<SSScheduler>
ssScheduler);
231
bool
HasServiceFlows
(
void
)
const
;
238
bool
Enqueue
(
Ptr<Packet>
packet,
const
MacHeaderType
&hdrType,
Ptr<WimaxConnection>
connection);
242
void
SendBurst
(uint8_t uiuc,
243
uint16_t nrSymbols,
244
Ptr<WimaxConnection>
connection,
245
MacHeaderType::HeaderType
packetType =
MacHeaderType::HEADER_TYPE_GENERIC
);
246
247
void
Start
(
void
);
248
void
Stop
(
void
);
249
253
void
AddServiceFlow
(
ServiceFlow
*sf);
257
void
AddServiceFlow
(
ServiceFlow
sf);
258
void
SetTimer
(
EventId
eventId,
EventId
&event);
262
bool
IsRegistered
(
void
)
const
;
263
Time
GetTimeToAllocation
(
Time
defferTime);
264
265
Ptr<SSLinkManager>
m_linkManager
;
269
Ptr<IpcsClassifier>
GetIpcsClassifier
()
const
;
273
void
SetIpcsPacketClassifier
(
Ptr<IpcsClassifier>
);
277
Ptr<SSLinkManager>
GetLinkManager
(
void
)
const
;
281
void
SetLinkManager
(
Ptr<SSLinkManager>
);
285
Ptr<SsServiceFlowManager>
GetServiceFlowManager
(
void
)
const
;
289
void
SetServiceFlowManager
(
Ptr<SsServiceFlowManager>
);
290
291
private
:
292
static
Time
GetDefaultLostDlMapInterval
();
293
294
void
DoDispose
(
void
);
295
bool
DoSend
(
Ptr<Packet>
packet,
const
Mac48Address
&source,
const
Mac48Address
&dest, uint16_t protocolNumber);
296
void
DoReceive
(
Ptr<Packet>
packet);
297
298
void
ProcessDlMap
(
const
DlMap
&dlmap);
299
void
ProcessUlMap
(
const
UlMap
&ulmap);
300
void
ProcessDcd
(
const
Dcd
&dcd);
301
void
ProcessUcd
(
const
Ucd
&ucd);
302
303
// parameters defined in Table 342
304
Time
m_lostDlMapInterval
;
// in milliseconds, time since last received DL-MAP before downlink synchronization is considered lost, maximum is 600
305
Time
m_lostUlMapInterval
;
// in milliseconds, time since last received UL-MAP before uplink synchronization is considered lost, maximum is 600
306
Time
m_maxDcdInterval
;
// in seconds, maximum time between transmission of DCD messages
307
Time
m_maxUcdInterval
;
// in seconds, maximum time between transmission of UCD messages
308
Time
m_intervalT1
;
// in seconds, wait for DCD timeout
309
Time
m_intervalT2
;
// in seconds, wait for broadcast ranging timeout, i.e., wait for initial ranging opportunity
310
Time
m_intervalT3
;
// in milliseconds, ranging Response reception timeout following the transmission of a ranging request
311
Time
m_intervalT7
;
// in seconds, wait for DSA/DSC/DSD Response timeout
312
Time
m_intervalT12
;
// in seconds, wait for UCD descriptor
313
Time
m_intervalT20
;
// in seconds, time the SS searches for preambles on a given channel
314
Time
m_intervalT21
;
// in seconds, time the SS searches for (decodable) DL-MAP on a given channel
315
uint8_t
m_maxContentionRangingRetries
;
316
317
// parameters obtained from DL-MAP
318
uint8_t
m_dcdCount
;
319
Mac48Address
m_baseStationId
;
320
321
// parameters obtained from UL-MAP
322
uint8_t
m_ucdCount
;
323
double
m_allocationStartTime
;
324
325
// to keep the number of DL-MAP/UL-MAP IEs found in the last DL-MAP/U-MAP messages
326
uint16_t
m_nrDlMapElements
;
327
uint16_t
m_nrUlMapElements
;
328
329
Ptr<WimaxConnection>
m_basicConnection
;
330
Ptr<WimaxConnection>
m_primaryConnection
;
331
332
EventId
m_lostDlMapEvent
,
m_lostUlMapEvent
,
m_dcdWaitTimeoutEvent
,
m_ucdWaitTimeoutEvent
,
m_rangOppWaitTimeoutEvent
;
333
334
uint32_t
m_nrDlMapRecvd
;
335
uint32_t
m_nrUlMapRecvd
;
336
uint32_t
m_nrDcdRecvd
;
337
uint32_t
m_nrUcdRecvd
;
338
339
OfdmDlBurstProfile
*
m_dlBurstProfile
;
340
OfdmUlBurstProfile
*
m_ulBurstProfile
;
341
342
/*represents the (least robust) modulation type of the SS which it then requests in RNG-REQ and if accepted by BS uses it for receiving and
343
transmiting. currently it is set by user in simulation script, shall actually be determined based on SS's distance, power, signal etc*/
344
WimaxPhy::ModulationType
m_modulationType
;
345
346
bool
m_areManagementConnectionsAllocated
;
347
bool
m_areServiceFlowsAllocated
;
348
349
Ptr<SSScheduler>
m_scheduler
;
350
Ptr<SsServiceFlowManager>
m_serviceFlowManager
;
351
Ptr<IpcsClassifier>
m_classifier
;
352
353
TracedCallback<Ptr<const Packet>
,
Mac48Address
,
Cid
*>
m_traceSSRx
;
354
TracedCallback<Ptr<const PacketBurst>
,
Mac48Address
,
Cid
*,
WimaxPhy::ModulationType
>
m_traceSSTx
;
355
362
TracedCallback<Ptr<const Packet>
>
m_ssTxTrace
;
363
370
TracedCallback<Ptr<const Packet>
>
m_ssTxDropTrace
;
371
379
TracedCallback<Ptr<const Packet>
>
m_ssPromiscRxTrace
;
380
388
TracedCallback<Ptr<const Packet>
>
m_ssRxTrace
;
389
396
TracedCallback<Ptr<const Packet>
>
m_ssRxDropTrace
;
397
};
398
399
}
// namespace ns3
400
401
#endif
/* WIMAX_SS_NET_DEVICE_H */
src
wimax
model
ss-net-device.h
Generated on Tue Oct 9 2012 16:45:50 for ns-3 by
1.8.1.2