21 #include "ns3/codel-queue-disc.h"
22 #include "ns3/fq-codel-queue-disc.h"
23 #include "ns3/ipv4-address.h"
24 #include "ns3/ipv4-header.h"
25 #include "ns3/ipv4-packet-filter.h"
26 #include "ns3/ipv4-queue-disc-item.h"
27 #include "ns3/ipv6-header.h"
28 #include "ns3/ipv6-packet-filter.h"
29 #include "ns3/ipv6-queue-disc-item.h"
30 #include "ns3/pointer.h"
31 #include "ns3/simulator.h"
32 #include "ns3/string.h"
33 #include "ns3/tcp-header.h"
35 #include "ns3/udp-header.h"
80 .SetGroupName(
"Internet")
117 void DoRun()
override;
121 :
TestCase(
"Test packets that are not classified by any filter")
134 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
StringValue(
"4p"));
136 queueDisc->AddPacketFilter(filter);
139 queueDisc->SetQuantum(1500);
140 queueDisc->Initialize();
143 p = Create<Packet>();
147 item = Create<Ipv6QueueDiscItem>(p, dest, 0, ipv6Header);
148 queueDisc->Enqueue(item);
151 "no flow queue should have been created");
153 p = Create<Packet>(
reinterpret_cast<const uint8_t*
>(
"hello, world"), 12);
154 item = Create<Ipv6QueueDiscItem>(p, dest, 0, ipv6Header);
155 queueDisc->Enqueue(item);
158 "no flow queue should have been created");
160 Simulator::Destroy();
175 void DoRun()
override;
185 :
TestCase(
"Test IP flows separation and packet limit")
200 queue->Enqueue(item);
207 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
StringValue(
"4p"));
209 queueDisc->SetQuantum(1500);
210 queueDisc->Initialize();
224 "unexpected number of packets in the queue disc");
227 "unexpected number of packets in the flow queue");
235 "unexpected number of packets in the queue disc");
238 "unexpected number of packets in the flow queue");
241 "unexpected number of packets in the flow queue");
247 "unexpected number of packets in the queue disc");
250 "unexpected number of packets in the flow queue");
253 "unexpected number of packets in the flow queue");
255 Simulator::Destroy();
270 void DoRun()
override;
280 :
TestCase(
"Test credits and flows status")
294 queue->Enqueue(item);
302 queueDisc->SetQuantum(90);
303 queueDisc->Initialize();
315 "unexpected number of packets in the queue disc");
318 "unexpected number of packets in the first flow queue");
319 Ptr<FqCoDelFlow> flow1 = StaticCast<FqCoDelFlow>(queueDisc->GetQueueDiscClass(0));
321 static_cast<int32_t
>(queueDisc->GetQuantum()),
322 "the deficit of the first flow must equal the quantum");
324 FqCoDelFlow::NEW_FLOW,
325 "the first flow must be in the list of new queues");
327 queueDisc->Dequeue();
330 "unexpected number of packets in the queue disc");
333 "unexpected number of packets in the first flow queue");
342 "unexpected number of packets in the queue disc");
345 "unexpected number of packets in the first flow queue");
347 FqCoDelFlow::NEW_FLOW,
348 "the first flow must still be in the list of new queues");
356 "unexpected number of packets in the queue disc");
359 "unexpected number of packets in the first flow queue");
362 "unexpected number of packets in the second flow queue");
363 Ptr<FqCoDelFlow> flow2 = StaticCast<FqCoDelFlow>(queueDisc->GetQueueDiscClass(1));
365 static_cast<int32_t
>(queueDisc->GetQuantum()),
366 "the deficit of the second flow must equal the quantum");
368 FqCoDelFlow::NEW_FLOW,
369 "the second flow must be in the list of new queues");
372 queueDisc->Dequeue();
375 "unexpected number of packets in the queue disc");
378 "unexpected number of packets in the first flow queue");
381 "unexpected number of packets in the second flow queue");
386 FqCoDelFlow::OLD_FLOW,
387 "the first flow must be in the list of old queues");
391 FqCoDelFlow::NEW_FLOW,
392 "the second flow must be in the list of new queues");
395 queueDisc->Dequeue();
398 "unexpected number of packets in the queue disc");
401 "unexpected number of packets in the first flow queue");
404 "unexpected number of packets in the second flow queue");
408 FqCoDelFlow::OLD_FLOW,
409 "the first flow must be in the list of old queues");
414 FqCoDelFlow::OLD_FLOW,
415 "the second flow must be in the list of new queues");
418 queueDisc->Dequeue();
421 "unexpected number of packets in the queue disc");
424 "unexpected number of packets in the first flow queue");
427 "unexpected number of packets in the second flow queue");
432 FqCoDelFlow::OLD_FLOW,
433 "the first flow must be in the list of old queues");
437 FqCoDelFlow::OLD_FLOW,
438 "the second flow must be in the list of new queues");
441 queueDisc->Dequeue();
444 "unexpected number of packets in the queue disc");
447 "unexpected number of packets in the first flow queue");
450 "unexpected number of packets in the second flow queue");
454 FqCoDelFlow::OLD_FLOW,
455 "the first flow must be in the list of old queues");
460 FqCoDelFlow::OLD_FLOW,
461 "the second flow must be in the list of new queues");
464 queueDisc->Dequeue();
475 "the first flow must be inactive");
479 "the second flow must be inactive");
481 Simulator::Destroy();
496 void DoRun()
override;
507 :
TestCase(
"Test TCP flows separation")
524 queue->Enqueue(item);
531 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
StringValue(
"10p"));
533 queueDisc->SetQuantum(1500);
534 queueDisc->Initialize();
552 "unexpected number of packets in the queue disc");
555 "unexpected number of packets in the first flow queue");
562 "unexpected number of packets in the queue disc");
565 "unexpected number of packets in the first flow queue");
568 "unexpected number of packets in the second flow queue");
575 "unexpected number of packets in the queue disc");
578 "unexpected number of packets in the first flow queue");
581 "unexpected number of packets in the second flow queue");
584 "unexpected number of packets in the third flow queue");
592 "unexpected number of packets in the queue disc");
595 "unexpected number of packets in the first flow queue");
598 "unexpected number of packets in the second flow queue");
601 "unexpected number of packets in the third flow queue");
604 "unexpected number of packets in the third flow queue");
606 Simulator::Destroy();
621 void DoRun()
override;
632 :
TestCase(
"Test UDP flows separation")
649 queue->Enqueue(item);
656 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
StringValue(
"10p"));
658 queueDisc->SetQuantum(1500);
659 queueDisc->Initialize();
677 "unexpected number of packets in the queue disc");
680 "unexpected number of packets in the first flow queue");
687 "unexpected number of packets in the queue disc");
690 "unexpected number of packets in the first flow queue");
693 "unexpected number of packets in the second flow queue");
700 "unexpected number of packets in the queue disc");
703 "unexpected number of packets in the first flow queue");
706 "unexpected number of packets in the second flow queue");
709 "unexpected number of packets in the third flow queue");
717 "unexpected number of packets in the queue disc");
720 "unexpected number of packets in the first flow queue");
723 "unexpected number of packets in the second flow queue");
726 "unexpected number of packets in the third flow queue");
729 "unexpected number of packets in the third flow queue");
731 Simulator::Destroy();
749 void DoRun()
override;
761 uint32_t nPktEnqueued,
762 uint32_t nQueueFlows);
791 uint32_t nPktEnqueued,
792 uint32_t nQueueFlows)
796 for (uint32_t i = 0; i < nPkt; i++)
799 queue->Enqueue(item);
803 "unexpected number of flow queues");
806 "unexpected number of enqueued packets");
812 for (uint32_t i = 0; i < nPkt; i++)
823 for (uint32_t i = 0; i < nPkt; i++)
825 Simulator::Schedule(
Time(
Seconds((i + 1) * delay)),
844 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
851 queueDisc->SetQuantum(1514);
852 queueDisc->Initialize();
858 hdr.
SetEcn(Ipv4Header::ECN_ECT0);
894 hdr.
SetEcn(Ipv4Header::ECN_NotECT);
921 queueDisc->GetQueueDiscClass(0)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
923 queueDisc->GetQueueDiscClass(1)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
925 queueDisc->GetQueueDiscClass(2)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
927 queueDisc->GetQueueDiscClass(3)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
929 queueDisc->GetQueueDiscClass(4)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
935 "There should be some remaining packets");
938 "There should be some remaining packets");
941 "There should be some remaining packets");
944 "There should be some remaining packets");
947 "There should be some remaining packets");
952 "There should be 6 marked packets"
953 "with 20 packets, total bytes in the queue = 120 * 20 = 2400. First "
954 "packet dequeues at 110ms which is greater than"
955 "test's default target value 5ms. Sojourn time has just gone above "
956 "target from below, need to stay above for at"
957 "least q->interval before packet can be dropped. Second packet dequeues "
958 "at 220ms which is greater than last dequeue"
959 "time plus q->interval(test default 100ms) so the packet is marked. "
960 "Third packet dequeues at 330ms and the sojourn"
961 "time stayed above the target and dropnext value is less than 320 hence "
962 "the packet is marked. 4 subsequent packets"
963 "are marked as the sojourn time stays above the target. With 8th dequeue "
964 "number of bytes in queue = 120 * 12 = 1440"
965 "which is less m_minBytes(test's default value 1500 bytes) hence the "
966 "packets stop getting marked");
969 "There should not be any dropped packets");
972 "There should be 6 marked packets");
975 "There should not be any dropped packets");
978 "There should be 6 marked packets");
981 "There should not be any dropped packets");
985 q3->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP),
987 "There should be 4 dropped packets"
988 "with 20 packets, total bytes in the queue = 120 * 20 = 2400. First packet dequeues at "
989 "110ms which is greater than"
990 "test's default target value 5ms. Sojourn time has just gone above target from below, need "
991 "to stay above for at"
992 "least q->interval before packet can be dropped. Second packet dequeues at 220ms which is "
993 "greater than last dequeue"
994 "time plus q->interval(test default 100ms) so packet is dropped and next is dequeued. 4th "
995 "packet dequeues at 330ms"
996 "and the sojourn time stayed above the target and dropnext value is less than 320 hence "
997 "the packet is dropped and next"
998 "packet is dequeued. 6th packet dequeues at 440ms and 2 more packets are dropped as "
999 "dropnext value is increased twice."
1000 "12 Packets remaining in the queue, total number of bytes int the queue = 120 * 12 = 1440 "
1002 "m_minBytes(test's default value 1500 bytes) hence the packets stop getting dropped");
1005 "There should not be any marked packets");
1008 "There should be 4 dropped packets");
1011 "There should not be any marked packets");
1016 Ipv4Header::ECN_NotECT,
1017 "flow queue should have ECT0 packets");
1020 Ipv4Header::ECN_NotECT,
1021 "flow queue should have ECT0 packets");
1024 Ipv4Header::ECN_NotECT,
1025 "flow queue should have ECT0 packets");
1027 Simulator::Destroy();
1030 queueDisc = CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
1036 queueDisc->SetQuantum(1514);
1037 queueDisc->Initialize();
1041 hdr.
SetEcn(Ipv4Header::ECN_ECT0);
1075 hdr.
SetEcn(Ipv4Header::ECN_NotECT);
1100 Simulator::Stop(
Seconds(8.0));
1101 q0 = queueDisc->GetQueueDiscClass(0)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1102 q1 = queueDisc->GetQueueDiscClass(1)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1103 q2 = queueDisc->GetQueueDiscClass(2)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1104 q3 = queueDisc->GetQueueDiscClass(3)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1105 q4 = queueDisc->GetQueueDiscClass(4)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1111 "There should be some remaining packets");
1114 "There should be some remaining packets");
1117 "There should be some remaining packets");
1120 "There should be some remaining packets");
1123 "There should be some remaining packets");
1128 "There should not be any dropped packets");
1130 q0->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1132 "There should not be any marked packets"
1133 "with quantum of 1514, 13 packets of size 120 bytes can be dequeued. sojourn time of 13th "
1134 "packet is 1.3ms which is"
1135 "less than CE threshold");
1138 "There should not be any dropped packets");
1140 q1->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1142 "There should be 6 marked packets"
1143 "with quantum of 1514, 13 packets of size 120 bytes can be dequeued. sojourn time of 8th "
1144 "packet is 2.1ms which is greater"
1145 "than CE threshold and subsequent packet also have sojourn time more 8th packet hence "
1146 "remaining packet are marked.");
1149 "There should not be any dropped packets");
1151 q2->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1153 "There should be 13 marked packets"
1154 "with quantum of 1514, 13 packets of size 120 bytes can be dequeued and all of them have "
1155 "sojourn time more than CE threshold");
1159 q3->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1161 "There should not be any marked packets");
1164 "There should not be any dropped packets");
1166 q4->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1168 "There should not be any marked packets");
1171 "There should not be any dropped packets");
1175 pktQ0 = DynamicCast<const Ipv4QueueDiscItem>(q0->Peek());
1177 Ipv4Header::ECN_NotECT,
1178 "flow queue should have ECT0 packets");
1179 pktQ1 = DynamicCast<const Ipv4QueueDiscItem>(q1->Peek());
1181 Ipv4Header::ECN_NotECT,
1182 "flow queue should have ECT0 packets");
1183 pktQ2 = DynamicCast<const Ipv4QueueDiscItem>(q2->Peek());
1185 Ipv4Header::ECN_NotECT,
1186 "flow queue should have ECT0 packets");
1188 Simulator::Destroy();
1191 queueDisc = CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
1197 queueDisc->SetQuantum(1514);
1198 queueDisc->Initialize();
1202 hdr.
SetEcn(Ipv4Header::ECN_ECT0);
1236 hdr.
SetEcn(Ipv4Header::ECN_NotECT);
1261 Simulator::Stop(
Seconds(8.0));
1262 q0 = queueDisc->GetQueueDiscClass(0)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1263 q1 = queueDisc->GetQueueDiscClass(1)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1264 q2 = queueDisc->GetQueueDiscClass(2)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1265 q3 = queueDisc->GetQueueDiscClass(3)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1266 q4 = queueDisc->GetQueueDiscClass(4)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1272 "There should be some remaining packets");
1275 "There should be some remaining packets");
1278 "There should be some remaining packets");
1281 "There should be some remaining packets");
1284 "There should be some remaining packets");
1289 "There should not be any dropped packets");
1291 q0->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK) +
1292 q0->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK),
1293 20 - q0->GetNPackets(),
1294 "Number of CE threshold"
1295 " exceeded marks plus Number of Target exceeded marks should be equal to total number of "
1296 "packets dequeued");
1299 "There should not be any dropped packets");
1301 q1->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK) +
1302 q1->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK),
1303 20 - q1->GetNPackets(),
1304 "Number of CE threshold"
1305 " exceeded marks plus Number of Target exceeded marks should be equal to total number of "
1306 "packets dequeued");
1309 "There should not be any dropped packets");
1311 q2->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK) +
1312 q2->GetStats().GetNMarkedPackets(CoDelQueueDisc::TARGET_EXCEEDED_MARK),
1313 20 - q2->GetNPackets(),
1314 "Number of CE threshold"
1315 " exceeded marks plus Number of Target exceeded marks should be equal to total number of "
1316 "packets dequeued");
1320 q3->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1322 "There should not be any marked packets");
1324 q3->GetStats().GetNDroppedPackets(CoDelQueueDisc::TARGET_EXCEEDED_DROP),
1326 "There should be 4 dropped packets"
1327 " As queue delay is same as in test case 1, number of dropped packets should also be same");
1329 q4->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1331 "There should not be any marked packets");
1334 "There should be 4 dropped packets");
1338 pktQ0 = DynamicCast<const Ipv4QueueDiscItem>(q0->Peek());
1340 Ipv4Header::ECN_NotECT,
1341 "flow queue should have ECT0 packets");
1342 pktQ1 = DynamicCast<const Ipv4QueueDiscItem>(q1->Peek());
1344 Ipv4Header::ECN_NotECT,
1345 "flow queue should have ECT0 packets");
1346 pktQ2 = DynamicCast<const Ipv4QueueDiscItem>(q2->Peek());
1348 Ipv4Header::ECN_NotECT,
1349 "flow queue should have ECT0 packets");
1351 Simulator::Destroy();
1385 void DoRun()
override;
1395 :
TestCase(
"Test credits and flows status")
1409 queue->Enqueue(item);
1416 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"EnableSetAssociativeHash",
1418 queueDisc->SetQuantum(90);
1419 queueDisc->Initialize();
1422 queueDisc->AddPacketFilter(filter);
1453 "unexpected number of packets in the queue disc");
1456 "unexpected number of packets in the first flow queue of set one");
1459 "unexpected number of packets in the second flow queue of set one");
1462 "unexpected number of packets in the third flow queue of set one");
1465 "unexpected number of packets in the fourth flow queue of set one");
1468 "unexpected number of packets in the fifth flow queue of set one");
1471 "unexpected number of packets in the sixth flow queue of set one");
1474 "unexpected number of packets in the seventh flow queue of set one");
1477 "unexpected number of packets in the eighth flow queue of set one");
1482 "unexpected number of packets in the first flow of set one");
1487 "unexpected number of packets in the first flow of set two");
1488 Simulator::Destroy();
1505 void DoRun()
override;
1556 for (uint32_t i = 0; i < nPkt; i++)
1559 queue->Enqueue(item);
1569 for (uint32_t i = 0; i < nPkt; i++)
1571 Simulator::Schedule(
Time(
Seconds((i + 1) * delay)),
1583 for (uint32_t i = 0; i < nPkt; i++)
1592 for (uint32_t i = 0; i < nPkt; i++)
1594 Simulator::Schedule(
Time(
Seconds((i + 1) * delay)),
1611 CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
1622 queueDisc->SetQuantum(1514);
1623 queueDisc->Initialize();
1629 hdr.
SetEcn(Ipv4Header::ECN_ECT1);
1633 double delay = 0.0005;
1643 hdr.
SetEcn(Ipv4Header::ECN_ECT0);
1657 Simulator::Stop(
Seconds(8.0));
1659 queueDisc->GetQueueDiscClass(0)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1661 queueDisc->GetQueueDiscClass(1)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1664 q0->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1666 "There should be 66 marked packets"
1667 "4th packet is enqueued at 2ms and dequeued at 4ms hence the delay of 2ms which not "
1668 "greater than CE threshold"
1669 "5th packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and "
1670 "subsequent packet also do have delay"
1671 "greater than CE threshold so all the packets after 4th packet are marked");
1674 "There should not be any dropped packets");
1677 "There should not be any marked packets");
1680 "There should be 1 marked packets");
1683 "There should not be any dropped packets");
1685 Simulator::Destroy();
1688 queueDisc = CreateObjectWithAttributes<FqCoDelQueueDisc>(
"MaxSize",
1699 queueDisc->SetQuantum(1514);
1700 queueDisc->Initialize();
1705 hdr.
SetEcn(Ipv4Header::ECN_ECT1);
1725 hdr.
SetEcn(Ipv4Header::ECN_ECT0);
1737 Simulator::Stop(
Seconds(8.0));
1738 q0 = queueDisc->GetQueueDiscClass(0)->GetQueueDisc()->GetObject<
CoDelQueueDisc>();
1741 q0->GetStats().GetNMarkedPackets(CoDelQueueDisc::CE_THRESHOLD_EXCEEDED_MARK),
1743 "There should be 68 marked packets"
1744 "2nd ECT1 packet is enqueued at 1.5ms and dequeued at 3ms hence the delay of 1.5ms which "
1745 "not greater than CE threshold"
1746 "3rd packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and "
1747 "subsequent packet also do have delay"
1748 "greater than CE threshold so all the packets after 2nd packet are marked");
1751 "There should not be any dropped packets");
1754 "There should be 1 marked packets");
1756 Simulator::Destroy();
1771 :
TestSuite(
"fq-codel-queue-disc", UNIT)
This class tests the deficit per flow.
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr)
Enqueue a packet.
void DoRun() override
Implementation to actually run this TestCase.
~FqCoDelQueueDiscDeficit() override
FqCoDelQueueDiscDeficit()
This class tests ECN marking.
void Dequeue(Ptr< FqCoDelQueueDisc > queue, uint32_t nPkt)
Dequeue some packets.
void DoRun() override
Implementation to actually run this TestCase.
FqCoDelQueueDiscECNMarking()
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr, uint32_t nPkt, uint32_t nPktEnqueued, uint32_t nQueueFlows)
Enqueue some packets.
void DequeueWithDelay(Ptr< FqCoDelQueueDisc > queue, double delay, uint32_t nPkt)
Dequeue some packets with delay.
~FqCoDelQueueDiscECNMarking() override
This class tests the IP flows separation and the packet limit.
void DoRun() override
Implementation to actually run this TestCase.
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr)
Enqueue a packet.
~FqCoDelQueueDiscIPFlowsSeparationAndPacketLimit() override
FqCoDelQueueDiscIPFlowsSeparationAndPacketLimit()
This class tests L4S mode.
void DoRun() override
Implementation to actually run this TestCase.
~FqCoDelQueueDiscL4sMode() override
FqCoDelQueueDiscL4sMode()
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr, uint32_t nPkt)
Enqueue some packets.
void AddPacketWithDelay(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr, double delay, uint32_t nPkt)
Enqueue some packets with delay.
void DequeueWithDelay(Ptr< FqCoDelQueueDisc > queue, double delay, uint32_t nPkt)
Dequeue some packets with delay.
void Dequeue(Ptr< FqCoDelQueueDisc > queue, uint32_t nPkt)
Dequeue some packets.
This class tests packets for which there is no suitable filter.
~FqCoDelQueueDiscNoSuitableFilter() override
void DoRun() override
Implementation to actually run this TestCase.
FqCoDelQueueDiscNoSuitableFilter()
This class tests linear probing, collision response, and set creation capability of set associative h...
FqCoDelQueueDiscSetLinearProbing()
~FqCoDelQueueDiscSetLinearProbing() override
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header hdr)
Enqueue a packet.
void DoRun() override
Implementation to actually run this TestCase.
This class tests the TCP flows separation.
FqCoDelQueueDiscTCPFlowsSeparation()
void DoRun() override
Implementation to actually run this TestCase.
~FqCoDelQueueDiscTCPFlowsSeparation() override
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header ipHdr, TcpHeader tcpHdr)
Enqueue a packet.
FQ-CoDel queue disc test suite.
FqCoDelQueueDiscTestSuite()
This class tests the UDP flows separation.
void AddPacket(Ptr< FqCoDelQueueDisc > queue, Ipv4Header ipHdr, UdpHeader udpHdr)
Enqueue a packet.
~FqCoDelQueueDiscUDPFlowsSeparation() override
void DoRun() override
Implementation to actually run this TestCase.
FqCoDelQueueDiscUDPFlowsSeparation()
Simple test packet filter able to classify IPv4 packets.
bool CheckProtocol(Ptr< QueueDiscItem > item) const override
Check the protocol.
int32_t DoClassify(Ptr< QueueDiscItem > item) const override
Classify a QueueDiscItem.
static TypeId GetTypeId()
Get the type ID.
~Ipv4TestPacketFilter() override
a polymophic address class
A CoDel packet queue disc.
Ipv4 addresses are stored in host order in this class.
Ipv4PacketFilter is the abstract base class for filters defined for IPv4 packets.
void AddHeader(const Header &header)
Add header to this packet.
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
static FqCoDelQueueDiscTestSuite g_fqCoDelQueueDiscTestSuite
Do not forget to allocate an instance of this TestSuite.
static int32_t g_hash
Variable to assign g_hash to a new packet's flow.
@ INACTIVE
Inactive Period or unslotted CSMA-CA.
#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_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report 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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.