A Discrete-Event Network Simulator
API
bs-uplink-scheduler-rtps.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008 INRIA
3  * 2009 TELEMATICS LAB, Politecnico di Bari
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: Giuseppe Piro <g.piro@poliba.it>
19  */
20 
22 
23 #include "bandwidth-manager.h"
24 #include "bs-link-manager.h"
25 #include "bs-net-device.h"
26 #include "burst-profile-manager.h"
27 #include "cid.h"
28 #include "service-flow-record.h"
29 #include "service-flow.h"
30 #include "ss-manager.h"
31 #include "ss-record.h"
32 
33 #include "ns3/log.h"
34 #include "ns3/simulator.h"
35 #include "ns3/uinteger.h"
36 
37 namespace ns3
38 {
39 
40 NS_LOG_COMPONENT_DEFINE("UplinkSchedulerRtps");
41 
42 NS_OBJECT_ENSURE_REGISTERED(UplinkSchedulerRtps);
43 
45 {
46  SetBs(nullptr);
53 }
54 
56 {
57  SetBs(bs);
64 }
65 
67 {
68  SetBs(nullptr);
69  m_uplinkAllocations.clear();
70 }
71 
72 TypeId
74 {
75  static TypeId tid = TypeId("ns3::UplinkSchedulerRtps")
77  .SetGroupName("Wimax")
78  .AddConstructor<UplinkSchedulerRtps>();
79  return tid;
80 }
81 
82 std::list<OfdmUlMapIe>
84 {
85  return m_uplinkAllocations;
86 }
87 
88 void
90  bool& updateUcd,
91  bool& sendDcd,
92  bool& sendUcd)
93 {
94  /*DCD and UCD shall actually be updated when channel or burst profile definitions
95  change. burst profiles are updated based on number of SSs, network conditions and etc.
96  for now temporarily assuming DCD/UCD shall be updated every time */
97 
98  uint32_t randNr = rand();
99  if (randNr % 5 == 0 || GetBs()->GetNrDcdSent() == 0)
100  {
101  sendDcd = true;
102  }
103 
104  randNr = rand();
105  if (randNr % 5 == 0 || GetBs()->GetNrUcdSent() == 0)
106  {
107  sendUcd = true;
108  }
109 
110  // -------------------------------------
111  // additional, just to send more frequently
112  if (!sendDcd)
113  {
114  randNr = rand();
115  if (randNr % 4 == 0)
116  {
117  sendDcd = true;
118  }
119  }
120 
121  if (!sendUcd)
122  {
123  randNr = rand();
124  if (randNr % 4 == 0)
125  {
126  sendUcd = true;
127  }
128  }
129  // -------------------------------------
130 
131  Time timeSinceLastDcd = Simulator::Now() - GetDcdTimeStamp();
132  Time timeSinceLastUcd = Simulator::Now() - GetUcdTimeStamp();
133 
134  if (timeSinceLastDcd > GetBs()->GetDcdInterval())
135  {
136  sendDcd = true;
138  }
139 
140  if (timeSinceLastUcd > GetBs()->GetUcdInterval())
141  {
142  sendUcd = true;
144  }
145 }
146 
147 uint32_t
149 {
150  return GetBs()->GetNrDlSymbols() * GetBs()->GetPhy()->GetPsPerSymbol() + GetBs()->GetTtg();
151 }
152 
153 void
155  const uint32_t& allocationSize,
156  uint32_t& symbolsToAllocation,
157  uint32_t& availableSymbols)
158 {
159  ulMapIe.SetDuration(allocationSize);
160  ulMapIe.SetStartTime(symbolsToAllocation);
161  m_uplinkAllocations.push_back(ulMapIe);
162  symbolsToAllocation += allocationSize;
163  availableSymbols -= allocationSize;
164 }
165 
166 void
168 {
169  m_uplinkAllocations.clear();
170  SetIsIrIntrvlAllocated(false);
172  bool allocationForDsa = false;
173 
174  uint32_t symbolsToAllocation = 0;
175  uint32_t allocationSize = 0; // size in symbols
176  uint32_t availableSymbols = GetBs()->GetNrUlSymbols();
177 
178  WimaxPhy::ModulationType modulationType;
179  Cid cid;
180 
181  AllocateInitialRangingInterval(symbolsToAllocation, availableSymbols);
182 
183  std::vector<SSRecord*>* ssRecords = GetBs()->GetSSManager()->GetSSRecords();
184  NS_LOG_INFO("UL Scheduler start, availableSymbols = " << availableSymbols);
185 
186  for (auto iter = ssRecords->begin(); iter != ssRecords->end(); ++iter)
187  {
188  SSRecord* ssRecord = *iter;
189  if (ssRecord->GetIsBroadcastSS())
190  {
191  continue;
192  }
193  cid = ssRecord->GetBasicCid();
194  OfdmUlMapIe ulMapIe;
195  ulMapIe.SetCid(cid);
196 
197  if (ssRecord->GetPollForRanging() &&
199  {
200  // SS's ranging is not yet complete
201  // allocating invited initial ranging interval
203  allocationSize = GetBs()->GetRangReqOppSize();
205 
206  if (availableSymbols >= allocationSize)
207  {
208  AddUplinkAllocation(ulMapIe, allocationSize, symbolsToAllocation, availableSymbols);
209  }
210  else
211  {
212  break;
213  }
214  }
215  else
216  {
217  modulationType = ssRecord->GetModulationType();
218 
219  // need to update because modulation/FEC to UIUC mapping may vary over time
220  ulMapIe.SetUiuc(GetBs()->GetBurstProfileManager()->GetBurstProfile(
221  modulationType,
223 
224  // establish service flows for SS
226  !ssRecord->GetAreServiceFlowsAllocated())
227  {
228  // allocating grant (with arbitrary size) to allow SS to send DSA messages DSA-REQ
229  // and DSA-ACK only one DSA allocation per frame
230  if (!allocationForDsa)
231  {
232  allocationSize =
233  GetBs()->GetPhy()->GetNrSymbols(sizeof(DsaReq), modulationType);
234  if (availableSymbols >= allocationSize)
235  {
236  AddUplinkAllocation(ulMapIe,
237  allocationSize,
238  symbolsToAllocation,
239  availableSymbols);
240  allocationForDsa = true;
241  }
242  else
243  {
244  break;
245  }
246  }
247  }
248  else
249  {
250  // all service flows associated to SS are established now
251 
252  /*allocating grants for data transmission for UGS flows (Data Grant Burst Type
253  IEs, 6.3.7.4.3.3) (grant has been referred by different names e.g. transmission
254  opportunity, slot, uplink allocation, etc)*/
255  ServiceUnsolicitedGrants(ssRecord,
257  ulMapIe,
258  modulationType,
259  symbolsToAllocation,
260  availableSymbols);
261 
262  // allocate unicast polls for rtPS flows if bandwidth is available
263  if (availableSymbols)
264  {
265  ServiceUnsolicitedGrants(ssRecord,
267  ulMapIe,
268  modulationType,
269  symbolsToAllocation,
270  availableSymbols);
271  }
272  // allocate unicast polls for nrtPS flows if bandwidth is available
273  if (availableSymbols)
274  {
275  ServiceUnsolicitedGrants(ssRecord,
277  ulMapIe,
278  modulationType,
279  symbolsToAllocation,
280  availableSymbols);
281  }
282  // finally allocate unicast polls for BE flows if bandwidth is available
283  if (availableSymbols)
284  {
285  ServiceUnsolicitedGrants(ssRecord,
287  ulMapIe,
288  modulationType,
289  symbolsToAllocation,
290  availableSymbols);
291  }
292  }
293  }
294  }
295 
296  /*
297  * Uplink Scheduler for rtPS Connection
298  */
299  if (availableSymbols)
300  {
301  ULSchedulerRTPSConnection(symbolsToAllocation, availableSymbols);
302  }
303 
304  // UL Scheduler for nrtPS and BE flows
305  if (availableSymbols)
306  {
307  for (auto iter = ssRecords->begin(); iter != ssRecords->end(); ++iter)
308  {
309  SSRecord* ssRecord = *iter;
310  if (ssRecord->GetIsBroadcastSS())
311  {
312  continue;
313  }
314  if (!ssRecord->GetPollForRanging() &&
316  ssRecord->GetAreServiceFlowsAllocated())
317  {
318  OfdmUlMapIe ulMapIe;
319  cid = ssRecord->GetBasicCid();
320  ulMapIe.SetCid(cid);
321  modulationType = ssRecord->GetModulationType();
322  ulMapIe.SetUiuc(GetBs()->GetBurstProfileManager()->GetBurstProfile(
323  modulationType,
325 
326  // allocate unicast polls for nrtPS flows if bandwidth is available
327 
328  ServiceBandwidthRequests(ssRecord,
330  ulMapIe,
331  modulationType,
332  symbolsToAllocation,
333  availableSymbols);
334 
335  // finally allocate unicast polls for BE flows if bandwidth is available
336  if (availableSymbols)
337  {
338  ServiceBandwidthRequests(ssRecord,
340  ulMapIe,
341  modulationType,
342  symbolsToAllocation,
343  availableSymbols);
344  }
345  }
346  }
347  }
348 
349  OfdmUlMapIe ulMapIeEnd;
350  ulMapIeEnd.SetCid(Cid::InitialRanging());
351  ulMapIeEnd.SetStartTime(symbolsToAllocation);
353  ulMapIeEnd.SetDuration(0);
354  m_uplinkAllocations.push_back(ulMapIeEnd);
355 
356  // setting DL/UL subframe allocation for the next frame
357  GetBs()->GetBandwidthManager()->SetSubframeRatio();
358 }
359 
360 void
362  ServiceFlow::SchedulingType schedulingType,
363  OfdmUlMapIe& ulMapIe,
364  const WimaxPhy::ModulationType modulationType,
365  uint32_t& symbolsToAllocation,
366  uint32_t& availableSymbols)
367 {
368  uint32_t allocationSize = 0; // size in symbols
369  uint8_t uiuc = ulMapIe.GetUiuc(); // SS's burst profile
370  std::vector<ServiceFlow*> serviceFlows = ssRecord->GetServiceFlows(schedulingType);
371 
372  for (auto iter = serviceFlows.begin(); iter != serviceFlows.end(); ++iter)
373  {
374  ServiceFlow* serviceFlow = *iter;
375 
376  /* in case of rtPS, nrtPS and BE, allocating unicast polls for bandwidth requests (Request
377  IEs, 6.3.7.4.3.1). in case of UGS, allocating grants for data transmission (Data Grant
378  Burst Type IEs, 6.3.7.4.3.3) (grant has been referred in this code by different names e.g.
379  transmission opportunity, slot, allocation, etc) */
380 
381  allocationSize =
382  GetBs()->GetBandwidthManager()->CalculateAllocationSize(ssRecord, serviceFlow);
383 
384  // verifying that minimum reserved traffic rate of nrtPS flow is maintained
385  if (serviceFlow->GetSchedulingType() == ServiceFlow::SF_TYPE_NRTPS)
386  {
387  Time currentTime = Simulator::Now();
388  ServiceFlowRecord* record = serviceFlow->GetRecord();
389  if (currentTime - record->GetGrantTimeStamp() > Seconds(1))
390  {
391  uint32_t bps = (record->GetBwSinceLastExpiry() * 8);
392  if (bps < serviceFlow->GetMinReservedTrafficRate())
393  {
394  ServiceBandwidthRequests(serviceFlow,
395  schedulingType,
396  ulMapIe,
397  modulationType,
398  symbolsToAllocation,
399  availableSymbols);
400  record->SetBwSinceLastExpiry(0);
401  record->SetGrantTimeStamp(currentTime);
402  }
403  }
404  }
405 
406  if (availableSymbols < allocationSize)
407  {
408  break;
409  }
410 
411  if (allocationSize > 0)
412  {
413  ulMapIe.SetStartTime(symbolsToAllocation);
414  if (serviceFlow->GetSchedulingType() != ServiceFlow::SF_TYPE_UGS)
415  {
416  // special burst profile with most robust modulation type is used for unicast polls
417  // (Request IEs)
419  }
420  }
421  else
422  {
423  continue;
424  }
425 
426  if (serviceFlow->GetSchedulingType() == ServiceFlow::SF_TYPE_UGS)
427  {
428  NS_LOG_DEBUG("BS uplink scheduler, UGS allocation, size: " << allocationSize
429  << " symbols");
430  }
431  else
432  {
433  NS_LOG_DEBUG("BS uplink scheduler, " << serviceFlow->GetSchedulingTypeStr()
434  << " unicast poll, size: " << allocationSize
435  << " symbols"
436  << ", modulation: BPSK 1/2");
437  }
438 
439  NS_LOG_DEBUG(", CID: " << serviceFlow->GetConnection()->GetCid()
440  << ", SFID: " << serviceFlow->GetSfid());
441 
442  AddUplinkAllocation(ulMapIe, allocationSize, symbolsToAllocation, availableSymbols);
443  ulMapIe.SetUiuc(uiuc);
444  }
445 }
446 
447 void
449  ServiceFlow::SchedulingType schedulingType,
450  OfdmUlMapIe& ulMapIe,
451  const WimaxPhy::ModulationType modulationType,
452  uint32_t& symbolsToAllocation,
453  uint32_t& availableSymbols)
454 {
455  std::vector<ServiceFlow*> serviceFlows = ssRecord->GetServiceFlows(schedulingType);
456 
457  for (auto iter = serviceFlows.begin(); iter != serviceFlows.end(); ++iter)
458  {
459  if (!ServiceBandwidthRequests(*iter,
460  schedulingType,
461  ulMapIe,
462  modulationType,
463  symbolsToAllocation,
464  availableSymbols))
465  {
466  break;
467  }
468  }
469 }
470 
471 bool
473  ServiceFlow::SchedulingType schedulingType,
474  OfdmUlMapIe& ulMapIe,
475  const WimaxPhy::ModulationType modulationType,
476  uint32_t& symbolsToAllocation,
477  uint32_t& availableSymbols)
478 {
479  uint32_t allocSizeBytes = 0;
480  uint32_t allocSizeSymbols = 0;
481  uint16_t sduSize = 0;
482 
483  ServiceFlowRecord* record = serviceFlow->GetRecord();
484  sduSize = serviceFlow->GetSduSize();
485 
486  uint32_t requiredBandwidth = record->GetRequestedBandwidth() - record->GetGrantedBandwidth();
487  if (requiredBandwidth > 0)
488  {
489  if (sduSize > 0)
490  {
491  // if SDU size is mentioned, allocate grant of that size
492  allocSizeBytes = sduSize;
493  allocSizeSymbols = GetBs()->GetPhy()->GetNrSymbols(sduSize, modulationType);
494  }
495  else
496  {
497  allocSizeBytes = requiredBandwidth;
498  allocSizeSymbols = GetBs()->GetPhy()->GetNrSymbols(requiredBandwidth, modulationType);
499  }
500 
501  if (availableSymbols >= allocSizeSymbols)
502  {
503  NS_LOG_DEBUG("BS uplink scheduler, "
504  << serviceFlow->GetSchedulingTypeStr()
505  << " allocation, size: " << allocSizeSymbols << " symbols"
506  << ", CID: " << serviceFlow->GetConnection()->GetCid()
507  << ", SFID: " << serviceFlow->GetSfid()
508  << ", bw requested: " << record->GetRequestedBandwidth()
509  << ", bw granted: " << record->GetGrantedBandwidth());
510 
511  record->UpdateGrantedBandwidth(allocSizeBytes);
512 
513  if (schedulingType == ServiceFlow::SF_TYPE_NRTPS)
514  {
515  record->SetBwSinceLastExpiry(allocSizeBytes);
516  }
517 
518  AddUplinkAllocation(ulMapIe, allocSizeSymbols, symbolsToAllocation, availableSymbols);
519  }
520  else
521  {
522  return false;
523  }
524  }
525  return true;
526 }
527 
528 void
530  uint32_t& availableSymbols)
531 {
532  NS_LOG_INFO("\tUL Scheduler for rtPS flows");
533  NS_LOG_INFO("\t\tavailableSymbols = " << availableSymbols);
534  ServiceFlowRecord* record_[100];
535  uint32_t allocSizeSymbols_[100]; // symbolsRequired for each SSRecord
536  OfdmUlMapIe ulMapIe_[100];
537  OfdmUlMapIe ulMapIe;
538  WimaxPhy::ModulationType modulationType_[100];
539  WimaxPhy::ModulationType modulationType;
540  int nbAllocation = 0;
541  uint32_t allocSizeBytes;
542  uint32_t totAllocSizeSymbols = 0;
543 
544  Cid cid;
545  std::vector<SSRecord*>* ssRecords = GetBs()->GetSSManager()->GetSSRecords();
546 
547  for (auto iter = ssRecords->begin(); iter != ssRecords->end(); ++iter)
548  {
549  SSRecord* ssRecord = *iter;
550  if (ssRecord->GetIsBroadcastSS())
551  {
552  continue;
553  }
554  if (!ssRecord->GetPollForRanging() &&
556  ssRecord->GetAreServiceFlowsAllocated())
557  {
558  cid = ssRecord->GetBasicCid();
559  ulMapIe.SetCid(cid);
560  modulationType = ssRecord->GetModulationType();
561  ulMapIe.SetUiuc(GetBs()->GetBurstProfileManager()->GetBurstProfile(
562  modulationType,
564 
565  std::vector<ServiceFlow*> serviceFlows =
567  for (auto iter2 = serviceFlows.begin(); iter2 != serviceFlows.end(); ++iter2)
568  {
569  record_[nbAllocation] = (*iter2)->GetRecord();
570  uint32_t requiredBandwidth = record_[nbAllocation]->GetRequestedBandwidth() -
571  record_[nbAllocation]->GetGrantedBandwidth();
572 
573  if (requiredBandwidth > 0)
574  {
575  modulationType_[nbAllocation] = modulationType;
576  ulMapIe_[nbAllocation] = ulMapIe;
577  allocSizeBytes = requiredBandwidth;
578  allocSizeSymbols_[nbAllocation] =
579  GetBs()->GetPhy()->GetNrSymbols(allocSizeBytes,
580  modulationType_[nbAllocation]);
581  totAllocSizeSymbols += allocSizeSymbols_[nbAllocation];
582 
583  NS_LOG_INFO(
584  "\t\tUL Scheduler for CID = " << (*iter2)->GetConnection()->GetCid());
585  NS_LOG_INFO("\t\t\trequiredBandwidth = "
586  << record_[nbAllocation]->GetRequestedBandwidth()
587  << ", allocSizeSymbols = " << allocSizeSymbols_[nbAllocation]
588  << ", modulationType = " << modulationType_[nbAllocation]);
589 
590  nbAllocation += 1;
591  }
592  }
593  }
594  }
595 
596  NS_LOG_INFO("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols);
597 
598  // Channel Saturation
599  while (totAllocSizeSymbols > availableSymbols)
600  {
601  NS_LOG_INFO("\tUL Channel Saturation: totAllocSizeSymbols > availableSymbols");
602  double delta = double(availableSymbols) / double(totAllocSizeSymbols);
603  NS_LOG_INFO("\t\tdelta = " << delta);
604  totAllocSizeSymbols = 0;
605  for (int i = 0; i < nbAllocation; i++)
606  {
607  NS_LOG_INFO("\t\tprevious allocSizeSymbols_[" << i << "] = " << allocSizeSymbols_[i]);
608  allocSizeSymbols_[i] = (uint32_t)std::floor(allocSizeSymbols_[i] * delta);
609  totAllocSizeSymbols += allocSizeSymbols_[i];
610  NS_LOG_INFO("\t\tnew allocSizeSymbols_[" << i << "] = " << allocSizeSymbols_[i]);
611  }
612  NS_LOG_INFO("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols);
613  }
614 
615  // Uplink Bandwidth Allocation
616  for (int i = 0; i < nbAllocation; i++)
617  {
618  AddUplinkAllocation(ulMapIe_[i],
619  allocSizeSymbols_[i],
620  symbolsToAllocation,
621  availableSymbols);
622  allocSizeBytes = GetBs()->GetPhy()->GetNrBytes(allocSizeSymbols_[i], modulationType_[i]);
623  NS_LOG_INFO("\t\tUpdateGrantedBandwidth for " << i << " = " << allocSizeBytes);
624  if (record_[i]->GetRequestedBandwidth() < allocSizeBytes)
625  {
626  // the flow need new poll to set the newer requiredBandwidth
627  record_[i]->SetGrantedBandwidth(0);
628  record_[i]->SetRequestedBandwidth(0);
629  }
630  else
631  {
632  record_[i]->UpdateGrantedBandwidth(allocSizeBytes);
633  }
634  }
635 }
636 
637 void
639  uint32_t& availableSymbols)
640 {
641  Time ssUlStartTime =
642  Seconds(CalculateAllocationStartTime() * GetBs()->GetPsDuration().GetSeconds());
643  SetNrIrOppsAllocated(GetBs()->GetLinkManager()->CalculateRangingOppsToAllocate());
644  uint32_t allocationSize = GetNrIrOppsAllocated() * GetBs()->GetRangReqOppSize();
645  Time timeSinceLastIrInterval = Simulator::Now() - GetTimeStampIrInterval();
646 
647  // adding one frame because may be the time has not elapsed now but will elapse before the next
648  // frame is sent
649  if (timeSinceLastIrInterval + GetBs()->GetPhy()->GetFrameDuration() >
650  GetBs()->GetInitialRangingInterval() &&
651  availableSymbols >= allocationSize)
652  {
654  OfdmUlMapIe ulMapIeIr;
655  ulMapIeIr.SetCid(GetBs()->GetBroadcastConnection()->GetCid());
656  ulMapIeIr.SetStartTime(symbolsToAllocation);
658 
659  NS_LOG_DEBUG("BS uplink scheduler, initial ranging allocation, size: "
660  << allocationSize << " symbols"
661  << ", modulation: BPSK 1/2");
662 
663  // marking start and end of each TO, only for debugging
664  for (uint8_t i = 0; i < GetNrIrOppsAllocated(); i++)
665  {
666  GetBs()->MarkRangingOppStart(
667  ssUlStartTime +
668  Seconds(symbolsToAllocation * GetBs()->GetSymbolDuration().GetSeconds()) +
669  Seconds(i * GetBs()->GetRangReqOppSize() *
670  GetBs()->GetSymbolDuration().GetSeconds()));
671  }
672 
673  AddUplinkAllocation(ulMapIeIr, allocationSize, symbolsToAllocation, availableSymbols);
675  }
676 }
677 
678 void
680 {
681  uint8_t delayNrFrames = 1;
682  uint32_t bitsPerSecond = serviceFlow->GetMinReservedTrafficRate();
683  WimaxPhy::ModulationType modulation;
684  uint32_t bytesPerFrame =
685  (uint32_t((double)(bitsPerSecond)*GetBs()->GetPhy()->GetFrameDuration().GetSeconds())) / 8;
686  uint32_t frameDurationMSec = GetBs()->GetPhy()->GetFrameDuration().GetMilliSeconds();
687 
688  switch (serviceFlow->GetSchedulingType())
689  {
691  if (serviceFlow->GetIsMulticast())
692  {
693  modulation = serviceFlow->GetModulation();
694  }
695  else
696  {
697  modulation = ssRecord->GetModulationType();
698  }
699  uint32_t grantSize = GetBs()->GetPhy()->GetNrSymbols(bytesPerFrame, modulation);
700  serviceFlow->GetRecord()->SetGrantSize(grantSize);
701 
702  uint32_t toleratedJitter = serviceFlow->GetToleratedJitter();
703 
704  if (toleratedJitter > frameDurationMSec)
705  {
706  delayNrFrames = (uint8_t)(toleratedJitter / frameDurationMSec);
707  }
708 
709  uint16_t interval = delayNrFrames * frameDurationMSec;
710  serviceFlow->SetUnsolicitedGrantInterval(interval);
711  }
712  break;
714  if (serviceFlow->GetSduSize() > bytesPerFrame)
715  {
716  delayNrFrames = (uint8_t)(serviceFlow->GetSduSize() / bytesPerFrame);
717  }
718 
719  uint16_t interval = delayNrFrames * frameDurationMSec;
720  serviceFlow->SetUnsolicitedPollingInterval(interval);
721  }
722  break;
724  // no real-time guarantees are given to NRTPS, serviced based on available bandwidth
725  }
726  break;
728  // no real-time guarantees are given to BE, serviced based on available bandwidth
729  }
730  break;
731  default:
732  NS_FATAL_ERROR("Invalid scheduling type");
733  }
734 }
735 
736 void
738 {
739 }
740 
741 void
743 {
744 }
745 
746 void
748 {
749  // m_grantedBandwidth must be reset to zero
750  uint32_t grantedBandwidth = 0;
751  sfr->SetGrantedBandwidth(grantedBandwidth);
752 }
753 
754 } // namespace ns3
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
Cid class.
Definition: cid.h:37
static Cid InitialRanging()
Definition: cid.cc:87
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:386
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
void SetStartTime(uint16_t startTime)
Set start time.
uint8_t GetUiuc() const
Get UIUC.
void SetDuration(uint16_t duration)
Set duration.
void SetCid(const Cid &cid)
Set CID.
void SetUiuc(uint8_t uiuc)
Set UIUC.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:46
Cid GetBasicCid() const
Get basic CID.
Definition: ss-record.cc:95
WimaxNetDevice::RangingStatus GetRangingStatus() const
Get ranging status.
Definition: ss-record.cc:179
bool GetPollForRanging() const
Get poll for ranging.
Definition: ss-record.cc:197
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
Get service flows.
Definition: ss-record.cc:233
bool GetAreServiceFlowsAllocated() const
Check if service flows are allocated.
Definition: ss-record.cc:209
bool GetIsBroadcastSS() const
Get is broadcast SS.
Definition: ss-record.cc:254
WimaxPhy::ModulationType GetModulationType() const
Get modulation type.
Definition: ss-record.cc:167
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
uint32_t GetSfid() const
Get SFID.
ServiceFlow::SchedulingType GetSchedulingType() const
Get scheduling type.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
char * GetSchedulingTypeStr() const
Get scheduling type string.
uint32_t GetMinReservedTrafficRate() const
Get minimum reserved traffic rate.
uint8_t GetSduSize() const
Get SDU size.
WimaxPhy::ModulationType GetModulation() const
Get modulation.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicited grant interval.
ServiceFlowRecord * GetRecord() const
Get service flow record.
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
bool GetIsMulticast() const
Get is multicast.
uint32_t GetToleratedJitter() const
Get tolerated jitter.
Ptr< WimaxConnection > GetConnection() const
Can return a null connection is this service flow has not been associated yet to a connection.
this class implements a structure to manage some parameters and statistics related to a service flow
uint32_t GetRequestedBandwidth() const
void SetRequestedBandwidth(uint32_t requestedBandwidth)
set the requested bandwidth
void SetGrantSize(uint32_t grantSize)
Set the grant size (only for UGS service flows)
uint32_t GetGrantedBandwidth() const
void SetBwSinceLastExpiry(uint32_t bwSinceLastExpiry)
set BW since last expiry
void UpdateGrantedBandwidth(uint32_t grantedBandwidth)
update the granted bandwidth
uint32_t GetBwSinceLastExpiry() const
void SetGrantTimeStamp(Time grantTimeStamp)
Set the grant time stamp.
void SetGrantedBandwidth(uint32_t grantedBandwidth)
set the granted bandwidth
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.