diff --git a/src/devices/wimax/bandwidth-manager.cc b/src/devices/wimax/bandwidth-manager.cc index eb2916ec3..bc0113358 100644 --- a/src/devices/wimax/bandwidth-manager.cc +++ b/src/devices/wimax/bandwidth-manager.cc @@ -182,6 +182,7 @@ BandwidthManager::ProcessBandwidthRequest (const BandwidthRequestHeader &bwReque else { serviceFlow->GetRecord ()->SetRequestedBandwidth (bwRequestHdr.GetBr ()); + bs->GetUplinkScheduler()->OnSetRequestedBandwidth(serviceFlow->GetRecord()); } bs->GetUplinkScheduler ()->ProcessBandwidthRequest (bwRequestHdr); // update backlogged diff --git a/src/devices/wimax/bs-uplink-scheduler-simple.cc b/src/devices/wimax/bs-uplink-scheduler-simple.cc index 25c341e44..4dca3721c 100644 --- a/src/devices/wimax/bs-uplink-scheduler-simple.cc +++ b/src/devices/wimax/bs-uplink-scheduler-simple.cc @@ -576,8 +576,9 @@ UplinkSchedulerSimple::ProcessBandwidthRequest (const BandwidthRequestHeader &bw void UplinkSchedulerSimple::OnSetRequestedBandwidth (ServiceFlowRecord *sfr) { - // virtual function on UplinkScheduler - // this is not necessary on this implementation + // m_grantedBandwidth must be reset to zero + uint32_t grantedBandwidth = 0; + sfr->SetGrantedBandwidth (grantedBandwidth); } } // namespace ns3 diff --git a/src/devices/wimax/service-flow.cc b/src/devices/wimax/service-flow.cc index e787be321..f8cfea789 100644 --- a/src/devices/wimax/service-flow.cc +++ b/src/devices/wimax/service-flow.cc @@ -251,6 +251,7 @@ ServiceFlow::GetRecord (void) const Ptr ServiceFlow::GetQueue (void) const { + if (!m_connection) return 0; return m_connection->GetQueue (); } @@ -263,12 +264,14 @@ ServiceFlow::GetSchedulingType (void) const bool ServiceFlow::HasPackets (void) const { + if (!m_connection) return false; return m_connection->HasPackets (); } bool ServiceFlow::HasPackets (MacHeaderType::HeaderType packetType) const { + if (!m_connection) return false; return m_connection->HasPackets (packetType); } @@ -279,19 +282,20 @@ ServiceFlow::CleanUpQueue (void) Time timeStamp; Ptr packet; Time currentTime = Simulator::Now (); + if (m_connection){ + while (m_connection->HasPackets ()) + { + packet = m_connection->GetQueue ()->Peek (hdr, timeStamp); - while (m_connection->HasPackets ()) - { - packet = m_connection->GetQueue ()->Peek (hdr, timeStamp); - - if (currentTime - timeStamp > MilliSeconds (GetMaximumLatency ())) - { - m_connection->Dequeue (); - } - else - { - break; - } + if (currentTime - timeStamp > MilliSeconds (GetMaximumLatency ())) + { + m_connection->Dequeue (); + } + else + { + break; + } + } } }