OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007,2008 INRIA | 3 * Copyright (c) 2007,2008 INRIA |
4 * 2009 TELEMATICS LAB, Politecnico di Bari | 4 * 2009 TELEMATICS LAB, Politecnico di Bari |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 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 | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 std::list<OfdmUlMapIe> | 82 std::list<OfdmUlMapIe> |
83 UplinkSchedulerRtps::GetUplinkAllocations (void) const | 83 UplinkSchedulerRtps::GetUplinkAllocations (void) const |
84 { | 84 { |
85 return m_uplinkAllocations; | 85 return m_uplinkAllocations; |
86 } | 86 } |
87 | 87 |
88 void | 88 void |
89 UplinkSchedulerRtps::GetChannelDescriptorsToUpdate (bool &updateDcd, bool &updat
eUcd, bool &sendDcd, bool &sendUcd) | 89 UplinkSchedulerRtps::GetChannelDescriptorsToUpdate (bool &updateDcd, bool &updat
eUcd, bool &sendDcd, bool &sendUcd) |
90 { | 90 { |
| 91 NS_UNUSED (updateDcd); |
| 92 NS_UNUSED (updateUcd); |
91 /*DCD and UCD shall actually be updated when channel or burst profile definiti
ons | 93 /*DCD and UCD shall actually be updated when channel or burst profile definiti
ons |
92 change. burst profiles are updated based on number of SSs, network conditions
and etc. | 94 change. burst profiles are updated based on number of SSs, network conditions
and etc. |
93 for now temporarily assuming DCD/UCD shall be updated everytime */ | 95 for now temporarily assuming DCD/UCD shall be updated everytime */ |
94 | 96 |
95 uint32_t randNr = rand (); | 97 uint32_t randNr = rand (); |
96 if (randNr % 5 == 0 || GetBs ()->GetNrDcdSent () == 0) | 98 if (randNr % 5 == 0 || GetBs ()->GetNrDcdSent () == 0) |
97 { | 99 { |
98 sendDcd = true; | 100 sendDcd = true; |
99 } | 101 } |
100 | 102 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 { | 148 { |
147 return GetBs ()->GetNrDlSymbols () * GetBs ()->GetPhy ()->GetPsPerSymbol () +
GetBs ()->GetTtg (); | 149 return GetBs ()->GetNrDlSymbols () * GetBs ()->GetPhy ()->GetPsPerSymbol () +
GetBs ()->GetTtg (); |
148 } | 150 } |
149 | 151 |
150 void | 152 void |
151 UplinkSchedulerRtps::AddUplinkAllocation (OfdmUlMapIe &ulMapIe, | 153 UplinkSchedulerRtps::AddUplinkAllocation (OfdmUlMapIe &ulMapIe, |
152 const uint32_t &allocationSize, | 154 const uint32_t &allocationSize, |
153 uint32_t &symbolsToAllocation, | 155 uint32_t &symbolsToAllocation, |
154 uint32_t &availableSymbols) | 156 uint32_t &availableSymbols) |
155 { | 157 { |
156 ulMapIe.SetDuration (allocationSize); | 158 ulMapIe.SetDuration (static_cast<uint16_t> (allocationSize)); |
157 ulMapIe.SetStartTime (symbolsToAllocation); | 159 ulMapIe.SetStartTime (static_cast<uint16_t> (symbolsToAllocation)); |
158 m_uplinkAllocations.push_back (ulMapIe); | 160 m_uplinkAllocations.push_back (ulMapIe); |
159 symbolsToAllocation += allocationSize; | 161 symbolsToAllocation += allocationSize; |
160 availableSymbols -= allocationSize; | 162 availableSymbols -= allocationSize; |
161 } | 163 } |
162 | 164 |
163 void | 165 void |
164 UplinkSchedulerRtps::Schedule (void) | 166 UplinkSchedulerRtps::Schedule (void) |
165 { | 167 { |
166 m_uplinkAllocations.clear (); | 168 m_uplinkAllocations.clear (); |
167 SetIsIrIntrvlAllocated (false); | 169 SetIsIrIntrvlAllocated (false); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217
WimaxNetDevice::DIRECTION_UPLINK)); | 219
WimaxNetDevice::DIRECTION_UPLINK)); |
218 | 220 |
219 // establish service flows for SS | 221 // establish service flows for SS |
220 if (ssRecord->GetRangingStatus () == WimaxNetDevice::RANGING_STATUS_SU
CCESS | 222 if (ssRecord->GetRangingStatus () == WimaxNetDevice::RANGING_STATUS_SU
CCESS |
221 && !ssRecord->GetAreServiceFlowsAllocated ()) | 223 && !ssRecord->GetAreServiceFlowsAllocated ()) |
222 { | 224 { |
223 // allocating grant (with arbitrary size) to allow SS to send DSA
messages DSA-REQ and DSA-ACK | 225 // allocating grant (with arbitrary size) to allow SS to send DSA
messages DSA-REQ and DSA-ACK |
224 // only one DSA allocation per frame | 226 // only one DSA allocation per frame |
225 if (!allocationForDsa) | 227 if (!allocationForDsa) |
226 { | 228 { |
227 allocationSize = GetBs ()->GetPhy ()->GetNrSymbols (sizeof(Dsa
Req), modulationType); | 229 allocationSize = static_cast<uint32_t> (GetBs ()->GetPhy ()->G
etNrSymbols (sizeof(DsaReq), modulationType)); |
228 if (availableSymbols >= allocationSize) | 230 if (availableSymbols >= allocationSize) |
229 { | 231 { |
230 AddUplinkAllocation (ulMapIe, allocationSize, symbolsToAll
ocation, availableSymbols); | 232 AddUplinkAllocation (ulMapIe, allocationSize, symbolsToAll
ocation, availableSymbols); |
231 allocationForDsa = true; | 233 allocationForDsa = true; |
232 } | 234 } |
233 else | 235 else |
234 { | 236 { |
235 break; | 237 break; |
236 } | 238 } |
237 } | 239 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 modulationType, | 332 modulationType, |
331 symbolsToAllocation, | 333 symbolsToAllocation, |
332 availableSymbols); | 334 availableSymbols); |
333 } | 335 } |
334 } | 336 } |
335 } | 337 } |
336 } | 338 } |
337 | 339 |
338 OfdmUlMapIe ulMapIeEnd; | 340 OfdmUlMapIe ulMapIeEnd; |
339 ulMapIeEnd.SetCid (Cid::InitialRanging ()); | 341 ulMapIeEnd.SetCid (Cid::InitialRanging ()); |
340 ulMapIeEnd.SetStartTime (symbolsToAllocation); | 342 ulMapIeEnd.SetStartTime (static_cast<uint16_t> (symbolsToAllocation)); |
341 ulMapIeEnd.SetUiuc (OfdmUlBurstProfile::UIUC_END_OF_MAP); | 343 ulMapIeEnd.SetUiuc (OfdmUlBurstProfile::UIUC_END_OF_MAP); |
342 ulMapIeEnd.SetDuration (0); | 344 ulMapIeEnd.SetDuration (0); |
343 m_uplinkAllocations.push_back (ulMapIeEnd); | 345 m_uplinkAllocations.push_back (ulMapIeEnd); |
344 | 346 |
345 // setting DL/UL subframe allocation for the next frame | 347 // setting DL/UL subframe allocation for the next frame |
346 GetBs ()->GetBandwidthManager ()->SetSubframeRatio (); | 348 GetBs ()->GetBandwidthManager ()->SetSubframeRatio (); |
347 } | 349 } |
348 | 350 |
349 void | 351 void |
350 UplinkSchedulerRtps::ServiceUnsolicitedGrants (const SSRecord *ssRecord, | 352 UplinkSchedulerRtps::ServiceUnsolicitedGrants (const SSRecord *ssRecord, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 392 } |
391 } | 393 } |
392 | 394 |
393 if (availableSymbols < allocationSize) | 395 if (availableSymbols < allocationSize) |
394 { | 396 { |
395 break; | 397 break; |
396 } | 398 } |
397 | 399 |
398 if (allocationSize > 0) | 400 if (allocationSize > 0) |
399 { | 401 { |
400 ulMapIe.SetStartTime (symbolsToAllocation); | 402 ulMapIe.SetStartTime (static_cast<uint16_t> (symbolsToAllocation)); |
401 if (serviceFlow->GetSchedulingType () != ServiceFlow::SF_TYPE_UGS) | 403 if (serviceFlow->GetSchedulingType () != ServiceFlow::SF_TYPE_UGS) |
402 { | 404 { |
403 // special burst profile with most robust modulation type is used
for unicast polls (Request IEs) | 405 // special burst profile with most robust modulation type is used
for unicast polls (Request IEs) |
404 ulMapIe.SetUiuc (OfdmUlBurstProfile::UIUC_REQ_REGION_FULL); | 406 ulMapIe.SetUiuc (OfdmUlBurstProfile::UIUC_REQ_REGION_FULL); |
405 } | 407 } |
406 } | 408 } |
407 else | 409 else |
408 { | 410 { |
409 continue; | 411 continue; |
410 } | 412 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 ServiceFlowRecord *record = serviceFlow->GetRecord (); | 467 ServiceFlowRecord *record = serviceFlow->GetRecord (); |
466 sduSize = serviceFlow->GetSduSize (); | 468 sduSize = serviceFlow->GetSduSize (); |
467 | 469 |
468 uint32_t requiredBandwidth = record->GetRequestedBandwidth () - record->GetGra
ntedBandwidth (); | 470 uint32_t requiredBandwidth = record->GetRequestedBandwidth () - record->GetGra
ntedBandwidth (); |
469 if (requiredBandwidth > 0) | 471 if (requiredBandwidth > 0) |
470 { | 472 { |
471 if (sduSize > 0) | 473 if (sduSize > 0) |
472 { | 474 { |
473 // if SDU size is mentioned, allocate grant of that size | 475 // if SDU size is mentioned, allocate grant of that size |
474 allocSizeBytes = sduSize; | 476 allocSizeBytes = sduSize; |
475 allocSizeSymbols = GetBs ()->GetPhy ()->GetNrSymbols (sduSize, modulat
ionType); | 477 allocSizeSymbols = static_cast<uint32_t> (GetBs ()->GetPhy ()->GetNrSy
mbols (sduSize, modulationType)); |
476 } | 478 } |
477 else | 479 else |
478 { | 480 { |
479 allocSizeBytes = requiredBandwidth; | 481 allocSizeBytes = requiredBandwidth; |
480 allocSizeSymbols = GetBs ()->GetPhy ()->GetNrSymbols (requiredBandwidt
h, modulationType); | 482 allocSizeSymbols = static_cast<uint32_t> (GetBs ()->GetPhy ()->GetNrSy
mbols (requiredBandwidth, modulationType)); |
481 } | 483 } |
482 | 484 |
483 if (availableSymbols >= allocSizeSymbols) | 485 if (availableSymbols >= allocSizeSymbols) |
484 { | 486 { |
485 | 487 |
486 NS_LOG_DEBUG ("BS uplink scheduler, " << serviceFlow->GetSchedulingTyp
eStr () << " allocation, size: " | 488 NS_LOG_DEBUG ("BS uplink scheduler, " << serviceFlow->GetSchedulingTyp
eStr () << " allocation, size: " |
487 << allocSizeSymbols << " symbols
" << ", CID: " << serviceFlow->GetConnection ()->GetCid () << ", SFID: " | 489 << allocSizeSymbols << " symbols
" << ", CID: " << serviceFlow->GetConnection ()->GetCid () << ", SFID: " |
488 << serviceFlow->GetSfid () << ",
bw requested: " << record->GetRequestedBandwidth () << ", bw granted: " | 490 << serviceFlow->GetSfid () << ",
bw requested: " << record->GetRequestedBandwidth () << ", bw granted: " |
489 << record->GetGrantedBandwidth (
)); | 491 << record->GetGrantedBandwidth (
)); |
490 | 492 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 { | 546 { |
545 record_[nbAllocation] = (*iter2)->GetRecord (); | 547 record_[nbAllocation] = (*iter2)->GetRecord (); |
546 uint32_t requiredBandwidth = record_[nbAllocation]->GetRequestedBa
ndwidth () | 548 uint32_t requiredBandwidth = record_[nbAllocation]->GetRequestedBa
ndwidth () |
547 - record_[nbAllocation]->GetGrantedBandwidth (); | 549 - record_[nbAllocation]->GetGrantedBandwidth (); |
548 | 550 |
549 if (requiredBandwidth > 0) | 551 if (requiredBandwidth > 0) |
550 { | 552 { |
551 modulationType_[nbAllocation] = modulationType; | 553 modulationType_[nbAllocation] = modulationType; |
552 ulMapIe_[nbAllocation] = ulMapIe; | 554 ulMapIe_[nbAllocation] = ulMapIe; |
553 allocSizeBytes = requiredBandwidth; | 555 allocSizeBytes = requiredBandwidth; |
554 allocSizeSymbols_[nbAllocation] = GetBs ()->GetPhy ()->GetNrSy
mbols (allocSizeBytes, | 556 allocSizeSymbols_[nbAllocation] = static_cast<uint32_t> (GetBs
()->GetPhy ()->GetNrSymbols (allocSizeBytes, |
555
modulationType_[nbAllocation]); | 557
modulationType_[nbAllocation])); |
556 totAllocSizeSymbols += allocSizeSymbols_[nbAllocation]; | 558 totAllocSizeSymbols += allocSizeSymbols_[nbAllocation]; |
557 | 559 |
558 NS_LOG_INFO ("\t\tUL Scheduler for CID = " << (*iter2)->GetCon
nection ()->GetCid ()); | 560 NS_LOG_INFO ("\t\tUL Scheduler for CID = " << (*iter2)->GetCon
nection ()->GetCid ()); |
559 NS_LOG_INFO ("\t\t\trequiredBandwidth = " << record_[nbAllocat
ion]->GetRequestedBandwidth () | 561 NS_LOG_INFO ("\t\t\trequiredBandwidth = " << record_[nbAllocat
ion]->GetRequestedBandwidth () |
560 << ", allocSizeSymbo
ls = " << allocSizeSymbols_[nbAllocation] << ", modulationType = " | 562 << ", allocSizeSymbo
ls = " << allocSizeSymbols_[nbAllocation] << ", modulationType = " |
561 << modulationType_[n
bAllocation]); | 563 << modulationType_[n
bAllocation]); |
562 | 564 |
563 nbAllocation += 1; | 565 nbAllocation += 1; |
564 } | 566 } |
565 } | 567 } |
(...skipping 16 matching lines...) Expand all Loading... |
582 totAllocSizeSymbols += allocSizeSymbols_[i]; | 584 totAllocSizeSymbols += allocSizeSymbols_[i]; |
583 NS_LOG_INFO ("\t\tnew allocSizeSymbols_[" << i << "] = " << allocSizeS
ymbols_[i]); | 585 NS_LOG_INFO ("\t\tnew allocSizeSymbols_[" << i << "] = " << allocSizeS
ymbols_[i]); |
584 } | 586 } |
585 NS_LOG_INFO ("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols); | 587 NS_LOG_INFO ("\t\ttotAllocSizeSymbols = " << totAllocSizeSymbols); |
586 } | 588 } |
587 | 589 |
588 // Uplink Bandwidth Allocation | 590 // Uplink Bandwidth Allocation |
589 for (int i = 0; i < nbAllocation; i++) | 591 for (int i = 0; i < nbAllocation; i++) |
590 { | 592 { |
591 AddUplinkAllocation (ulMapIe_[i], allocSizeSymbols_[i], symbolsToAllocatio
n, availableSymbols); | 593 AddUplinkAllocation (ulMapIe_[i], allocSizeSymbols_[i], symbolsToAllocatio
n, availableSymbols); |
592 allocSizeBytes = GetBs ()->GetPhy ()->GetNrBytes (allocSizeSymbols_[i], mo
dulationType_[i]); | 594 allocSizeBytes = static_cast<uint32_t> (GetBs ()->GetPhy ()->GetNrBytes (a
llocSizeSymbols_[i], modulationType_[i])); |
593 NS_LOG_INFO ("\t\tUpdateGrantedBandwidth for " << i << " = " << allocSizeB
ytes); | 595 NS_LOG_INFO ("\t\tUpdateGrantedBandwidth for " << i << " = " << allocSizeB
ytes); |
594 if (record_[i]->GetRequestedBandwidth () < allocSizeBytes) | 596 if (record_[i]->GetRequestedBandwidth () < allocSizeBytes) |
595 { | 597 { |
596 // the flow need new poll to set the newer requredBandwidth | 598 // the flow need new poll to set the newer requredBandwidth |
597 record_[i]->SetGrantedBandwidth (0); | 599 record_[i]->SetGrantedBandwidth (0); |
598 record_[i]->SetRequestedBandwidth (0); | 600 record_[i]->SetRequestedBandwidth (0); |
599 } | 601 } |
600 else | 602 else |
601 { | 603 { |
602 record_[i]->UpdateGrantedBandwidth (allocSizeBytes); | 604 record_[i]->UpdateGrantedBandwidth (allocSizeBytes); |
603 } | 605 } |
604 } | 606 } |
605 } | 607 } |
606 | 608 |
607 void | 609 void |
608 UplinkSchedulerRtps::AllocateInitialRangingInterval (uint32_t &symbolsToAllocati
on, uint32_t &availableSymbols) | 610 UplinkSchedulerRtps::AllocateInitialRangingInterval (uint32_t &symbolsToAllocati
on, uint32_t &availableSymbols) |
609 { | 611 { |
610 Time ssUlStartTime = Seconds (CalculateAllocationStartTime () * GetBs ()->GetP
sDuration ().GetSeconds ()); | 612 Time ssUlStartTime = Seconds (CalculateAllocationStartTime () * GetBs ()->GetP
sDuration ().GetSeconds ()); |
611 SetNrIrOppsAllocated (GetBs ()->GetLinkManager ()->CalculateRangingOppsToAlloc
ate ()); | 613 SetNrIrOppsAllocated (GetBs ()->GetLinkManager ()->CalculateRangingOppsToAlloc
ate ()); |
612 uint32_t allocationSize = GetNrIrOppsAllocated () * GetBs ()->GetRangReqOppSiz
e (); | 614 uint32_t allocationSize = GetNrIrOppsAllocated () * GetBs ()->GetRangReqOppSiz
e (); |
613 Time timeSinceLastIrInterval = Simulator::Now () - GetTimeStampIrInterval (); | 615 Time timeSinceLastIrInterval = Simulator::Now () - GetTimeStampIrInterval (); |
614 | 616 |
615 // adding one frame because may be the time has not elapsed now but will elaps
e before the next frame is sent | 617 // adding one frame because may be the time has not elapsed now but will elaps
e before the next frame is sent |
616 if (timeSinceLastIrInterval + GetBs ()->GetPhy ()->GetFrameDuration () > GetBs
()->GetInitialRangingInterval () | 618 if (timeSinceLastIrInterval + GetBs ()->GetPhy ()->GetFrameDuration () > GetBs
()->GetInitialRangingInterval () |
617 && availableSymbols >= allocationSize) | 619 && availableSymbols >= allocationSize) |
618 { | 620 { |
619 SetIsIrIntrvlAllocated (true); | 621 SetIsIrIntrvlAllocated (true); |
620 OfdmUlMapIe ulMapIeIr; | 622 OfdmUlMapIe ulMapIeIr; |
621 ulMapIeIr.SetCid (GetBs ()->GetBroadcastConnection ()->GetCid ()); | 623 ulMapIeIr.SetCid (GetBs ()->GetBroadcastConnection ()->GetCid ()); |
622 ulMapIeIr.SetStartTime (symbolsToAllocation); | 624 ulMapIeIr.SetStartTime (static_cast<uint16_t> (symbolsToAllocation)); |
623 ulMapIeIr.SetUiuc (OfdmUlBurstProfile::UIUC_INITIAL_RANGING); | 625 ulMapIeIr.SetUiuc (OfdmUlBurstProfile::UIUC_INITIAL_RANGING); |
624 | 626 |
625 NS_LOG_DEBUG ("BS uplink scheduler, initial ranging allocation, size: " <<
allocationSize << " symbols" | 627 NS_LOG_DEBUG ("BS uplink scheduler, initial ranging allocation, size: " <<
allocationSize << " symbols" |
626 <<
", modulation: BPSK 1/2"); | 628 <<
", modulation: BPSK 1/2"); |
627 | 629 |
628 // marking start and end of each TO, only for debugging | 630 // marking start and end of each TO, only for debugging |
629 for (uint8_t i = 0; i < GetNrIrOppsAllocated (); i++) | 631 for (uint8_t i = 0; i < GetNrIrOppsAllocated (); i++) |
630 { | 632 { |
631 GetBs ()->MarkRangingOppStart (ssUlStartTime + Seconds (symbolsToAlloc
ation | 633 GetBs ()->MarkRangingOppStart (ssUlStartTime + Seconds (symbolsToAlloc
ation |
632 * GetBs ()->Ge
tSymbolDuration ().GetSeconds ()) + Seconds (i * GetBs ()->GetRangReqOppSize () | 634 * GetBs ()->Ge
tSymbolDuration ().GetSeconds ()) + Seconds (i * GetBs ()->GetRangReqOppSize () |
633
* GetBs ()->GetSymbolDuration ().Ge
tSeconds ())); | 635
* GetBs ()->GetSymbolDuration ().Ge
tSeconds ())); |
634 } | 636 } |
635 | 637 |
636 AddUplinkAllocation (ulMapIeIr, allocationSize, symbolsToAllocation, avail
ableSymbols); | 638 AddUplinkAllocation (ulMapIeIr, allocationSize, symbolsToAllocation, avail
ableSymbols); |
637 SetTimeStampIrInterval (Simulator::Now ()); | 639 SetTimeStampIrInterval (Simulator::Now ()); |
638 } | 640 } |
639 } | 641 } |
640 | 642 |
641 void | 643 void |
642 UplinkSchedulerRtps::SetupServiceFlow (SSRecord *ssRecord, ServiceFlow *serviceF
low) | 644 UplinkSchedulerRtps::SetupServiceFlow (SSRecord *ssRecord, ServiceFlow *serviceF
low) |
643 { | 645 { |
644 uint8_t delayNrFrames = 1; | 646 uint8_t delayNrFrames = 1; |
645 uint32_t bitsPerSecond = serviceFlow->GetMinReservedTrafficRate (); | 647 uint32_t bitsPerSecond = serviceFlow->GetMinReservedTrafficRate (); |
646 WimaxPhy::ModulationType modulation; | 648 WimaxPhy::ModulationType modulation; |
647 uint32_t bytesPerFrame = | 649 uint32_t bytesPerFrame = |
648 (uint32_t ((double)(bitsPerSecond) * GetBs ()->GetPhy ()->GetFrameDuration (
).GetSeconds ())) / 8; | 650 (uint32_t ((double)(bitsPerSecond) * GetBs ()->GetPhy ()->GetFrameDuration (
).GetSeconds ())) / 8; |
649 uint32_t frameDurationMSec = GetBs ()->GetPhy ()->GetFrameDuration ().GetMilli
Seconds (); | 651 uint32_t frameDurationMSec = static_cast<uint32_t> (GetBs ()->GetPhy ()->GetFr
ameDuration ().GetMilliSeconds ()); |
650 | 652 |
651 switch (serviceFlow->GetSchedulingType ()) | 653 switch (serviceFlow->GetSchedulingType ()) |
652 { | 654 { |
653 case ServiceFlow::SF_TYPE_UGS: | 655 case ServiceFlow::SF_TYPE_UGS: |
654 { | 656 { |
655 if (serviceFlow->GetIsMulticast () == true) | 657 if (serviceFlow->GetIsMulticast () == true) |
656 { | 658 { |
657 modulation = serviceFlow->GetModulation (); | 659 modulation = serviceFlow->GetModulation (); |
658 } | 660 } |
659 else | 661 else |
660 { | 662 { |
661 modulation = ssRecord->GetModulationType (); | 663 modulation = ssRecord->GetModulationType (); |
662 } | 664 } |
663 uint32_t grantSize = GetBs ()->GetPhy ()->GetNrSymbols (bytesPerFrame, m
odulation); | 665 uint32_t grantSize = static_cast<uint32_t> (GetBs ()->GetPhy ()->GetNrSy
mbols (bytesPerFrame, modulation)); |
664 serviceFlow->GetRecord ()->SetGrantSize (grantSize); | 666 serviceFlow->GetRecord ()->SetGrantSize (grantSize); |
665 | 667 |
666 uint32_t toleratedJitter = serviceFlow->GetToleratedJitter (); | 668 uint32_t toleratedJitter = serviceFlow->GetToleratedJitter (); |
667 | 669 |
668 if (toleratedJitter > frameDurationMSec) | 670 if (toleratedJitter > frameDurationMSec) |
669 { | 671 { |
670 delayNrFrames = (uint8_t)(toleratedJitter / frameDurationMSec); | 672 delayNrFrames = (uint8_t)(toleratedJitter / frameDurationMSec); |
671 } | 673 } |
672 | 674 |
673 uint16_t interval = delayNrFrames * frameDurationMSec; | 675 uint16_t interval = static_cast<uint16_t> (delayNrFrames * frameDuration
MSec); |
674 serviceFlow->SetUnsolicitedGrantInterval (interval); | 676 serviceFlow->SetUnsolicitedGrantInterval (interval); |
675 } | 677 } |
676 break; | 678 break; |
677 case ServiceFlow::SF_TYPE_RTPS: | 679 case ServiceFlow::SF_TYPE_RTPS: |
678 { | 680 { |
679 if (serviceFlow->GetSduSize () > bytesPerFrame) | 681 if (serviceFlow->GetSduSize () > bytesPerFrame) |
680 { | 682 { |
681 delayNrFrames = (uint8_t)(serviceFlow->GetSduSize () / bytesPerFrame
); | 683 delayNrFrames = (uint8_t)(serviceFlow->GetSduSize () / bytesPerFrame
); |
682 } | 684 } |
683 | 685 |
684 uint16_t interval = delayNrFrames * frameDurationMSec; | 686 uint16_t interval = static_cast<uint16_t> (delayNrFrames * frameDuration
MSec); |
685 serviceFlow->SetUnsolicitedPollingInterval (interval); | 687 serviceFlow->SetUnsolicitedPollingInterval (interval); |
686 } | 688 } |
687 break; | 689 break; |
688 case ServiceFlow::SF_TYPE_NRTPS: | 690 case ServiceFlow::SF_TYPE_NRTPS: |
689 { | 691 { |
690 // no real-time guarantees are given to NRTPS, serviced based on availab
le bandwidth | 692 // no real-time guarantees are given to NRTPS, serviced based on availab
le bandwidth |
691 } | 693 } |
692 break; | 694 break; |
693 case ServiceFlow::SF_TYPE_BE: | 695 case ServiceFlow::SF_TYPE_BE: |
694 { | 696 { |
695 // no real-time guarantees are given to BE, serviced based on available
bandwidth | 697 // no real-time guarantees are given to BE, serviced based on available
bandwidth |
696 } | 698 } |
697 break; | 699 break; |
698 default: | 700 default: |
699 NS_FATAL_ERROR ("Invalid scheduling type"); | 701 NS_FATAL_ERROR ("Invalid scheduling type"); |
700 } | 702 } |
701 } | 703 } |
702 | 704 |
703 void | 705 void |
704 UplinkSchedulerRtps::InitOnce () | 706 UplinkSchedulerRtps::InitOnce () |
705 { | 707 { |
706 } | 708 } |
707 | 709 |
708 void | 710 void |
709 UplinkSchedulerRtps::ProcessBandwidthRequest (const BandwidthRequestHeader &bwRe
questHdr) | 711 UplinkSchedulerRtps::ProcessBandwidthRequest (const BandwidthRequestHeader &bwRe
questHdr) |
710 { | 712 { |
| 713 NS_UNUSED (bwRequestHdr); |
711 } | 714 } |
712 | 715 |
713 void | 716 void |
714 UplinkSchedulerRtps::OnSetRequestedBandwidth (ServiceFlowRecord *sfr) | 717 UplinkSchedulerRtps::OnSetRequestedBandwidth (ServiceFlowRecord *sfr) |
715 { | 718 { |
716 // m_grantedBandwidth must be reset to zero | 719 // m_grantedBandwidth must be reset to zero |
717 uint32_t grantedBandwidth = 0; | 720 uint32_t grantedBandwidth = 0; |
718 sfr->SetGrantedBandwidth (grantedBandwidth); | 721 sfr->SetGrantedBandwidth (grantedBandwidth); |
719 } | 722 } |
720 | 723 |
721 } // namespace ns3 | 724 } // namespace ns3 |
OLD | NEW |