1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3
* Copyright (c) 2007,2008 INRIA
4
* 2009 TELEMATICS LAB, Politecnico di Bari
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* Author: Giuseppe Piro <g.piro@poliba.it>
22
#include "bs-uplink-scheduler-rtps.h"
23
#include "bs-net-device.h"
24
#include "ns3/simulator.h"
26
#include "burst-profile-manager.h"
27
#include "ss-manager.h"
29
#include "ns3/uinteger.h"
30
#include "ss-record.h"
31
#include "service-flow.h"
32
#include "service-flow-record.h"
33
#include "bs-link-manager.h"
34
#include "bandwidth-manager.h"
36
NS_LOG_COMPONENT_DEFINE ("UplinkSchedulerRtps");
39
NS_OBJECT_ENSURE_REGISTERED ( UplinkSchedulerRtps);
41
UplinkSchedulerRtps::UplinkSchedulerRtps ()
44
SetTimeStampIrInterval (Seconds (0));
45
SetNrIrOppsAllocated (0);
46
SetIsIrIntrvlAllocated (false);
47
SetIsInvIrIntrvlAllocated (false);
48
SetDcdTimeStamp (Simulator::Now ());
49
SetUcdTimeStamp (Simulator::Now ());
52
UplinkSchedulerRtps::UplinkSchedulerRtps (Ptr<BaseStationNetDevice> bs)
55
SetTimeStampIrInterval (Seconds (0));
56
SetNrIrOppsAllocated (0);
57
SetIsIrIntrvlAllocated (false);
58
SetIsInvIrIntrvlAllocated (false);
59
SetDcdTimeStamp (Simulator::Now ());
60
SetUcdTimeStamp (Simulator::Now ());
63
UplinkSchedulerRtps::~UplinkSchedulerRtps (void)
66
m_uplinkAllocations.clear ();
70
UplinkSchedulerRtps::GetTypeId (void)
72
static TypeId tid = TypeId ("ns3::UplinkSchedulerRtps").SetParent<UplinkScheduler> ();
76
std::list<OfdmUlMapIe>
77
UplinkSchedulerRtps::GetUplinkAllocations (void) const
79
return m_uplinkAllocations;
83
UplinkSchedulerRtps::GetChannelDescriptorsToUpdate (bool &updateDcd, bool &updateUcd, bool &sendDcd, bool &sendUcd)
85
/*DCD and UCD shall actually be updated when channel or burst profile definitions
86
change. burst profiles are updated based on number of SSs, network conditions and etc.
87
for now temporarily assuming DCD/UCD shall be updated everytime */
89
uint32_t randNr = rand ();
90
if (randNr % 5 == 0 || GetBs ()->GetNrDcdSent () == 0)
96
if (randNr % 5 == 0 || GetBs ()->GetNrUcdSent () == 0)
101
// -------------------------------------
102
// additional, just to send more frequently
120
// -------------------------------------
122
Time timeSinceLastDcd = Simulator::Now () - GetDcdTimeStamp ();
123
Time timeSinceLastUcd = Simulator::Now () - GetUcdTimeStamp ();
125
if (timeSinceLastDcd > GetBs ()->GetDcdInterval ())
128
SetDcdTimeStamp (Simulator::Now ());
131
if (timeSinceLastUcd > GetBs ()->GetUcdInterval ())
134
SetUcdTimeStamp (Simulator::Now ());
139
UplinkSchedulerRtps::CalculateAllocationStartTime (void)
141
return GetBs ()->GetNrDlSymbols () * GetBs ()->GetPhy ()->GetPsPerSymbol () + GetBs ()->GetTtg ();
145
UplinkSchedulerRtps::AddUplinkAllocation (OfdmUlMapIe &ulMapIe,
146
const uint32_t &allocationSize,
147
uint32_t &symbolsToAllocation,
148
uint32_t &availableSymbols)
150
ulMapIe.SetDuration (allocationSize);
151
ulMapIe.SetStartTime (symbolsToAllocation);
152
m_uplinkAllocations.push_back (ulMapIe);
153
symbolsToAllocation += allocationSize;
154
availableSymbols -= allocationSize;
158
UplinkSchedulerRtps::Schedule (void)
160
m_uplinkAllocations.clear ();
161
SetIsIrIntrvlAllocated (false);
162
SetIsInvIrIntrvlAllocated (false);
163
bool allocationForDsa = false;
165
uint32_t symbolsToAllocation = 0;
166
uint32_t allocationSize = 0; // size in symbols
167
uint32_t availableSymbols = GetBs ()->GetNrUlSymbols ();
169
WimaxPhy::ModulationType modulationType;
172
AllocateInitialRangingInterval (symbolsToAllocation, availableSymbols);
174
std::vector<SSRecord*> *ssRecords = GetBs ()->GetSSManager ()->GetSSRecords ();
175
NS_LOG_INFO ("UL Scheduler start, availableSymbols = " << availableSymbols);
177
for (std::vector<SSRecord*>::iterator iter = ssRecords->begin (); iter != ssRecords->end (); ++iter)
179
SSRecord *ssRecord = *iter;
180
if (ssRecord->GetIsBroadcastSS ())
184
cid = ssRecord->GetBasicCid ();
186
ulMapIe.SetCid (cid);
188
if (ssRecord->GetPollForRanging () && ssRecord->GetRangingStatus () == WimaxNetDevice::RANGING_STATUS_CONTINUE)
190
// SS's ranging is not yet complete
191
// allocating invited initial ranging interval
192
ulMapIe.SetUiuc (OfdmUlBurstProfile::UIUC_INITIAL_RANGING);
193
allocationSize = GetBs ()->GetRangReqOppSize ();
194
SetIsInvIrIntrvlAllocated (true);
196
if (availableSymbols >= allocationSize)
198
AddUplinkAllocation (ulMapIe, allocationSize, symbolsToAllocation, availableSymbols);
207
modulationType = ssRecord->GetModulationType ();
209
// need to update because modulation/FEC to UIUC mapping may vary over time
210
ulMapIe.SetUiuc (GetBs ()->GetBurstProfileManager ()->GetBurstProfile (modulationType,
211
WimaxNetDevice::DIRECTION_UPLINK));
213
// establish service flows for SS
214
if (ssRecord->GetRangingStatus () == WimaxNetDevice::RANGING_STATUS_SUCCESS
215
&& !ssRecord->GetAreServiceFlowsAllocated ())
217
// allocating grant (with arbitrary size) to allow SS to send DSA messages DSA-REQ and DSA-ACK
218
// only one DSA allocation per frame
219
if (!allocationForDsa)
221
allocationSize = GetBs ()->GetPhy ()->GetNrSymbols (sizeof(DsaReq), modulationType);
222
if (availableSymbols >= allocationSize)
224
AddUplinkAllocation (ulMapIe, allocationSize, symbolsToAllocation, availableSymbols);
225
allocationForDsa = true;
235
// all service flows associated to SS are established now
237
/*allocating grants for data transmission for UGS flows (Data Grant Burst Type IEs, 6.3.7.4.3.3)
238
(grant has been referred by different names e.g. transmission opportunity, slot, uplink allocation, etc)*/
239
ServiceUnsolicitedGrants (ssRecord,
240
ServiceFlow::SF_TYPE_UGS,
246
// allocate unicast polls for rtPS flows if bandwidth is available
247
if (availableSymbols)
249
ServiceUnsolicitedGrants (ssRecord,
250
ServiceFlow::SF_TYPE_RTPS,
256
// allocate unicast polls for nrtPS flows if bandwidth is available
257
if (availableSymbols)
259
ServiceUnsolicitedGrants (ssRecord,
260
ServiceFlow::SF_TYPE_NRTPS,
266
// finally allocate unicast polls for BE flows if bandwidth is available
267
if (availableSymbols)
269
ServiceUnsolicitedGrants (ssRecord,
270
ServiceFlow::SF_TYPE_BE,
281
* Uplink Scheduler for rtPS Connection
283
if (availableSymbols)
285
ULSchedulerRTPSConnection (symbolsToAllocation, availableSymbols);
288
// UL Scheduler for nrtPS and BE flows
289
if (availableSymbols)
291
for (std::vector<SSRecord*>::iterator iter = ssRecords->begin (); iter != ssRecords->end (); ++iter)
293
SSRecord *ssRecord = *iter;
294
if (ssRecord->GetIsBroadcastSS ())
298
if (!ssRecord->GetPollForRanging () && ssRecord->GetRangingStatus ()
299
!= WimaxNetDevice::RANGING_STATUS_CONTINUE && ssRecord->GetAreServiceFlowsAllocated ())
302
cid = ssRecord->GetBasicCid ();
303
ulMapIe.SetCid (cid);
304
modulationType = ssRecord->GetModulationType ();
305
ulMapIe.SetUiuc (GetBs ()->GetBurstProfileManager ()->GetBurstProfile (modulationType,
306
WimaxNetDevice::DIRECTION_UPLINK));
308
// allocate unicast polls for nrtPS flows if bandwidth is available
309
if (availableSymbols)
311
ServiceBandwidthRequests (ssRecord,
312
ServiceFlow::SF_TYPE_NRTPS,
318
// finally allocate unicast polls for BE flows if bandwidth is available
319
if (availableSymbols)
321
ServiceBandwidthRequests (ssRecord,
322
ServiceFlow::SF_TYPE_BE,
332
OfdmUlMapIe ulMapIeEnd;
333
ulMapIeEnd.SetCid (Cid::InitialRanging ());
334
ulMapIeEnd.SetStartTime (symbolsToAllocation);
335
ulMapIeEnd.SetUiuc (OfdmUlBurstProfile::UIUC_END_OF_MAP);
336
ulMapIeEnd.SetDuration (0);
337
m_uplinkAllocations.push_back (ulMapIeEnd);
339
// setting DL/UL subframe allocation for the next frame
340
GetBs ()->GetBandwidthManager ()->SetSubframeRatio ();
344
UplinkSchedulerRtps::ServiceUnsolicitedGrants (const SSRecord *ssRecord,
345
enum ServiceFlow::SchedulingType schedulingType,
346
OfdmUlMapIe &ulMapIe,
347
const WimaxPhy::ModulationType modulationType,
348
uint32_t &symbolsToAllocation,
349
uint32_t &availableSymbols)
351
uint32_t allocationSize = 0; // size in symbols
352
uint8_t uiuc = ulMapIe.GetUiuc (); // SS's burst profile
353
std::vector<ServiceFlow*> serviceFlows = ssRecord->GetServiceFlows (schedulingType);
355
for (std::vector<ServiceFlow*>::iterator iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
357
ServiceFlow *serviceFlow = *iter;
359
/* in case of rtPS, nrtPS and BE, allocating unicast polls for bandwidth requests (Request IEs, 6.3.7.4.3.1).
360
in case of UGS, allocating grants for data transmission (Data Grant Burst Type IEs, 6.3.7.4.3.3) (grant has
361
been referred in this code by different names e.g. transmission opportunity, slot, allocation, etc) */
363
allocationSize = GetBs ()->GetBandwidthManager ()->CalculateAllocationSize (ssRecord, serviceFlow);
365
// verifying that minimum reserved traffic rate of nrtPS flow is maintained
366
if (serviceFlow->GetSchedulingType () == ServiceFlow::SF_TYPE_NRTPS)
368
Time currentTime = Simulator::Now ();
369
ServiceFlowRecord *record = serviceFlow->GetRecord ();
370
if (currentTime - record->GetGrantTimeStamp () > Seconds (1))
372
uint32_t bps = (record->GetBwSinceLastExpiry () * 8);
373
if (bps < serviceFlow->GetMinReservedTrafficRate ())
375
ServiceBandwidthRequests (serviceFlow,
381
record->SetBwSinceLastExpiry (0);
382
record->SetGrantTimeStamp (currentTime);
387
if (availableSymbols < allocationSize)
392
if (allocationSize > 0)
394
ulMapIe.SetStartTime (symbolsToAllocation);
395
if (serviceFlow->GetSchedulingType () != ServiceFlow::SF_TYPE_UGS)
397
// special burst profile with most robust modulation type is used for unicast polls (Request IEs)
398
ulMapIe.SetUiuc (OfdmUlBurstProfile::UIUC_REQ_REGION_FULL);
406
if (serviceFlow->GetSchedulingType () == ServiceFlow::SF_TYPE_UGS)
408
NS_LOG_DEBUG ("BS uplink scheduler, UGS allocation, size: " << allocationSize << " symbols");
412
NS_LOG_DEBUG ("BS uplink scheduler, " << serviceFlow->GetSchedulingTypeStr () << " unicast poll, size: "
413
<< allocationSize << " symbols" << ", modulation: BPSK 1/2");
416
NS_LOG_DEBUG (", CID: " << serviceFlow->GetConnection ()->GetCid () << ", SFID: " << serviceFlow->GetSfid ());
418
AddUplinkAllocation (ulMapIe, allocationSize, symbolsToAllocation, availableSymbols);
419
ulMapIe.SetUiuc (uiuc);
424
UplinkSchedulerRtps::ServiceBandwidthRequests (const SSRecord *ssRecord,
425
enum ServiceFlow::SchedulingType schedulingType,
426
OfdmUlMapIe &ulMapIe,
427
const WimaxPhy::ModulationType modulationType,
428
uint32_t &symbolsToAllocation,
429
uint32_t &availableSymbols)
431
std::vector<ServiceFlow*> serviceFlows = ssRecord->GetServiceFlows (schedulingType);
433
for (std::vector<ServiceFlow*>::iterator iter = serviceFlows.begin (); iter != serviceFlows.end (); ++iter)
435
if (!ServiceBandwidthRequests (*iter,
448
UplinkSchedulerRtps::ServiceBandwidthRequests (ServiceFlow *serviceFlow,
449
enum ServiceFlow::SchedulingType schedulingType,
450
OfdmUlMapIe &ulMapIe,
451
const WimaxPhy::ModulationType modulationType,
452
uint32_t &symbolsToAllocation,
453
uint32_t &availableSymbols)
455
uint32_t allocSizeBytes = 0;
456
uint32_t allocSizeSymbols = 0;
457
uint16_t sduSize = 0;
459
ServiceFlowRecord *record = serviceFlow->GetRecord ();
460
sduSize = serviceFlow->GetSduSize ();
462
uint32_t requiredBandwidth = record->GetRequestedBandwidth () - record->GetGrantedBandwidth ();
463
if (requiredBandwidth > 0)
467
// if SDU size is mentioned, allocate grant of that size
468
allocSizeBytes = sduSize;
469
allocSizeSymbols = GetBs ()->GetPhy ()->GetNrSymbols (sduSize, modulationType);
473
allocSizeBytes = requiredBandwidth;
474
allocSizeSymbols = GetBs ()->GetPhy ()->GetNrSymbols (requiredBandwidth, modulationType);
477
if (availableSymbols >= allocSizeSymbols)
480
NS_LOG_DEBUG ("BS uplink scheduler, " << serviceFlow->GetSchedulingTypeStr () << " allocation, size: "
481
<< allocSizeSymbols << " symbols" << ", CID: " << serviceFlow->GetConnection ()->GetCid () << ", SFID: "
482
<< serviceFlow->GetSfid () << ", bw requested: " << record->GetRequestedBandwidth () << ", bw granted: "
483
<< record->GetGrantedBandwidth ());
485
record->UpdateGrantedBandwidth (allocSizeBytes);
487
if (schedulingType == ServiceFlow::SF_TYPE_NRTPS)
489
record->SetBwSinceLastExpiry (allocSizeBytes);
492
AddUplinkAllocation (ulMapIe, allocSizeSymbols, symbolsToAllocation, availableSymbols);
503
UplinkSchedulerRtps::ULSchedulerRTPSConnection (uint32_t &symbolsToAllocation, uint32_t &availableSymbols)
505
NS_LOG_INFO ("\tUL Scheduler for rtPS flows");
506
NS_LOG_INFO ("\t\tavailableSymbols = " << availableSymbols);
507
ServiceFlowRecord *record_[100];
508
uint32_t allocSizeSymbols_[100]; // symbolsRequired for each SSRecord
509
OfdmUlMapIe ulMapIe_[100];
511
WimaxPhy::ModulationType modulationType_[100];
512
WimaxPhy::ModulationType modulationType;
513
int nbAllocation = 0;
514
uint32_t allocSizeBytes;
515
uint32_t totAllocSizeSymbols = 0;
518
std::vector<SSRecord*> *ssRecords = GetBs ()->GetSSManager ()->GetSSRecords ();
520
for (std::vector<SSRecord*>::iterator iter = ssRecords->begin (); iter != ssRecords->end (); ++iter)
522
SSRecord *ssRecord = *iter;
523
if (ssRecord->GetIsBroadcastSS ())
527
if (!ssRecord->GetPollForRanging () && ssRecord->GetRangingStatus () != WimaxNetDevice::RANGING_STATUS_CONTINUE
528
&& ssRecord->GetAreServiceFlowsAllocated ())
530
cid = ssRecord->GetBasicCid ();
531
ulMapIe.SetCid (cid);
532
modulationType = ssRecord->GetModulationType ();
533
ulMapIe.SetUiuc (GetBs ()->GetBurstProfileManager ()->GetBurstProfile (modulationType,
534
WimaxNetDevice::DIRECTION_UPLINK));
536
std::vector<ServiceFlow*> serviceFlows = ssRecord->GetServiceFlows (ServiceFlow::SF_TYPE_RTPS);
537
for (std::vector<ServiceFlow*>::iterator iter2 = serviceFlows.begin (); iter2 != serviceFlows.end (); ++iter2)
539
record_[nbAllocation] = (*iter2)->GetRecord ();
540
uint32_t requiredBandwidth = record_[nbAllocation]->GetRequestedBandwidth ()
541
- record_[nbAllocation]->GetGrantedBandwidth ();
543
if (requiredBandwidth > 0)
545
modulationType_[nbAllocation] = modulationType;
546
ulMapIe_[nbAllocation] = ulMapIe;
547
allocSizeBytes = requiredBandwidth;
548
allocSizeSymbols_[nbAllocation] = GetBs ()->GetPhy ()->GetNrSymbols (allocSizeBytes,
549
modulationType_[nbAllocation]);
550
totAllocSizeSymbols += allocSizeSymbols_[nbAllocation];
552
NS_LOG_INFO ("\t\tUL Scheduler for CID = " << (*iter2)->GetConnection ()->GetCid ());
553
NS_LOG_INFO ("\t\t\trequiredBandwidth = " << record_[nbAllocation]->GetRequestedBandwidth ()
554
<< ", allocSizeSymbols = " << allocSizeSymbols_[nbAllocation] << ", modulationType = "
555
<< modulationType_[nbAllocation]);
563
NS_LOG_INFO ("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols);
565
// Channel Saturation
566
while (totAllocSizeSymbols > availableSymbols)
568
NS_LOG_INFO ("\tUL Channel Saturation: totAllocSizeSymbols > availableSymbols");
569
double delta = double(availableSymbols) / double(totAllocSizeSymbols);
570
NS_LOG_INFO ("\t\tdelta = " << delta);
571
totAllocSizeSymbols = 0;
572
for (int i = 0; i < nbAllocation; i++)
574
NS_LOG_INFO ("\t\tprevious allocSizeSymbols_[" << i << "] = " << allocSizeSymbols_[i]);
575
allocSizeSymbols_[i] = (uint32_t) floor (allocSizeSymbols_[i] * delta);
576
totAllocSizeSymbols += allocSizeSymbols_[i];
577
NS_LOG_INFO ("\t\tnew allocSizeSymbols_[" << i << "] = " << allocSizeSymbols_[i]);
579
NS_LOG_INFO ("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols);
582
// Uplink Bandwidth Allocation
583
for (int i = 0; i < nbAllocation; i++)
585
AddUplinkAllocation (ulMapIe_[i], allocSizeSymbols_[i], symbolsToAllocation, availableSymbols);
586
allocSizeBytes = GetBs ()->GetPhy ()->GetNrBytes (allocSizeSymbols_[i], modulationType_[i]);
587
NS_LOG_INFO ("\t\tUpdateGrantedBandwidth for " << i << " = " << allocSizeBytes);
588
if (record_[i]->GetRequestedBandwidth () < allocSizeBytes)
590
// the flow need new poll to set the newer requredBandwidth
591
record_[i]->SetGrantedBandwidth (0);
592
record_[i]->SetRequestedBandwidth (0);
596
record_[i]->UpdateGrantedBandwidth (allocSizeBytes);
602
UplinkSchedulerRtps::AllocateInitialRangingInterval (uint32_t &symbolsToAllocation, uint32_t &availableSymbols)
604
Time ssUlStartTime = Seconds (CalculateAllocationStartTime () * GetBs ()->GetPsDuration ().GetSeconds ());
605
SetNrIrOppsAllocated (GetBs ()->GetLinkManager ()->CalculateRangingOppsToAllocate ());
606
uint32_t allocationSize = GetNrIrOppsAllocated () * GetBs ()->GetRangReqOppSize ();
607
Time timeSinceLastIrInterval = Simulator::Now () - GetTimeStampIrInterval ();
609
// adding one frame because may be the time has not elapsed now but will elapse before the next frame is sent
610
if (timeSinceLastIrInterval + GetBs ()->GetPhy ()->GetFrameDuration () > GetBs ()->GetInitialRangingInterval ()
611
&& availableSymbols >= allocationSize)
613
SetIsIrIntrvlAllocated (true);
614
OfdmUlMapIe ulMapIeIr;
615
ulMapIeIr.SetCid (GetBs ()->GetBroadcastConnection ()->GetCid ());
616
ulMapIeIr.SetStartTime (symbolsToAllocation);
617
ulMapIeIr.SetUiuc (OfdmUlBurstProfile::UIUC_INITIAL_RANGING);
619
NS_LOG_DEBUG ("BS uplink scheduler, initial ranging allocation, size: " << allocationSize << " symbols"
620
<< ", modulation: BPSK 1/2");
622
// marking start and end of each TO, only for debugging
623
for (uint8_t i = 0; i < GetNrIrOppsAllocated (); i++)
625
GetBs ()->MarkRangingOppStart (ssUlStartTime + Seconds (symbolsToAllocation
626
* GetBs ()->GetSymbolDuration ().GetSeconds ()) + Seconds (i * GetBs ()->GetRangReqOppSize ()
627
* GetBs ()->GetSymbolDuration ().GetSeconds ()));
630
AddUplinkAllocation (ulMapIeIr, allocationSize, symbolsToAllocation, availableSymbols);
631
SetTimeStampIrInterval (Simulator::Now ());
636
UplinkSchedulerRtps::SetupServiceFlow (SSRecord *ssRecord, ServiceFlow *serviceFlow)
638
uint8_t delayNrFrames = 1;
639
uint32_t bitsPerSecond = serviceFlow->GetMinReservedTrafficRate ();
640
WimaxPhy::ModulationType modulation;
641
uint32_t bytesPerFrame =
642
(uint32_t ((double)(bitsPerSecond) * GetBs ()->GetPhy ()->GetFrameDuration ().GetSeconds ())) / 8;
643
uint32_t frameDurationMSec = GetBs ()->GetPhy ()->GetFrameDuration ().GetMilliSeconds ();
645
switch (serviceFlow->GetSchedulingType ())
647
case ServiceFlow::SF_TYPE_UGS:
649
if (serviceFlow->GetIsMulticast () == true)
651
modulation = serviceFlow->GetModulation ();
655
modulation = ssRecord->GetModulationType ();
657
uint32_t grantSize = GetBs ()->GetPhy ()->GetNrSymbols (bytesPerFrame, modulation);
658
serviceFlow->GetRecord ()->SetGrantSize (grantSize);
660
uint32_t toleratedJitter = serviceFlow->GetToleratedJitter ();
662
if (toleratedJitter > frameDurationMSec)
664
delayNrFrames = (uint8_t)(toleratedJitter / frameDurationMSec);
667
uint16_t interval = delayNrFrames * frameDurationMSec;
668
serviceFlow->SetUnsolicitedGrantInterval (interval);
671
case ServiceFlow::SF_TYPE_RTPS:
673
if (serviceFlow->GetSduSize () > bytesPerFrame)
675
delayNrFrames = (uint8_t)(serviceFlow->GetSduSize () / bytesPerFrame);
678
uint16_t interval = delayNrFrames * frameDurationMSec;
679
serviceFlow->SetUnsolicitedPollingInterval (interval);
682
case ServiceFlow::SF_TYPE_NRTPS:
684
// no real-time guarantees are given to NRTPS, serviced based on available bandwidth
687
case ServiceFlow::SF_TYPE_BE:
689
// no real-time guarantees are given to BE, serviced based on available bandwidth
693
NS_FATAL_ERROR ("Invalid scheduling type");
698
UplinkSchedulerRtps::InitOnce ()
703
UplinkSchedulerRtps::ProcessBandwidthRequest (const BandwidthRequestHeader &bwRequestHdr)
708
UplinkSchedulerRtps::OnSetRequestedBandwidth (ServiceFlowRecord *sfr)
710
// m_grantedBandwidth must be reset to zero
711
uint32_t grantedBandwidth = 0;
712
sfr->SetGrantedBandwidth (grantedBandwidth);