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)
128 void DoRun()
override;
135 :
TestCase(
"Basic enqueue and dequeue operations, and attribute setting")
146 uint32_t modeSize = 0;
152 "Verify that we can actually set the attribute MinBytes");
155 "Verify that we can actually set the attribute Interval");
158 "Verify that we can actually set the attribute Target");
171 "Verify that we can actually set the attribute MaxSize");
189 "There should be no packets in queue");
190 queue->Enqueue(Create<CodelQueueDiscTestItem>(p1, dest,
false));
193 "There should be one packet in queue");
194 queue->Enqueue(Create<CodelQueueDiscTestItem>(p2, dest,
false));
197 "There should be two packets in queue");
198 queue->Enqueue(Create<CodelQueueDiscTestItem>(p3, dest,
false));
201 "There should be three packets in queue");
202 queue->Enqueue(Create<CodelQueueDiscTestItem>(p4, dest,
false));
205 "There should be four packets in queue");
206 queue->Enqueue(Create<CodelQueueDiscTestItem>(p5, dest,
false));
209 "There should be five packets in queue");
210 queue->Enqueue(Create<CodelQueueDiscTestItem>(p6, dest,
false));
213 "There should be six packets in queue");
217 "There should be no packets being dropped due to full queue");
221 item = queue->Dequeue();
225 "There should be five packets in queue");
228 item = queue->Dequeue();
232 "There should be four packets in queue");
235 "Was this the second packet ?");
237 item = queue->Dequeue();
241 "There should be three packets in queue");
244 item = queue->Dequeue();
248 "There should be two packets in queue");
251 "Was this the fourth packet ?");
253 item = queue->Dequeue();
257 "There should be one packet in queue");
260 item = queue->Dequeue();
264 "There should be zero packet in queue");
267 item = queue->Dequeue();
271 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP),
273 "There should be no packet drops according to CoDel algorithm");
290 void DoRun()
override;
304 :
TestCase(
"Basic overflow behavior")
314 uint32_t modeSize = 0;
337 "Verify that we can actually set the attribute MaxSize");
340 "Verify that we can actually set the attribute MinBytes");
345 queue->Enqueue(Create<CodelQueueDiscTestItem>(p1, dest,
false));
346 queue->Enqueue(Create<CodelQueueDiscTestItem>(p2, dest,
false));
347 queue->Enqueue(Create<CodelQueueDiscTestItem>(p3, dest,
false));
351 "There should be 500 packets in queue");
354 "There should be three packets being dropped due to full queue");
361 for (uint32_t i = 0; i < nPkt; i++)
363 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest,
false));
376 void DoRun()
override;
380 :
TestCase(
"NewtonStep arithmetic unit test")
392 for (uint16_t recInvSqrt = 0xff; recInvSqrt > 0; recInvSqrt /= 2)
394 for (uint32_t count = 1; count < 0xff; count *= 2)
396 result = queue->NewtonStep(recInvSqrt, count);
400 "ns-3 NewtonStep() fails to match Linux equivalent");
414 void DoRun()
override;
426 :
TestCase(
"ControlLaw arithmetic unit test")
446 uint32_t interval = queue->Time2CoDel(
MilliSeconds(100));
448 uint32_t codelTimeVal;
451 for (uint16_t recInvSqrt = 0xff; recInvSqrt > 0; recInvSqrt /= 2)
453 codelTimeVal = queue->Time2CoDel(timeVal);
454 uint32_t ns3Result = queue->ControlLaw(codelTimeVal, interval, recInvSqrt);
458 "Linux result for ControlLaw should equal ns-3 result");
477 void DoRun()
override;
520 uint32_t modeSize = 0;
534 "Verify that we can actually set the attribute MaxSize");
541 "There should be 20 packets in queue.");
545 Time waitUntilFirstDequeue = 2 * queue->GetTarget();
546 Simulator::Schedule(waitUntilFirstDequeue,
553 Time waitUntilSecondDequeue = waitUntilFirstDequeue + 2 * queue->GetInterval();
554 Simulator::Schedule(waitUntilSecondDequeue,
562 Simulator::Schedule(waitUntilSecondDequeue,
570 Simulator::Schedule(waitUntilSecondDequeue * 2,
577 Simulator::Destroy();
584 for (uint32_t i = 0; i < nPkt; i++)
586 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest,
false));
593 uint32_t initialDropCount =
594 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
595 uint32_t initialQSize = queue->GetCurrentSize().GetValue();
596 uint32_t initialDropNext = queue->GetDropNext();
598 uint32_t currentDropCount = 0;
600 if (initialDropCount > 0 && currentTime.
GetMicroSeconds() >= initialDropNext)
602 queue->TraceConnectWithoutContext(
607 if (initialQSize != 0)
610 if (initialDropCount == 0 && currentTime > queue->GetTarget())
612 if (currentTime < queue->GetInterval())
615 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
618 "We are not in dropping state."
619 "Sojourn time has just gone above target from below."
620 "Hence, there should be no packet drops");
622 initialQSize - modeSize,
623 "There should be 1 packet dequeued.");
625 else if (currentTime >= queue->GetInterval())
628 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
630 initialQSize - 2 * modeSize,
631 "Sojourn time has been above target for at least interval."
632 "We enter the dropping state, perform initial packet drop, "
633 "and dequeue the next."
634 "So there should be 2 more packets dequeued.");
638 else if (initialDropCount > 0)
643 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
645 initialQSize - modeSize,
646 "We are in dropping state."
647 "Sojourn is still above target."
648 "However, it's not time for next drop."
649 "So there should be only 1 more packet dequeued");
654 "There should still be only 1 packet drop from the last dequeue");
659 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
662 "We are in dropping state."
663 "It's time for next drop."
664 "The number of packets dequeued equals to the number of "
665 "times m_dropNext is updated plus initial dequeue");
668 "The number of drops equals to the number of times "
669 "m_dropNext is updated plus 1 from last dequeue");
689 void DoRun()
override;
743 uint32_t modeSize = 0;
759 "Verify that we can actually set the attribute MaxSize");
762 "Verify that we can actually set the attribute UseEcn");
770 "There should be 20 packets in queue.");
774 Time waitUntilFirstDequeue = 2 * queue->GetTarget();
775 Simulator::Schedule(waitUntilFirstDequeue,
783 Time waitUntilSecondDequeue = waitUntilFirstDequeue + 2 * queue->GetInterval();
784 Simulator::Schedule(waitUntilSecondDequeue,
792 Simulator::Destroy();
795 queue = CreateObject<CoDelQueueDisc>();
799 "Verify that we can actually set the attribute MaxSize");
802 "Verify that we can actually set the attribute UseEcn");
810 "There should be 20 packets in queue.");
814 Simulator::Schedule(waitUntilFirstDequeue,
822 Simulator::Schedule(waitUntilSecondDequeue,
831 Simulator::Schedule(waitUntilSecondDequeue,
840 Simulator::Schedule(waitUntilSecondDequeue * 2,
848 Simulator::Destroy();
851 queue = CreateObject<CoDelQueueDisc>();
855 "Verify that we can actually set the attribute MaxSize");
858 "Verify that we can actually set the attribute UseEcn");
861 "Verify that we can actually set the attribute CeThreshold");
871 "There should be 20 packets in queue.");
875 Simulator::Schedule(waitUntilFirstDequeue,
883 Simulator::Schedule(waitUntilSecondDequeue,
892 Simulator::Schedule(waitUntilSecondDequeue,
901 Simulator::Schedule(waitUntilSecondDequeue * 2,
909 Simulator::Destroy();
913 queue = CreateObject<CoDelQueueDisc>();
917 "Verify that we can actually set the attribute MaxSize");
920 "Verify that we can actually set the attribute UseEcn");
923 "Verify that we can actually set the attribute CeThreshold");
931 "There should be 20 packets in queue.");
952 Simulator::Schedule(waitUntilFirstDequeue,
961 Simulator::Schedule(waitUntilSecondDequeue,
969 Simulator::Destroy();
979 for (uint32_t i = 0; i < nPkt; i++)
981 queue->Enqueue(Create<CodelQueueDiscTestItem>(Create<Packet>(size), dest, ecnCapable));
988 uint32_t initialTargetMarkCount =
989 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
990 uint32_t initialCeThreshMarkCount =
991 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
992 uint32_t initialQSize = queue->GetCurrentSize().GetValue();
993 uint32_t initialDropNext = queue->GetDropNext();
995 uint32_t currentDropCount = 0;
996 uint32_t currentTargetMarkCount = 0;
997 uint32_t currentCeThreshMarkCount = 0;
999 if (initialTargetMarkCount > 0 && currentTime.
GetMicroSeconds() >= initialDropNext &&
1002 queue->TraceConnectWithoutContext(
1007 if (initialQSize != 0)
1013 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1014 if (currentDropCount == 1)
1019 else if (testCase == 2)
1021 if (initialTargetMarkCount == 0 && currentTime > queue->GetTarget())
1023 if (currentTime < queue->GetInterval())
1026 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1027 currentTargetMarkCount =
1028 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1029 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1030 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1032 initialQSize - modeSize,
1033 "There should be 1 packet dequeued.");
1036 "There should not be any packet drops");
1038 currentTargetMarkCount,
1040 "We are not in dropping state."
1041 "Sojourn time has just gone above target from below."
1042 "Hence, there should be no target exceeded marked packets");
1044 currentCeThreshMarkCount,
1046 "Marking due to CE threshold is disabled"
1047 "Hence, there should not be any CE threshold exceeded marked packet");
1049 else if (currentTime >= queue->GetInterval())
1052 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1053 currentTargetMarkCount =
1054 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1056 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1057 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1059 queue->GetCurrentSize().GetValue(),
1060 initialQSize - modeSize,
1061 "Sojourn time has been above target for at least interval."
1062 "We enter the dropping state and perform initial packet marking"
1063 "So there should be only 1 more packet dequeued.");
1066 "There should not be any packet drops");
1069 "There should be 1 target exceeded marked packet");
1071 currentCeThreshMarkCount,
1073 "There should not be any CE threshold exceeded marked packet");
1076 else if (initialTargetMarkCount > 0)
1081 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1082 currentTargetMarkCount =
1083 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1084 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1085 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1087 initialQSize - modeSize,
1088 "We are in dropping state."
1089 "Sojourn is still above target."
1090 "However, it's not time for next target exceeded mark."
1091 "So there should be only 1 more packet dequeued");
1094 "There should not be any packet drops");
1097 "There should still be only 1 target exceeded marked "
1098 "packet from the last dequeue");
1100 currentCeThreshMarkCount,
1102 "There should not be any CE threshold exceeded marked packet");
1107 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1108 currentTargetMarkCount =
1109 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1110 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1111 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1113 initialQSize - modeSize,
1114 "We are in dropping state."
1115 "It's time for packet to be marked"
1116 "So there should be only 1 more packet dequeued");
1119 "There should not be any packet drops");
1122 "There should 2 target exceeded marked packet");
1126 "Number of packets in the queue before drop should be equal"
1127 "to number of packets in the queue before first mark as the behavior "
1128 "until packet N should be the same.");
1130 currentCeThreshMarkCount,
1132 "There should not be any CE threshold exceeded marked packet");
1136 else if (testCase == 3)
1138 if (initialTargetMarkCount == 0 && currentTime > queue->GetTarget())
1140 if (currentTime < queue->GetInterval())
1143 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1144 currentTargetMarkCount =
1145 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1146 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1147 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1149 initialQSize - modeSize,
1150 "There should be 1 packet dequeued.");
1153 "There should not be any packet drops");
1155 currentTargetMarkCount,
1157 "We are not in dropping state."
1158 "Sojourn time has just gone above target from below."
1159 "Hence, there should be no target exceeded marked packets");
1161 currentCeThreshMarkCount,
1163 "Sojourn time has gone above CE threshold."
1164 "Hence, there should be 1 CE threshold exceeded marked packet");
1166 else if (currentTime >= queue->GetInterval())
1169 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1170 currentTargetMarkCount =
1171 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1172 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1173 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1175 queue->GetCurrentSize().GetValue(),
1176 initialQSize - modeSize,
1177 "Sojourn time has been above target for at least interval."
1178 "We enter the dropping state and perform initial packet marking"
1179 "So there should be only 1 more packet dequeued.");
1182 "There should not be any packet drops");
1185 "There should be 1 target exceeded marked packet");
1188 "There should be 1 CE threshold exceeded marked packets");
1191 else if (initialTargetMarkCount > 0)
1196 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1197 currentTargetMarkCount =
1198 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1199 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1200 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1202 initialQSize - modeSize,
1203 "We are in dropping state."
1204 "Sojourn is still above target."
1205 "However, it's not time for next target exceeded mark."
1206 "So there should be only 1 more packet dequeued");
1209 "There should not be any packet drops");
1212 "There should still be only 1 target exceeded marked "
1213 "packet from the last dequeue");
1216 "There should be 2 CE threshold exceeded marked packets");
1221 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1222 currentTargetMarkCount =
1223 queue->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK);
1224 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1225 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1227 queue->GetCurrentSize().GetValue(),
1229 "We are in dropping state."
1230 "It's time for packet to be dropped as packets are not ecnCapable"
1231 "The number of packets dequeued equals to the number of times m_dropNext "
1232 "is updated plus initial dequeue");
1236 "The number of drops equals to the number of times m_dropNext is updated");
1238 currentTargetMarkCount,
1240 "There should still be only 1 target exceeded marked packet");
1243 "There should still be 2 CE threshold exceeded marked "
1244 "packet as packets are not ecnCapable");
1248 else if (testCase == 4)
1250 if (currentTime < queue->GetTarget())
1252 if (initialCeThreshMarkCount == 0 && currentTime <
MilliSeconds(2))
1255 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1256 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1257 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1259 initialQSize - modeSize,
1260 "There should be 1 packet dequeued.");
1263 "There should not be any packet drops");
1265 currentCeThreshMarkCount,
1267 "Sojourn time has not gone above CE threshold."
1268 "Hence, there should not be any CE threshold exceeded marked packet");
1273 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1274 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1275 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1277 initialQSize - modeSize,
1278 "There should be only 1 more packet dequeued.");
1281 "There should not be any packet drops");
1284 "Sojourn time has gone above CE threshold."
1285 "There should be 1 CE threshold exceeded marked packet");
1288 else if (initialCeThreshMarkCount > 0 && currentTime < queue->GetInterval())
1290 if (initialCeThreshMarkCount < 2)
1293 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1294 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1295 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1297 initialQSize - modeSize,
1298 "There should be only 1 more packet dequeued.");
1301 "There should not be any packet drops");
1304 "There should be 2 CE threshold exceeded marked packets");
1309 queue->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP);
1310 currentCeThreshMarkCount = queue->GetStats().GetNMarkedPackets(
1311 CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK);
1313 initialQSize - modeSize,
1314 "There should be only 1 more packet dequeued.");
1317 "There should not be any packet drops");
1320 "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
AttributeValue implementation for Boolean.
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.
AttributeValue implementation for QueueSize.
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.
AttributeValue implementation for Time.
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)