--- a/src/internet/model/codel-queue.cc Thu Aug 21 14:43:03 2014 -0500
+++ b/src/internet/model/codel-queue.cc Thu Aug 21 15:11:05 2014 -0500
@@ -340,19 +340,19 @@
m_bytesInQueue -= p->GetSize ();
NS_LOG_LOGIC ("Popped " << p);
- NS_LOG_LOGIC ("Number packets " << m_packets.size ());
- NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
+ NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ());
+ NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue);
// Determine if p should be dropped
- bool drop = OkToDrop (p, now);
+ bool okToDrop = OkToDrop (p, now);
if (m_dropping)
{ // In the dropping state (sojourn time has gone above target and hasn't come down yet)
// Check if we can leave the dropping state or next drop should occur
NS_LOG_LOGIC ("In dropping state, check if it's OK to leave or next drop should occur");
- if (!drop)
+ if (!okToDrop)
{
- /* sojourn time below target - leave dropping state */
+ /* sojourn time fell below target - leave dropping state */
NS_LOG_LOGIC ("Sojourn time goes below target, it's OK to leave dropping state.");
m_dropping = false;
}
@@ -360,19 +360,15 @@
if (CoDelTimeAfterEq (now, m_dropNext))
{
m_state2++;
- /* It's time for the next drop. Drop the current
- * packet and dequeue the next. The dequeue might
- * take us out of dropping state.
- * If not, schedule the next drop.
- * A large amount of packets in queue might result
- * in drop rates so high
- * that the next drop should happen now,
- * hence the while loop.
- */
- NS_LOG_LOGIC ("Sojourn time is still above target and it's time for next drop.");
- while (m_dropping
- && CoDelTimeAfterEq (now, m_dropNext))
+ while (m_dropping && CoDelTimeAfterEq (now, m_dropNext))
{
+ // It's time for the next drop. Drop the current packet and
+ // dequeue the next. The dequeue might take us out of dropping
+ // state. If not, schedule the next drop.
+ // A large amount of packets in queue might result in drop
+ // rates so high that the next drop should happen now,
+ // hence the while loop.
+ NS_LOG_LOGIC ("Sojourn time is still above target and it's time for next drop; dropping " << p);
Drop (p);
++m_dropCount;
++m_count;
@@ -389,18 +385,21 @@
m_bytesInQueue -= p->GetSize ();
NS_LOG_LOGIC ("Popped " << p);
- NS_LOG_LOGIC ("Number packets " << m_packets.size ());
- NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
+ NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ());
+ NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue);
if (!OkToDrop (p, now))
{
/* leave dropping state */
+ NS_LOG_LOGIC ("Leaving dropping state");
m_dropping = false;
}
else
{
- /* and schedule the next drop */
+ /* schedule the next drop */
+ NS_LOG_LOGIC ("Running ControlLaw for input m_dropNext: " << (double)m_dropNext/1000000);
m_dropNext = ControlLaw (m_dropNext);
+ NS_LOG_LOGIC ("Scheduled next drop at " << (double)m_dropNext/1000000);
}
}
}
@@ -410,16 +409,16 @@
// Not in the dropping state
// Decide if we have to enter the dropping state and drop the first packet
NS_LOG_LOGIC ("Not in dropping state; decide if we have to enter the state and drop the first packet");
- if (drop)
+ if (okToDrop)
{
// Drop the first packet and enter dropping state unless the queue is empty
- NS_LOG_LOGIC ("Sojourn time goes above target, drop the first packet and enter the dropping state");
+ NS_LOG_LOGIC ("Sojourn time goes above target, dropping the first packet " << p << " and entering the dropping state");
++m_dropCount;
Drop (p);
if (m_packets.empty ())
{
m_dropping = false;
- drop = false;
+ okToDrop = false;
NS_LOG_LOGIC ("Queue empty");
++m_states;
}
@@ -430,10 +429,10 @@
m_bytesInQueue -= p->GetSize ();
NS_LOG_LOGIC ("Popped " << p);
- NS_LOG_LOGIC ("Number packets " << m_packets.size ());
- NS_LOG_LOGIC ("Number bytes " << m_bytesInQueue);
+ NS_LOG_LOGIC ("Number packets remaining " << m_packets.size ());
+ NS_LOG_LOGIC ("Number bytes remaining " << m_bytesInQueue);
- drop = OkToDrop (p, now);
+ okToDrop = OkToDrop (p, now);
m_dropping = true;
}
++m_state3;
@@ -454,7 +453,9 @@
m_recInvSqrt = ~0U >> REC_INV_SQRT_SHIFT;
}
m_lastCount = m_count;
+ NS_LOG_LOGIC ("Running ControlLaw for input now: " << (double)now);
m_dropNext = ControlLaw (now);
+ NS_LOG_LOGIC ("Scheduled next drop at " << (double)m_dropNext/1000000 << " now " << (double)now/1000000);
}
}
++m_states;