22 #include "ns3/codel-queue-disc.h"
23 #include "ns3/double.h"
25 #include "ns3/packet.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
29 #include "ns3/uinteger.h"
34 #define REC_INV_SQRT_BITS_ns3 (8 * sizeof(uint16_t))
37 #define REC_INV_SQRT_SHIFT_ns3 (32 - REC_INV_SQRT_BITS_ns3)
43 uint32_t invsqrt2 = ((uint64_t)invsqrt * invsqrt) >> 32;
44 uint64_t val = (3LL << 32) - ((uint64_t)count * invsqrt2);
47 val = (val * invsqrt) >> (32 - 2 + 1);
54 return (uint32_t)(((uint64_t)val * ep_ro) >> 32);
82 void AddHeader()
override;
91 m_ecnCapablePacket(ecnCapable)
124 void DoRun()
override;
131 :
TestCase(
"Basic enqueue and dequeue operations, and attribute setting")
142 uint32_t modeSize = 0;
148 "Verify that we can actually set the attribute MinBytes");
151 "Verify that we can actually set the attribute Interval");
154 "Verify that we can actually set the attribute Target");
165 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 1500))),
167 "Verify that we can actually set the attribute MaxSize");
185 "There should be no packets in queue");
186 queue->Enqueue(Create<CodelQueueDiscTestItem>(p1, dest,
false));
189 "There should be one packet in queue");
190 queue->Enqueue(Create<CodelQueueDiscTestItem>(p2, dest,
false));
193 "There should be two packets in queue");
194 queue->Enqueue(Create<CodelQueueDiscTestItem>(p3, dest,
false));
197 "There should be three packets in queue");
198 queue->Enqueue(Create<CodelQueueDiscTestItem>(p4, dest,
false));
201 "There should be four packets in queue");
202 queue->Enqueue(Create<CodelQueueDiscTestItem>(p5, dest,
false));
205 "There should be five packets in queue");
206 queue->Enqueue(Create<CodelQueueDiscTestItem>(p6, dest,
false));
209 "There should be six packets in queue");
213 "There should be no packets being dropped due to full queue");
217 item = queue->Dequeue();
221 "There should be five packets in queue");
224 item = queue->Dequeue();
228 "There should be four packets in queue");
231 "Was this the second packet ?");
233 item = queue->Dequeue();
237 "There should be three packets in queue");
240 item = queue->Dequeue();
244 "There should be two packets in queue");
247 "Was this the fourth packet ?");
249 item = queue->Dequeue();
253 "There should be one packet in queue");
256 item = queue->Dequeue();
260 "There should be zero packet in queue");
263 item = queue->Dequeue();
267 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP),
269 "There should be no packet drops according to CoDel algorithm");
286 void DoRun()
override;
300 :
TestCase(
"Basic overflow behavior")
310 uint32_t modeSize = 0;
331 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
333 "Verify that we can actually set the attribute MaxSize");
336 "Verify that we can actually set the attribute MinBytes");
341 queue->Enqueue(Create<CodelQueueDiscTestItem>(p1, dest,
false));
342 queue->Enqueue(Create<CodelQueueDiscTestItem>(p2, dest,
false));
343 queue->Enqueue(Create<CodelQueueDiscTestItem>(p3, dest,
false));
347 "There should be 500 packets in queue");
350 "There should be three packets being dropped due to full queue");
357 for (uint32_t i = 0; i < nPkt; i++)
359 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest,
false));
372 void DoRun()
override;
376 :
TestCase(
"NewtonStep arithmetic unit test")
388 for (uint16_t recInvSqrt = 0xff; recInvSqrt > 0; recInvSqrt /= 2)
390 for (uint32_t count = 1; count < 0xff; count *= 2)
392 result = queue->NewtonStep(recInvSqrt, count);
396 "ns-3 NewtonStep() fails to match Linux equivalent");
410 void DoRun()
override;
422 :
TestCase(
"ControlLaw arithmetic unit test")
442 uint32_t interval = queue->Time2CoDel(
MilliSeconds(100));
444 uint32_t codelTimeVal;
447 for (uint16_t recInvSqrt = 0xff; recInvSqrt > 0; recInvSqrt /= 2)
449 codelTimeVal = queue->Time2CoDel(timeVal);
450 uint32_t ns3Result = queue->ControlLaw(codelTimeVal, interval, recInvSqrt);
454 "Linux result for ControlLaw should equal ns-3 result");
473 void DoRun()
override;
516 uint32_t modeSize = 0;
528 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
530 "Verify that we can actually set the attribute MaxSize");
537 "There should be 20 packets in queue.");
541 Time waitUntilFirstDequeue = 2 * queue->GetTarget();
542 Simulator::Schedule(waitUntilFirstDequeue,
549 Time waitUntilSecondDequeue = waitUntilFirstDequeue + 2 * queue->GetInterval();
550 Simulator::Schedule(waitUntilSecondDequeue,
558 Simulator::Schedule(waitUntilSecondDequeue,
566 Simulator::Schedule(waitUntilSecondDequeue * 2,
573 Simulator::Destroy();
580 for (uint32_t i = 0; i < nPkt; i++)
582 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest,
false));
589 uint32_t initialDropCount =
590 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
591 uint32_t initialQSize = queue->GetCurrentSize().GetValue();
592 uint32_t initialDropNext = queue->GetDropNext();
594 uint32_t currentDropCount = 0;
596 if (initialDropCount > 0 && currentTime.
GetMicroSeconds() >= initialDropNext)
598 queue->TraceConnectWithoutContext(
603 if (initialQSize != 0)
606 if (initialDropCount == 0 && currentTime > queue->GetTarget())
608 if (currentTime < queue->GetInterval())
611 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
614 "We are not in dropping state."
615 "Sojourn time has just gone above target from below."
616 "Hence, there should be no packet drops");
618 initialQSize - modeSize,
619 "There should be 1 packet dequeued.");
621 else if (currentTime >= queue->GetInterval())
624 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
626 initialQSize - 2 * modeSize,
627 "Sojourn time has been above target for at least interval."
628 "We enter the dropping state, perform initial packet drop, "
629 "and dequeue the next."
630 "So there should be 2 more packets dequeued.");
634 else if (initialDropCount > 0)
639 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
641 initialQSize - modeSize,
642 "We are in dropping state."
643 "Sojourn is still above target."
644 "However, it's not time for next drop."
645 "So there should be only 1 more packet dequeued");
650 "There should still be only 1 packet drop from the last dequeue");
655 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
658 "We are in dropping state."
659 "It's time for next drop."
660 "The number of packets dequeued equals to the number of "
661 "times m_dropNext is updated plus initial dequeue");
664 "The number of drops equals to the number of times "
665 "m_dropNext is updated plus 1 from last dequeue");
685 void DoRun()
override;
739 uint32_t modeSize = 0;
753 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
755 "Verify that we can actually set the attribute MaxSize");
758 "Verify that we can actually set the attribute UseEcn");
766 "There should be 20 packets in queue.");
770 Time waitUntilFirstDequeue = 2 * queue->GetTarget();
771 Simulator::Schedule(waitUntilFirstDequeue,
779 Time waitUntilSecondDequeue = waitUntilFirstDequeue + 2 * queue->GetInterval();
780 Simulator::Schedule(waitUntilSecondDequeue,
788 Simulator::Destroy();
791 queue = CreateObject<CoDelQueueDisc>();
793 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
795 "Verify that we can actually set the attribute MaxSize");
798 "Verify that we can actually set the attribute UseEcn");
806 "There should be 20 packets in queue.");
810 Simulator::Schedule(waitUntilFirstDequeue,
818 Simulator::Schedule(waitUntilSecondDequeue,
827 Simulator::Schedule(waitUntilSecondDequeue,
836 Simulator::Schedule(waitUntilSecondDequeue * 2,
844 Simulator::Destroy();
847 queue = CreateObject<CoDelQueueDisc>();
849 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
851 "Verify that we can actually set the attribute MaxSize");
854 "Verify that we can actually set the attribute UseEcn");
857 "Verify that we can actually set the attribute CeThreshold");
867 "There should be 20 packets in queue.");
871 Simulator::Schedule(waitUntilFirstDequeue,
879 Simulator::Schedule(waitUntilSecondDequeue,
888 Simulator::Schedule(waitUntilSecondDequeue,
897 Simulator::Schedule(waitUntilSecondDequeue * 2,
905 Simulator::Destroy();
909 queue = CreateObject<CoDelQueueDisc>();
911 queue->SetAttributeFailSafe(
"MaxSize", QueueSizeValue(
QueueSize(
m_mode, modeSize * 500))),
913 "Verify that we can actually set the attribute MaxSize");
916 "Verify that we can actually set the attribute UseEcn");
919 "Verify that we can actually set the attribute CeThreshold");
927 "There should be 20 packets in queue.");
948 Simulator::Schedule(waitUntilFirstDequeue,
957 Simulator::Schedule(waitUntilSecondDequeue,
965 Simulator::Destroy();
975 for (uint32_t i = 0; i < nPkt; i++)
977 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest, ecnCapable));
984 uint32_t initialTargetMarkCount =
985 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
986 uint32_t initialCeThreshMarkCount =
987 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
988 uint32_t initialQSize = queue->GetCurrentSize().GetValue();
989 uint32_t initialDropNext = queue->GetDropNext();
991 uint32_t currentDropCount = 0;
992 uint32_t currentTargetMarkCount = 0;
993 uint32_t currentCeThreshMarkCount = 0;
995 if (initialTargetMarkCount > 0 && currentTime.
GetMicroSeconds() >= initialDropNext &&
998 queue->TraceConnectWithoutContext(
1003 if (initialQSize != 0)
1009 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1010 if (currentDropCount == 1)
1015 else if (testCase == 2)
1017 if (initialTargetMarkCount == 0 && currentTime > queue->GetTarget())
1019 if (currentTime < queue->GetInterval())
1022 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1023 currentTargetMarkCount =
1024 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1025 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1026 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1028 initialQSize - modeSize,
1029 "There should be 1 packet dequeued.");
1032 "There should not be any packet drops");
1034 currentTargetMarkCount,
1036 "We are not in dropping state."
1037 "Sojourn time has just gone above target from below."
1038 "Hence, there should be no target exceeded marked packets");
1040 currentCeThreshMarkCount,
1042 "Marking due to CE threshold is disabled"
1043 "Hence, there should not be any CE threshold exceeded marked packet");
1045 else if (currentTime >= queue->GetInterval())
1048 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1049 currentTargetMarkCount =
1050 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1052 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1053 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1055 queue->GetCurrentSize().GetValue(),
1056 initialQSize - modeSize,
1057 "Sojourn time has been above target for at least interval."
1058 "We enter the dropping state and perform initial packet marking"
1059 "So there should be only 1 more packet dequeued.");
1062 "There should not be any packet drops");
1065 "There should be 1 target exceeded marked packet");
1067 currentCeThreshMarkCount,
1069 "There should not be any CE threshold exceeded marked packet");
1072 else if (initialTargetMarkCount > 0)
1077 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1078 currentTargetMarkCount =
1079 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1080 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1081 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1083 initialQSize - modeSize,
1084 "We are in dropping state."
1085 "Sojourn is still above target."
1086 "However, it's not time for next target exceeded mark."
1087 "So there should be only 1 more packet dequeued");
1090 "There should not be any packet drops");
1093 "There should still be only 1 target exceeded marked "
1094 "packet from the last dequeue");
1096 currentCeThreshMarkCount,
1098 "There should not be any CE threshold exceeded marked packet");
1103 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1104 currentTargetMarkCount =
1105 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1106 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1107 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1109 initialQSize - modeSize,
1110 "We are in dropping state."
1111 "It's time for packet to be marked"
1112 "So there should be only 1 more packet dequeued");
1115 "There should not be any packet drops");
1118 "There should 2 target exceeded marked packet");
1122 "Number of packets in the queue before drop should be equal"
1123 "to number of packets in the queue before first mark as the behavior "
1124 "until packet N should be the same.");
1126 currentCeThreshMarkCount,
1128 "There should not be any CE threshold exceeded marked packet");
1132 else if (testCase == 3)
1134 if (initialTargetMarkCount == 0 && currentTime > queue->GetTarget())
1136 if (currentTime < queue->GetInterval())
1139 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1140 currentTargetMarkCount =
1141 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1142 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1143 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1145 initialQSize - modeSize,
1146 "There should be 1 packet dequeued.");
1149 "There should not be any packet drops");
1151 currentTargetMarkCount,
1153 "We are not in dropping state."
1154 "Sojourn time has just gone above target from below."
1155 "Hence, there should be no target exceeded marked packets");
1157 currentCeThreshMarkCount,
1159 "Sojourn time has gone above CE threshold."
1160 "Hence, there should be 1 CE threshold exceeded marked packet");
1162 else if (currentTime >= queue->GetInterval())
1165 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1166 currentTargetMarkCount =
1167 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1168 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1169 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1171 queue->GetCurrentSize().GetValue(),
1172 initialQSize - modeSize,
1173 "Sojourn time has been above target for at least interval."
1174 "We enter the dropping state and perform initial packet marking"
1175 "So there should be only 1 more packet dequeued.");
1178 "There should not be any packet drops");
1181 "There should be 1 target exceeded marked packet");
1184 "There should be 1 CE threshold exceeded marked packets");
1187 else if (initialTargetMarkCount > 0)
1192 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1193 currentTargetMarkCount =
1194 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1195 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1196 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1198 initialQSize - modeSize,
1199 "We are in dropping state."
1200 "Sojourn is still above target."
1201 "However, it's not time for next target exceeded mark."
1202 "So there should be only 1 more packet dequeued");
1205 "There should not be any packet drops");
1208 "There should still be only 1 target exceeded marked "
1209 "packet from the last dequeue");
1212 "There should be 2 CE threshold exceeded marked packets");
1217 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1218 currentTargetMarkCount =
1219 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1220 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1221 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1223 queue->GetCurrentSize().GetValue(),
1225 "We are in dropping state."
1226 "It's time for packet to be dropped as packets are not ecnCapable"
1227 "The number of packets dequeued equals to the number of times m_dropNext "
1228 "is updated plus initial dequeue");
1232 "The number of drops equals to the number of times m_dropNext is updated");
1234 currentTargetMarkCount,
1236 "There should still be only 1 target exceeded marked packet");
1239 "There should still be 2 CE threshold exceeded marked "
1240 "packet as packets are not ecnCapable");
1244 else if (testCase == 4)
1246 if (currentTime < queue->GetTarget())
1248 if (initialCeThreshMarkCount == 0 && currentTime <
MilliSeconds(2))
1251 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1252 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1253 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1255 initialQSize - modeSize,
1256 "There should be 1 packet dequeued.");
1259 "There should not be any packet drops");
1261 currentCeThreshMarkCount,
1263 "Sojourn time has not gone above CE threshold."
1264 "Hence, there should not be any CE threshold exceeded marked packet");
1269 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1270 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1271 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1273 initialQSize - modeSize,
1274 "There should be only 1 more packet dequeued.");
1277 "There should not be any packet drops");
1280 "Sojourn time has gone above CE threshold."
1281 "There should be 1 CE threshold exceeded marked packet");
1284 else if (initialCeThreshMarkCount > 0 && currentTime < queue->GetInterval())
1286 if (initialCeThreshMarkCount < 2)
1289 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1290 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1291 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1293 initialQSize - modeSize,
1294 "There should be only 1 more packet dequeued.");
1297 "There should not be any packet drops");
1300 "There should be 2 CE threshold exceeded marked packets");
1305 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1306 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1307 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1309 initialQSize - modeSize,
1310 "There should be only 1 more packet dequeued.");
1313 "There should not be any packet drops");
1316 "There should be 3 CE threshold exceeded marked packet");
Test 5: enqueue/dequeue with drops according to CoDel algorithm.
uint32_t m_dropNextCount
count the number of times m_dropNext is recalculated
CoDelQueueDiscBasicDrop(QueueSizeUnit mode)
Constructor.
void Dequeue(Ptr< CoDelQueueDisc > queue, uint32_t modeSize)
Dequeue function.
void Enqueue(Ptr< CoDelQueueDisc > queue, uint32_t size, uint32_t nPkt)
Enqueue function.
void DoRun() override
Implementation to actually run this TestCase.
void DropNextTracer(uint32_t oldVal, uint32_t newVal)
Drop next tracer function.
Test 1: simple enqueue/dequeue with no drops.
CoDelQueueDiscBasicEnqueueDequeue(QueueSizeUnit mode)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Test 6: enqueue/dequeue with marks according to CoDel algorithm.
uint32_t nPacketsBeforeFirstMark
Number of packets in the queue before first mark.
void Enqueue(Ptr< CoDelQueueDisc > queue, uint32_t size, uint32_t nPkt, bool ecnCapable)
Enqueue function.
uint32_t m_dropNextCount
count the number of times m_dropNext is recalculated
void DropNextTracer(uint32_t oldVal, uint32_t newVal)
Drop next tracer function.
uint32_t nPacketsBeforeFirstDrop
Number of packets in the queue before first drop.
void Dequeue(Ptr< CoDelQueueDisc > queue, uint32_t modeSize, uint32_t testCase)
Dequeue function.
void DoRun() override
Implementation to actually run this TestCase.
CoDelQueueDiscBasicMark(QueueSizeUnit mode)
Constructor.
Test 2: enqueue with drops due to queue overflow.
CoDelQueueDiscBasicOverflow(QueueSizeUnit mode)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
void Enqueue(Ptr< CoDelQueueDisc > queue, uint32_t size, uint32_t nPkt)
Enqueue function.
Test 4: ControlLaw unit test - test against explicit port of Linux implementation.
void DoRun() override
Implementation to actually run this TestCase.
CoDelQueueDiscControlLawTest()
uint32_t _codel_control_law(uint32_t t, uint32_t interval, uint32_t recInvSqrt)
Codel control law function.
Test 3: NewtonStep unit test - test against explicit port of Linux implementation.
void DoRun() override
Implementation to actually run this TestCase.
CoDelQueueDiscNewtonStepTest()
CoDel Queue Disc Test Suite.
CoDelQueueDiscTestSuite()
Codel Queue Disc Test Item.
void AddHeader() override
Add the header to the packet.
~CodelQueueDiscTestItem() override
bool Mark() override
Marks the packet as a substitute for dropping it, such as for Explicit Congestion Notification.
CodelQueueDiscTestItem & operator=(const CodelQueueDiscTestItem &)=delete
bool m_ecnCapablePacket
ECN capable packet?
CodelQueueDiscTestItem(const CodelQueueDiscTestItem &)=delete
CodelQueueDiscTestItem()=delete
a polymophic address class
uint64_t GetUid() const
Returns the packet's Uid.
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
Class for representing queue sizes.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
Simulation virtual time values and global simulation resolution.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Hold an unsigned integer type.
#define REC_INV_SQRT_SHIFT_ns3
static uint16_t _codel_Newton_step(uint16_t rec_inv_sqrt, uint32_t count)
static uint32_t _reciprocal_scale(uint32_t val, uint32_t ep_ro)
QueueSizeUnit
Enumeration of the operating modes of queues.
@ BYTES
Use number of bytes for queue size.
@ PACKETS
Use number of packets for queue size.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
CoDelQueueDiscTestSuite g_coDelQueueTestSuite
the test suite
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
uint32_t pktSize
packet size used for the simulation (in bytes)