fix Bug 836: Delay is incremented over time with BsUplinkSchedulerSimple and BsUplinkSchedulerRtps

This commit is contained in:
Mohamed Amine Ismail
2010-03-11 14:18:52 +01:00
parent cffafa7705
commit 8dd11bbcc7
3 changed files with 20 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -251,6 +251,7 @@ ServiceFlow::GetRecord (void) const
Ptr<WimaxMacQueue>
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> 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;
}
}
}
}