A Discrete-Event Network Simulator
API
fq-pie-queue-disc-test-suite.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
4  * Copyright (c) 2020 NITK Surathkal (modified for FQ-PIE)
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Pasquale Imputato <p.imputato@gmail.com>
20  * Stefano Avallone <stefano.avallone@unina.it>
21  * Modified for FQ-PIE by: Bhaskar Kataria <bhaskar.k7920@gmail.com>
22  * Tom Henderson <tomhend@u.washington.edu>
23  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
24  * Vivek Jain <jain.vivek.anand@gmail.com>
25  * Ankit Deepak <adadeepak8@gmail.com>
26  *
27 */
28 
29 #include "ns3/test.h"
30 #include "ns3/simulator.h"
31 #include "ns3/fq-pie-queue-disc.h"
32 #include "ns3/pie-queue-disc.h"
33 #include "ns3/ipv4-header.h"
34 #include "ns3/ipv4-packet-filter.h"
35 #include "ns3/ipv4-queue-disc-item.h"
36 #include "ns3/ipv4-address.h"
37 #include "ns3/ipv6-header.h"
38 #include "ns3/ipv6-packet-filter.h"
39 #include "ns3/ipv6-queue-disc-item.h"
40 #include "ns3/tcp-header.h"
41 #include "ns3/udp-header.h"
42 #include "ns3/string.h"
43 #include "ns3/pointer.h"
44 
45 using namespace ns3;
46 
47 // Variable to assign g_hash to a new packet's flow
48 int32_t g_hash;
49 
55 {
56 public:
61  static TypeId GetTypeId (void);
62 
64  virtual ~Ipv4FqPieTestPacketFilter ();
65 
66 private:
67  virtual int32_t DoClassify (Ptr<QueueDiscItem> item) const;
68  virtual bool CheckProtocol (Ptr<QueueDiscItem> item) const;
69 };
70 
71 TypeId
73 {
74  static TypeId tid = TypeId ("ns3::Ipv4FqPieTestPacketFilter")
76  .SetGroupName ("Internet")
77  .AddConstructor<Ipv4FqPieTestPacketFilter> ()
78  ;
79  return tid;
80 }
81 
83 {}
84 
86 {}
87 
88 int32_t
90 {
91  return g_hash;
92 }
93 
94 bool
96 {
97  return true;
98 }
99 
104 {
105 public:
107  virtual ~FqPieQueueDiscNoSuitableFilter ();
108 
109 private:
110  virtual void DoRun (void);
111 };
112 
114  : TestCase ("Test packets that are not classified by any filter")
115 {}
116 
118 {}
119 
120 void
122 {
123  // Packets that cannot be classified by the available filters should be dropped
124  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("4p"));
125  Ptr<Ipv4FqPieTestPacketFilter> filter = CreateObject<Ipv4FqPieTestPacketFilter> ();
126  queueDisc->AddPacketFilter (filter);
127 
128  g_hash = -1;
129  queueDisc->SetQuantum (1500);
130  queueDisc->Initialize ();
131 
132  Ptr<Packet> p;
133  p = Create<Packet> ();
135  Ipv6Header ipv6Header;
136  Address dest;
137  item = Create<Ipv6QueueDiscItem> (p, dest, 0, ipv6Header);
138  queueDisc->Enqueue (item);
139  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetNQueueDiscClasses (), 0, "no flow queue should have been created");
140 
141  p = Create<Packet> (reinterpret_cast<const uint8_t*> ("hello, world"), 12);
142  item = Create<Ipv6QueueDiscItem> (p, dest, 0, ipv6Header);
143  queueDisc->Enqueue (item);
144  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetNQueueDiscClasses (), 0, "no flow queue should have been created");
145 
146  Simulator::Destroy ();
147 }
148 
153 {
154 public:
157 
158 private:
159  virtual void DoRun (void);
160  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header hdr);
161 };
162 
164  : TestCase ("Test IP flows separation and packet limit")
165 {}
166 
168 {}
169 
170 void
172 {
173  Ptr<Packet> p = Create<Packet> (100);
174  Address dest;
175  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, hdr);
176  queue->Enqueue (item);
177 }
178 
179 void
181 {
182  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("4p"));
183 
184  queueDisc->SetQuantum (1500);
185  queueDisc->Initialize ();
186 
187  Ipv4Header hdr;
188  hdr.SetPayloadSize (100);
189  hdr.SetSource (Ipv4Address ("10.10.1.1"));
190  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
191  hdr.SetProtocol (7);
192 
193  // Add three packets from the first flow
194  AddPacket (queueDisc, hdr);
195  AddPacket (queueDisc, hdr);
196  AddPacket (queueDisc, hdr);
197  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 3, "unexpected number of packets in the queue disc");
198  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the flow queue");
199 
200  // Add two packets from the second flow
201  hdr.SetDestination (Ipv4Address ("10.10.1.7"));
202  // Add the first packet
203  AddPacket (queueDisc, hdr);
204  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 4, "unexpected number of packets in the queue disc");
205  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the flow queue");
206  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the flow queue");
207  // Add the second packet that causes two packets to be dropped from the fat flow (max backlog = 300, threshold = 150)
208  AddPacket (queueDisc, hdr);
209  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 3, "unexpected number of packets in the queue disc");
210  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the flow queue");
211  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the flow queue");
212 
213  Simulator::Destroy ();
214 }
215 
220 {
221 public:
223  virtual ~FqPieQueueDiscDeficit ();
224 
225 private:
226  virtual void DoRun (void);
227  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header hdr);
228 };
229 
231  : TestCase ("Test credits and flows status")
232 {}
233 
235 {}
236 
237 void
239 {
240  Ptr<Packet> p = Create<Packet> (100);
241  Address dest;
242  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, hdr);
243  queue->Enqueue (item);
244 }
245 
246 void
248 {
249  Ptr<FqPieQueueDisc> queueDisc = CreateObject<FqPieQueueDisc> ();
250 
251  queueDisc->SetQuantum (90);
252  queueDisc->Initialize ();
253 
254  Ipv4Header hdr;
255  hdr.SetPayloadSize (100);
256  hdr.SetSource (Ipv4Address ("10.10.1.1"));
257  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
258  hdr.SetProtocol (7);
259 
260  // Add a packet from the first flow
261  AddPacket (queueDisc, hdr);
262  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 1, "unexpected number of packets in the queue disc");
263  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the first flow queue");
264  Ptr<FqPieFlow> flow1 = StaticCast<FqPieFlow> (queueDisc->GetQueueDiscClass (0));
265  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), static_cast<int32_t> (queueDisc->GetQuantum ()), "the deficit of the first flow must equal the quantum");
266  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::NEW_FLOW, "the first flow must be in the list of new queues");
267  // Dequeue a packet
268  queueDisc->Dequeue ();
269  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 0, "unexpected number of packets in the queue disc");
270  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 0, "unexpected number of packets in the first flow queue");
271  // the deficit for the first flow becomes 90 - (100+20) = -30
272  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), -30, "unexpected deficit for the first flow");
273 
274  // Add two packets from the first flow
275  AddPacket (queueDisc, hdr);
276  AddPacket (queueDisc, hdr);
277  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 2, "unexpected number of packets in the queue disc");
278  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the first flow queue");
279  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::NEW_FLOW, "the first flow must still be in the list of new queues");
280 
281  // Add two packets from the second flow
282  hdr.SetDestination (Ipv4Address ("10.10.1.10"));
283  AddPacket (queueDisc, hdr);
284  AddPacket (queueDisc, hdr);
285  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 4, "unexpected number of packets in the queue disc");
286  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the first flow queue");
287  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the second flow queue");
288  Ptr<FqPieFlow> flow2 = StaticCast<FqPieFlow> (queueDisc->GetQueueDiscClass (1));
289  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), static_cast<int32_t> (queueDisc->GetQuantum ()), "the deficit of the second flow must equal the quantum");
290  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::NEW_FLOW, "the second flow must be in the list of new queues");
291 
292  // Dequeue a packet (from the second flow, as the first flow has a negative deficit)
293  queueDisc->Dequeue ();
294  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 3, "unexpected number of packets in the queue disc");
295  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the first flow queue");
296  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
297  // the first flow got a quantum of deficit (-30+90=60) and has been moved to the end of the list of old queues
298  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), 60, "unexpected deficit for the first flow");
299  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::OLD_FLOW, "the first flow must be in the list of old queues");
300  // the second flow has a negative deficit (-30) and is still in the list of new queues
301  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), -30, "unexpected deficit for the second flow");
302  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::NEW_FLOW, "the second flow must be in the list of new queues");
303 
304  // Dequeue a packet (from the first flow, as the second flow has a negative deficit)
305  queueDisc->Dequeue ();
306  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 2, "unexpected number of packets in the queue disc");
307  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the first flow queue");
308  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
309  // the first flow has a negative deficit (60-(100+20)= -60) and stays in the list of old queues
310  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), -60, "unexpected deficit for the first flow");
311  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::OLD_FLOW, "the first flow must be in the list of old queues");
312  // the second flow got a quantum of deficit (-30+90=60) and has been moved to the end of the list of old queues
313  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), 60, "unexpected deficit for the second flow");
314  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::OLD_FLOW, "the second flow must be in the list of new queues");
315 
316  // Dequeue a packet (from the second flow, as the first flow has a negative deficit)
317  queueDisc->Dequeue ();
318  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 1, "unexpected number of packets in the queue disc");
319  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the first flow queue");
320  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 0, "unexpected number of packets in the second flow queue");
321  // the first flow got a quantum of deficit (-60+90=30) and has been moved to the end of the list of old queues
322  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), 30, "unexpected deficit for the first flow");
323  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::OLD_FLOW, "the first flow must be in the list of old queues");
324  // the second flow has a negative deficit (60-(100+20)= -60)
325  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), -60, "unexpected deficit for the second flow");
326  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::OLD_FLOW, "the second flow must be in the list of new queues");
327 
328  // Dequeue a packet (from the first flow, as the second flow has a negative deficit)
329  queueDisc->Dequeue ();
330  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 0, "unexpected number of packets in the queue disc");
331  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 0, "unexpected number of packets in the first flow queue");
332  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 0, "unexpected number of packets in the second flow queue");
333  // the first flow has a negative deficit (30-(100+20)= -90)
334  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), -90, "unexpected deficit for the first flow");
335  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::OLD_FLOW, "the first flow must be in the list of old queues");
336  // the second flow got a quantum of deficit (-60+90=30) and has been moved to the end of the list of old queues
337  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), 30, "unexpected deficit for the second flow");
338  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::OLD_FLOW, "the second flow must be in the list of new queues");
339 
340  // Dequeue a packet
341  queueDisc->Dequeue ();
342  // the first flow is at the head of the list of old queues but has a negative deficit, thus it gets a quantun
343  // of deficit (-90+90=0) and is moved to the end of the list of old queues. Then, the second flow (which has a
344  // positive deficit) is selected, but the second flow is empty and thus it is set to inactive. The first flow is
345  // reconsidered, but it has a null deficit, hence it gets another quantum of deficit (0+90=90). Then, the first
346  // flow is reconsidered again, now it has a positive deficit and hence it is selected. But, it is empty and
347  // therefore is set to inactive, too.
348  NS_TEST_ASSERT_MSG_EQ (flow1->GetDeficit (), 90, "unexpected deficit for the first flow");
349  NS_TEST_ASSERT_MSG_EQ (flow1->GetStatus (), FqPieFlow::INACTIVE, "the first flow must be inactive");
350  NS_TEST_ASSERT_MSG_EQ (flow2->GetDeficit (), 30, "unexpected deficit for the second flow");
351  NS_TEST_ASSERT_MSG_EQ (flow2->GetStatus (), FqPieFlow::INACTIVE, "the second flow must be inactive");
352 
353  Simulator::Destroy ();
354 }
355 
360 {
361 public:
364 
365 private:
366  virtual void DoRun (void);
367  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header ipHdr, TcpHeader tcpHdr);
368 };
369 
371  : TestCase ("Test TCP flows separation")
372 {}
373 
375 {}
376 
377 void
379 {
380  Ptr<Packet> p = Create<Packet> (100);
381  p->AddHeader (tcpHdr);
382  Address dest;
383  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, ipHdr);
384  queue->Enqueue (item);
385 }
386 
387 void
389 {
390  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("10p"));
391 
392  queueDisc->SetQuantum (1500);
393  queueDisc->Initialize ();
394 
395  Ipv4Header hdr;
396  hdr.SetPayloadSize (100);
397  hdr.SetSource (Ipv4Address ("10.10.1.1"));
398  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
399  hdr.SetProtocol (6);
400 
401  TcpHeader tcpHdr;
402  tcpHdr.SetSourcePort (7);
403  tcpHdr.SetDestinationPort (27);
404 
405  // Add three packets from the first flow
406  AddPacket (queueDisc, hdr, tcpHdr);
407  AddPacket (queueDisc, hdr, tcpHdr);
408  AddPacket (queueDisc, hdr, tcpHdr);
409  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 3, "unexpected number of packets in the queue disc");
410  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
411 
412  // Add a packet from the second flow
413  tcpHdr.SetSourcePort (8);
414  AddPacket (queueDisc, hdr, tcpHdr);
415  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 4, "unexpected number of packets in the queue disc");
416  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
417  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
418 
419  // Add a packet from the third flow
420  tcpHdr.SetDestinationPort (28);
421  AddPacket (queueDisc, hdr, tcpHdr);
422  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 5, "unexpected number of packets in the queue disc");
423  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
424  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
425  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (2)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the third flow queue");
426 
427  // Add two packets from the fourth flow
428  tcpHdr.SetSourcePort (7);
429  AddPacket (queueDisc, hdr, tcpHdr);
430  AddPacket (queueDisc, hdr, tcpHdr);
431  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 7, "unexpected number of packets in the queue disc");
432  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
433  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
434  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (2)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the third flow queue");
435  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (3)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the third flow queue");
436 
437  Simulator::Destroy ();
438 }
439 
444 {
445 public:
448 
449 private:
450  virtual void DoRun (void);
451  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header ipHdr, UdpHeader udpHdr);
452 };
453 
455  : TestCase ("Test UDP flows separation")
456 {}
457 
459 {}
460 
461 void
463 {
464  Ptr<Packet> p = Create<Packet> (100);
465  p->AddHeader (udpHdr);
466  Address dest;
467  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, ipHdr);
468  queue->Enqueue (item);
469 }
470 
471 void
473 {
474  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("10p"));
475 
476  queueDisc->SetQuantum (1500);
477  queueDisc->Initialize ();
478 
479  Ipv4Header hdr;
480  hdr.SetPayloadSize (100);
481  hdr.SetSource (Ipv4Address ("10.10.1.1"));
482  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
483  hdr.SetProtocol (17);
484 
485  UdpHeader udpHdr;
486  udpHdr.SetSourcePort (7);
487  udpHdr.SetDestinationPort (27);
488 
489  // Add three packets from the first flow
490  AddPacket (queueDisc, hdr, udpHdr);
491  AddPacket (queueDisc, hdr, udpHdr);
492  AddPacket (queueDisc, hdr, udpHdr);
493  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 3, "unexpected number of packets in the queue disc");
494  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
495 
496  // Add a packet from the second flow
497  udpHdr.SetSourcePort (8);
498  AddPacket (queueDisc, hdr, udpHdr);
499  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 4, "unexpected number of packets in the queue disc");
500  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
501  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
502 
503  // Add a packet from the third flow
504  udpHdr.SetDestinationPort (28);
505  AddPacket (queueDisc, hdr, udpHdr);
506  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 5, "unexpected number of packets in the queue disc");
507  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
508  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
509  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (2)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the third flow queue");
510 
511  // Add two packets from the fourth flow
512  udpHdr.SetSourcePort (7);
513  AddPacket (queueDisc, hdr, udpHdr);
514  AddPacket (queueDisc, hdr, udpHdr);
515  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 7, "unexpected number of packets in the queue disc");
516  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3, "unexpected number of packets in the first flow queue");
517  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the second flow queue");
518  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (2)->GetQueueDisc ()->GetNPackets (), 1, "unexpected number of packets in the third flow queue");
519  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (3)->GetQueueDisc ()->GetNPackets (), 2, "unexpected number of packets in the third flow queue");
520 
521  Simulator::Destroy ();
522 }
523 
524 
525 /*
526  * This class tests linear probing, collision response, and set
527  * creation capability of set associative hashing in FqPIE.
528  * We modified DoClassify () and CheckProtocol () so that we could control
529  * the hash returned for each packet. In the beginning, we use flow hashes
530  * ranging from 0 to 7. These must go into different queues in the same set.
531  * The set number for these is obtained using outerhash, which is 0.
532  * When a new packet arrives with flow hash 1024, outerhash = 0 is obtained
533  * and the first set is iteratively searched.
534  * The packet is eventually added to queue 0 since the tags of queues
535  * in the set do not match with the hash of the flow. The tag of queue 0 is
536  * updated as 1024. When a packet with hash 1025 arrives, outerhash = 0
537  * is obtained and the first set is iteratively searched.
538  * Since there is no match, it is added to queue 0 and the tag of queue 0 is
539  * updated to 1025.
540  *
541  * The variable outerhash stores the nearest multiple of 8 that is lesser than
542  * the hash. When a flow hash of 20 arrives, the value of outerhash
543  * is 16. Since m_flowIndices[16] wasn't previously allotted, a new flow
544  * is created, and the tag corresponding to this queue is set to 20.
545 */
546 
548 {
549 public:
552 
553 private:
554  virtual void DoRun (void);
555  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header hdr);
556 };
557 
559  : TestCase ("Test credits and flows status")
560 {}
561 
563 {}
564 
565 void
567 {
568  Ptr<Packet> p = Create<Packet> (100);
569  Address dest;
570  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, hdr);
571  queue->Enqueue (item);
572 }
573 
574 void
576 {
577  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("EnableSetAssociativeHash", BooleanValue (true));
578  queueDisc->SetQuantum (90);
579  queueDisc->Initialize ();
580 
581  Ptr<Ipv4FqPieTestPacketFilter> filter = CreateObject<Ipv4FqPieTestPacketFilter> ();
582  queueDisc->AddPacketFilter (filter);
583 
584  Ipv4Header hdr;
585  hdr.SetPayloadSize (100);
586  hdr.SetSource (Ipv4Address ("10.10.1.1"));
587  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
588  hdr.SetProtocol (7);
589 
590  g_hash = 0;
591  AddPacket (queueDisc, hdr);
592  g_hash = 1;
593  AddPacket (queueDisc, hdr);
594  AddPacket (queueDisc, hdr);
595  g_hash = 2;
596  AddPacket (queueDisc, hdr);
597  g_hash = 3;
598  AddPacket (queueDisc, hdr);
599  g_hash = 4;
600  AddPacket (queueDisc, hdr);
601  AddPacket (queueDisc, hdr);
602  g_hash = 5;
603  AddPacket (queueDisc, hdr);
604  g_hash = 6;
605  AddPacket (queueDisc, hdr);
606  g_hash = 7;
607  AddPacket (queueDisc, hdr);
608  g_hash = 1024;
609  AddPacket (queueDisc, hdr);
610 
611  NS_TEST_ASSERT_MSG_EQ (queueDisc->QueueDisc::GetNPackets (), 11,
612  "unexpected number of packets in the queue disc");
613  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 2,
614  "unexpected number of packets in the first flow queue of set one");
615  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetNPackets (), 2,
616  "unexpected number of packets in the second flow queue of set one");
617  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (2)->GetQueueDisc ()->GetNPackets (), 1,
618  "unexpected number of packets in the third flow queue of set one");
619  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (3)->GetQueueDisc ()->GetNPackets (), 1,
620  "unexpected number of packets in the fourth flow queue of set one");
621  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (4)->GetQueueDisc ()->GetNPackets (), 2,
622  "unexpected number of packets in the fifth flow queue of set one");
623  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (5)->GetQueueDisc ()->GetNPackets (), 1,
624  "unexpected number of packets in the sixth flow queue of set one");
625  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (6)->GetQueueDisc ()->GetNPackets (), 1,
626  "unexpected number of packets in the seventh flow queue of set one");
627  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (7)->GetQueueDisc ()->GetNPackets (), 1,
628  "unexpected number of packets in the eighth flow queue of set one");
629  g_hash = 1025;
630  AddPacket (queueDisc, hdr);
631  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetNPackets (), 3,
632  "unexpected number of packets in the first flow of set one");
633  g_hash = 10;
634  AddPacket (queueDisc, hdr);
635  NS_TEST_ASSERT_MSG_EQ (queueDisc->GetQueueDiscClass (8)->GetQueueDisc ()->GetNPackets (), 1,
636  "unexpected number of packets in the first flow of set two");
637  Simulator::Destroy ();
638 }
639 
640 
653 {
654 public:
656  virtual ~FqPieQueueDiscL4sMode ();
657 
658 private:
659  virtual void DoRun (void);
660  void AddPacket (Ptr<FqPieQueueDisc> queue, Ipv4Header hdr, u_int32_t nPkt);
661  void AddPacketWithDelay (Ptr<FqPieQueueDisc> queue,Ipv4Header hdr, double delay, uint32_t nPkt);
662  void Dequeue (Ptr<FqPieQueueDisc> queue, uint32_t nPkt);
663  void DequeueWithDelay (Ptr<FqPieQueueDisc> queue, double delay, uint32_t nPkt);
664 };
665 
667  : TestCase ("Test L4S mode")
668 {}
669 
671 {}
672 
673 void
675 {
676  Address dest;
677  Ptr<Packet> p = Create<Packet> (100);
678  for (uint32_t i = 0; i < nPkt; i++)
679  {
680  Ptr<Ipv4QueueDiscItem> item = Create<Ipv4QueueDiscItem> (p, dest, 0, hdr);
681  queue->Enqueue (item);
682  }
683 }
684 
685 void
687 {
688  for (uint32_t i = 0; i < nPkt; i++)
689  {
690  Simulator::Schedule (Time (Seconds ((i + 1) * delay)), &FqPieQueueDiscL4sMode::AddPacket, this, queue, hdr, 1);
691  }
692 }
693 
694 void
696 {
697  for (uint32_t i = 0; i < nPkt; i++)
698  {
699  Ptr<QueueDiscItem> item = queue->Dequeue ();
700  }
701 }
702 
703 void
705 {
706  for (uint32_t i = 0; i < nPkt; i++)
707  {
708  Simulator::Schedule (Time (Seconds ((i + 1) * delay)), &FqPieQueueDiscL4sMode::Dequeue, this, queue, 1);
709  }
710 }
711 
712 void
714 {
715  // Test is divided into 2 sub test cases:
716  // 1) Without hash collisions
717  // 2) With hash collisions
718 
719  // Test case 1, Without hash collisions
720  Ptr<FqPieQueueDisc> queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("10240p"),
721  "UseEcn", BooleanValue (true), "Perturbation", UintegerValue (0),
722  "UseL4s", BooleanValue (true), "CeThreshold", TimeValue (MilliSeconds (2)));
723 
724  queueDisc->SetQuantum (1514);
725  queueDisc->Initialize ();
726  Ipv4Header hdr;
727  hdr.SetPayloadSize (100);
728  hdr.SetSource (Ipv4Address ("10.10.1.1"));
729  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
730  hdr.SetProtocol (7);
731  hdr.SetEcn (Ipv4Header::ECN_ECT1);
732 
733  // Add 70 ECT1 (ECN capable) packets from the first flow
734  // Set delay = 0.5ms
735  double delay = 0.0005;
736  Simulator::Schedule (Time (Seconds (0)), &FqPieQueueDiscL4sMode::AddPacketWithDelay, this, queueDisc, hdr, delay, 70);
737 
738  // Add 70 ECT0 (ECN capable) packets from second flow
739  hdr.SetEcn (Ipv4Header::ECN_ECT0);
740  hdr.SetDestination (Ipv4Address ("10.10.1.10"));
741  Simulator::Schedule (Time (Seconds (0)), &FqPieQueueDiscL4sMode::AddPacketWithDelay, this, queueDisc, hdr, delay, 70);
742 
743  //Dequeue 140 packets with delay 1ms
744  delay = 0.001;
745  DequeueWithDelay (queueDisc, delay, 140);
746  Simulator::Stop (Seconds (10.0));
747  Simulator::Run ();
748 
749  Ptr<PieQueueDisc> q0 = queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetObject <PieQueueDisc> ();
750  Ptr<PieQueueDisc> q1 = queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetObject <PieQueueDisc> ();
751 
752  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::CE_THRESHOLD_EXCEEDED_MARK), 66, "There should be 66 marked packets"
753  "4th packet is enqueued at 2ms and dequeued at 4ms hence the delay of 2ms which not greater than CE threshold"
754  "5th packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay"
755  "greater than CE threshold so all the packets after 4th packet are marked");
756  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "Queue delay is less than max burst allowance so"
757  "There should not be any dropped packets");
758  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be any marked packets");
759  NS_TEST_EXPECT_MSG_EQ (q1->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be marked packets.");
760  NS_TEST_EXPECT_MSG_EQ (q1->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "There should not be any dropped packets");
761 
762  Simulator::Destroy ();
763 
764  // Test case 2, With hash collisions
765  queueDisc = CreateObjectWithAttributes<FqPieQueueDisc> ("MaxSize", StringValue ("10240p"),
766  "UseEcn", BooleanValue (true), "Perturbation", UintegerValue (0),
767  "UseL4s", BooleanValue (true), "CeThreshold", TimeValue (MilliSeconds (2)));
768 
769  queueDisc->SetQuantum (1514);
770  queueDisc->Initialize ();
771  hdr.SetPayloadSize (100);
772  hdr.SetSource (Ipv4Address ("10.10.1.1"));
773  hdr.SetDestination (Ipv4Address ("10.10.1.2"));
774  hdr.SetProtocol (7);
775  hdr.SetEcn (Ipv4Header::ECN_ECT1);
776 
777  // Add 70 ECT1 (ECN capable) packets from the first flow
778  // Set delay = 1ms
779  delay = 0.001;
780  Simulator::Schedule (Time (Seconds (0.0005)), &FqPieQueueDiscL4sMode::AddPacket, this, queueDisc, hdr, 1);
781  Simulator::Schedule (Time (Seconds (0.0005)), &FqPieQueueDiscL4sMode::AddPacketWithDelay, this, queueDisc, hdr, delay, 69);
782 
783  // Add 70 ECT0 (ECN capable) packets from first flow
784  hdr.SetEcn (Ipv4Header::ECN_ECT0);
785  Simulator::Schedule (Time (Seconds (0)), &FqPieQueueDiscL4sMode::AddPacketWithDelay, this, queueDisc, hdr, delay, 70);
786 
787  //Dequeue 140 packets with delay 1ms
788  DequeueWithDelay (queueDisc, delay, 140);
789  Simulator::Stop (Seconds (1.0));
790  Simulator::Run ();
791  q0 = queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetObject <PieQueueDisc> ();
792  q0 = queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetObject <PieQueueDisc> ();
793 
794  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::CE_THRESHOLD_EXCEEDED_MARK), 68, "There should be 68 marked packets"
795  "2nd ECT1 packet is enqueued at 1.5ms and dequeued at 3ms hence the delay of 1.5ms which not greater than CE threshold"
796  "3rd packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay"
797  "greater than CE threshold so all the packets after 2nd packet are marked");
798  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "Queue delay is less than max burst allowance so"
799  "There should not be any dropped packets");
800  NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be any marked packets");
801 
802  Simulator::Destroy ();
803 }
804 
806 {
807 public:
809 };
810 
812  : TestSuite ("fq-pie-queue-disc", UNIT)
813 {
814  AddTestCase (new FqPieQueueDiscNoSuitableFilter, TestCase::QUICK);
816  AddTestCase (new FqPieQueueDiscDeficit, TestCase::QUICK);
817  AddTestCase (new FqPieQueueDiscTCPFlowsSeparation, TestCase::QUICK);
818  AddTestCase (new FqPieQueueDiscUDPFlowsSeparation, TestCase::QUICK);
819  AddTestCase (new FqPieQueueDiscSetLinearProbing, TestCase::QUICK);
820  AddTestCase (new FqPieQueueDiscL4sMode, TestCase::QUICK);
821 }
822 
void SetSource(Ipv4Address source)
Definition: ipv4-header.cc:285
void SetPayloadSize(uint16_t size)
Definition: ipv4-header.cc:56
void SetQuantum(uint32_t quantum)
Set the quantum value.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Packet header for IPv6.
Definition: ipv6-header.h:34
void SetDestination(Ipv4Address destination)
Definition: ipv4-header.cc:298
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
AttributeValue implementation for Boolean.
Definition: boolean.h:36
bool Enqueue(Ptr< QueueDiscItem > item)
Pass a packet to store to the queue discipline.
Definition: queue-disc.cc:861
Hold variables of type string.
Definition: string.h:41
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header hdr)
A suite of tests to run.
Definition: test.h:1343
This class tests the UDP flows separation.
void SetDestinationPort(uint16_t port)
Definition: udp-header.cc:55
virtual void DoRun(void)
Implementation to actually run this TestCase.
This class tests packets for which there is no suitable filter.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Definition: test.h:283
void SetSourcePort(uint16_t port)
Definition: udp-header.cc:60
virtual int32_t DoClassify(Ptr< QueueDiscItem > item) const
Classify a packet.
Implements PIE Active Queue Management discipline.
void SetProtocol(uint8_t num)
Definition: ipv4-header.cc:278
encapsulates test code
Definition: test.h:1153
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoRun(void)
Implementation to actually run this TestCase.
a polymophic address class
Definition: address.h:90
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header ipHdr, UdpHeader udpHdr)
virtual void DoRun(void)
Implementation to actually run this TestCase.
Packet header for IPv4.
Definition: ipv4-header.h:33
uint32_t GetQuantum(void) const
Get the quantum value.
void Dequeue(Ptr< FqPieQueueDisc > queue, uint32_t nPkt)
AttributeValue implementation for Time.
Definition: nstime.h:1353
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
virtual void DoRun(void)
Implementation to actually run this TestCase.
Hold an unsigned integer type.
Definition: uinteger.h:44
uint32_t GetNDroppedPackets(std::string reason) const
Get the number of packets dropped for the given reason.
Definition: queue-disc.cc:110
#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.
Definition: test.h:166
const Stats & GetStats(void)
Retrieve all the collected statistics.
Definition: queue-disc.cc:421
static FqPieQueueDiscTestSuite FqPieQueueDiscTestSuite
Ptr< QueueDiscClass > GetQueueDiscClass(std::size_t i) const
Get the i-th queue disc class.
Definition: queue-disc.cc:662
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header hdr, u_int32_t nPkt)
This class tests the IP flows separation and the packet limit.
void SetDestinationPort(uint16_t port)
Set the destination port.
Definition: tcp-header.cc:95
Ptr< QueueDiscItem > Dequeue(void)
Extract from the queue disc the packet that has been dequeued by calling Peek, if any...
Definition: queue-disc.cc:896
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::size_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
Definition: queue-disc.cc:669
This class tests the deficit per flow.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:44
This class tests L4S mode.
void SetSourcePort(uint16_t port)
Set the source port.
Definition: tcp-header.cc:89
uint32_t GetNMarkedPackets(std::string reason) const
Get the number of packets marked for the given reason.
Definition: queue-disc.cc:152
Packet header for UDP packets.
Definition: udp-header.h:39
virtual void DoRun(void)
Implementation to actually run this TestCase.
Simple test packet filter able to classify IPv4 packets.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
void DequeueWithDelay(Ptr< FqPieQueueDisc > queue, double delay, uint32_t nPkt)
void SetEcn(EcnType ecn)
Set ECN Field.
Definition: ipv4-header.cc:97
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header hdr)
Ipv4PacketFilter is the abstract base class for filters defined for IPv4 packets. ...
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
This class tests the TCP flows separation.
void AddPacketFilter(Ptr< PacketFilter > filter)
Add a packet filter to the tail of the list of filters used to classify packets.
Definition: queue-disc.cc:614
void AddPacketWithDelay(Ptr< FqPieQueueDisc > queue, Ipv4Header hdr, double delay, uint32_t nPkt)
virtual bool CheckProtocol(Ptr< QueueDiscItem > item) const
Checks if the filter is able to classify a kind of items.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header ipHdr, TcpHeader tcpHdr)
void AddPacket(Ptr< FqPieQueueDisc > queue, Ipv4Header hdr)
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
Inactive Period or unslotted CSMA-CA.
Definition: lr-wpan-mac.h:93
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
virtual void DoRun(void)
Implementation to actually run this TestCase.