A Discrete-Event Network Simulator
API
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 NITK Surathkal
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Shravya Ks <shravya.ks0@gmail.com>
19  * Smriti Murali <m.smriti.95@gmail.com>
20  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
21  *
22  */
23 
24 #include "ns3/core-module.h"
25 #include "ns3/network-module.h"
26 #include "ns3/internet-module.h"
27 #include "ns3/point-to-point-module.h"
28 #include "ns3/applications-module.h"
29 #include "ns3/traffic-control-module.h"
30 
31 using namespace ns3;
32 
34 {
35 public:
36  PieQueueDiscTestItem (Ptr<Packet> p, const Address & addr, uint16_t protocol);
37  virtual ~PieQueueDiscTestItem ();
38  virtual void AddHeader (void);
39 
40 private:
43  PieQueueDiscTestItem &operator = (const PieQueueDiscTestItem &);
44 };
45 
47  : QueueDiscItem (p, addr, protocol)
48 {
49 }
50 
52 {
53 }
54 
55 void
57 {
58 }
59 
61 {
62 public:
64  virtual void DoRun (void);
65 private:
66  void Enqueue (Ptr<PieQueueDisc> queue, uint32_t size, uint32_t nPkt);
67  void RunPieTest (StringValue mode);
68 };
69 
71  : TestCase ("Sanity check on the pie queue implementation")
72 {
73 }
74 
75 void
77 {
78  uint32_t pktSize = 0;
79  // 1 for packets; pktSize for bytes
80  uint32_t modeSize = 1;
81  uint32_t qSize = 8;
82  Ptr<PieQueueDisc> queue = CreateObject<PieQueueDisc> ();
83 
84  // test 1: simple enqueue/dequeue with no drops
85  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Mode", mode), true,
86  "Verify that we can actually set the attribute Mode");
87  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("QueueLimit", UintegerValue (qSize)), true,
88  "Verify that we can actually set the attribute QueueLimit");
89  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("A", DoubleValue (0.125)), true,
90  "Verify that we can actually set the attribute A");
91  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("B", DoubleValue (1.25)), true,
92  "Verify that we can actually set the attribute B");
93  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Tupdate", TimeValue (Seconds (0.03))), true,
94  "Verify that we can actually set the attribute Tupdate");
95  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Supdate", TimeValue (Seconds (0.0))), true,
96  "Verify that we can actually set the attribute Supdate");
97  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("DequeueThreshold", UintegerValue (10000)), true,
98  "Verify that we can actually set the attribute DequeueThreshold");
99  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("QueueDelayReference", TimeValue (Seconds (0.02))), true,
100  "Verify that we can actually set the attribute QueueDelayReference");
101  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MaxBurstAllowance", TimeValue (Seconds (0.1))), true,
102  "Verify that we can actually set the attribute MaxBurstAllowance");
103 
104  Address dest;
105 
106  if (queue->GetMode () == Queue::QUEUE_MODE_BYTES)
107  {
108  pktSize = 1000;
109  modeSize = pktSize;
110  queue->SetQueueLimit (qSize * modeSize);
111  }
112 
113  Ptr<Packet> p1, p2, p3, p4, p5, p6, p7, p8;
114  p1 = Create<Packet> (pktSize);
115  p2 = Create<Packet> (pktSize);
116  p3 = Create<Packet> (pktSize);
117  p4 = Create<Packet> (pktSize);
118  p5 = Create<Packet> (pktSize);
119  p6 = Create<Packet> (pktSize);
120  p7 = Create<Packet> (pktSize);
121  p8 = Create<Packet> (pktSize);
122 
123  queue->Initialize ();
124  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 0 * modeSize, "There should be no packets in there");
125  queue->Enqueue (Create<PieQueueDiscTestItem> (p1, dest, 0));
126  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 1 * modeSize, "There should be one packet in there");
127  queue->Enqueue (Create<PieQueueDiscTestItem> (p2, dest, 0));
128  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 2 * modeSize, "There should be two packets in there");
129  queue->Enqueue (Create<PieQueueDiscTestItem> (p3, dest, 0));
130  queue->Enqueue (Create<PieQueueDiscTestItem> (p4, dest, 0));
131  queue->Enqueue (Create<PieQueueDiscTestItem> (p5, dest, 0));
132  queue->Enqueue (Create<PieQueueDiscTestItem> (p6, dest, 0));
133  queue->Enqueue (Create<PieQueueDiscTestItem> (p7, dest, 0));
134  queue->Enqueue (Create<PieQueueDiscTestItem> (p8, dest, 0));
135  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 8 * modeSize, "There should be eight packets in there");
136 
137  Ptr<QueueDiscItem> item;
138 
139  item = queue->Dequeue ();
140  NS_TEST_EXPECT_MSG_EQ ((item != 0), true, "I want to remove the first packet");
141  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 7 * modeSize, "There should be seven packets in there");
142  NS_TEST_EXPECT_MSG_EQ (item->GetPacket ()->GetUid (), p1->GetUid (), "was this the first packet ?");
143 
144  item = queue->Dequeue ();
145  NS_TEST_EXPECT_MSG_EQ ((item != 0), true, "I want to remove the second packet");
146  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 6 * modeSize, "There should be six packet in there");
147  NS_TEST_EXPECT_MSG_EQ (item->GetPacket ()->GetUid (), p2->GetUid (), "Was this the second packet ?");
148 
149  item = queue->Dequeue ();
150  NS_TEST_EXPECT_MSG_EQ ((item != 0), true, "I want to remove the third packet");
151  NS_TEST_EXPECT_MSG_EQ (queue->GetQueueSize (), 5 * modeSize, "There should be five packets in there");
152  NS_TEST_EXPECT_MSG_EQ (item->GetPacket ()->GetUid (), p3->GetUid (), "Was this the third packet ?");
153 
154  item = queue->Dequeue ();
155  item = queue->Dequeue ();
156  item = queue->Dequeue ();
157  item = queue->Dequeue ();
158  item = queue->Dequeue ();
159 
160  item = queue->Dequeue ();
161  NS_TEST_EXPECT_MSG_EQ ((item == 0), true, "There are really no packets in there");
162 
163  // test 2: test in a simple dumbbell topology
164  pktSize = 1000;
165  std::string pieLinkDataRate = "1.5Mbps";
166  std::string pieLinkDelay = "20ms";
167 
168  double global_start_time = 0.0;
169  double global_stop_time = 7.0;
171  double sink_stop_time = global_stop_time + 3.0;
172  double client_start_time = global_start_time + 1.5;
173  double client_stop_time = global_stop_time - 2.0;
174 
180 
186 
187  NodeContainer c;
188  c.Create (6);
189  n0n2 = NodeContainer (c.Get (0), c.Get (2));
190  n1n2 = NodeContainer (c.Get (1), c.Get (2));
191  n2n3 = NodeContainer (c.Get (2), c.Get (3));
192  n3n4 = NodeContainer (c.Get (3), c.Get (4));
193  n3n5 = NodeContainer (c.Get (3), c.Get (5));
194 
195  Config::SetDefault ("ns3::TcpL4Protocol::SocketType", StringValue ("ns3::TcpNewReno"));
196  // 42 = headers size
197  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000 - 42));
198  Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
199  GlobalValue::Bind ("ChecksumEnabled", BooleanValue (false));
200 
201  uint32_t meanPktSize = 1000;
202 
203  NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Mode", mode), true,
204  "Verify that we can actually set the attribute Mode");
205 
206  Ipv4Header ipHeader;
207 
208  if (queue->GetMode () == Queue::QUEUE_MODE_BYTES)
209  {
210  modeSize = pktSize + ipHeader.GetSerializedSize ();
211  }
212 
213  qSize = 100 * modeSize;
214 
215  // PIE params
216  Config::SetDefault ("ns3::PieQueueDisc::Mode", StringValue (mode));
217  Config::SetDefault ("ns3::PieQueueDisc::MeanPktSize", UintegerValue (meanPktSize + ipHeader.GetSerializedSize ()));
218  Config::SetDefault ("ns3::PieQueueDisc::DequeueThreshold", UintegerValue (10000));
219  Config::SetDefault ("ns3::PieQueueDisc::QueueDelayReference", TimeValue (Seconds (0.02)));
220  Config::SetDefault ("ns3::PieQueueDisc::MaxBurstAllowance", TimeValue (Seconds (0.1)));
221  Config::SetDefault ("ns3::PieQueueDisc::QueueLimit", UintegerValue (qSize));
222 
223  InternetStackHelper internet;
224  internet.Install (c);
225 
226  TrafficControlHelper tchPfifo;
227  uint16_t handle = tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
228  tchPfifo.AddInternalQueues (handle, 3, "ns3::DropTailQueue", "MaxPackets", UintegerValue (1000));
229 
230  TrafficControlHelper tchPie;
231  tchPie.SetRootQueueDisc ("ns3::PieQueueDisc");
232 
233  PointToPointHelper p2p;
234 
235  NetDeviceContainer devn0n2;
236  NetDeviceContainer devn1n2;
237  NetDeviceContainer devn2n3;
238  NetDeviceContainer devn3n4;
239  NetDeviceContainer devn3n5;
240 
241  QueueDiscContainer queueDiscs;
242 
243  p2p.SetQueue ("ns3::DropTailQueue");
244  p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
245  p2p.SetChannelAttribute ("Delay", StringValue ("2ms"));
246  devn0n2 = p2p.Install (n0n2);
247  tchPfifo.Install (devn0n2);
248 
249  p2p.SetQueue ("ns3::DropTailQueue");
250  p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
251  p2p.SetChannelAttribute ("Delay", StringValue ("3ms"));
252  devn1n2 = p2p.Install (n1n2);
253  tchPfifo.Install (devn1n2);
254 
255  p2p.SetQueue ("ns3::DropTailQueue");
256  p2p.SetDeviceAttribute ("DataRate", StringValue (pieLinkDataRate));
257  p2p.SetChannelAttribute ("Delay", StringValue (pieLinkDelay));
258  devn2n3 = p2p.Install (n2n3);
259  // only backbone link has PIE queue disc
260  queueDiscs = tchPie.Install (devn2n3);
261 
262  p2p.SetQueue ("ns3::DropTailQueue");
263  p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
264  p2p.SetChannelAttribute ("Delay", StringValue ("4ms"));
265  devn3n4 = p2p.Install (n3n4);
266  tchPfifo.Install (devn3n4);
267 
268  p2p.SetQueue ("ns3::DropTailQueue");
269  p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
270  p2p.SetChannelAttribute ("Delay", StringValue ("5ms"));
271  devn3n5 = p2p.Install (n3n5);
272  tchPfifo.Install (devn3n5);
273 
274  Ipv4AddressHelper ipv4;
275  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
276  i0i2 = ipv4.Assign (devn0n2);
277  ipv4.SetBase ("10.1.2.0", "255.255.255.0");
278  i1i2 = ipv4.Assign (devn1n2);
279  ipv4.SetBase ("10.1.3.0", "255.255.255.0");
280  i2i3 = ipv4.Assign (devn2n3);
281  ipv4.SetBase ("10.1.4.0", "255.255.255.0");
282  i3i4 = ipv4.Assign (devn3n4);
283  ipv4.SetBase ("10.1.5.0", "255.255.255.0");
284  i3i5 = ipv4.Assign (devn3n5);
285 
286  // Set up the routing
287  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
288 
289  // SINK is in the right side
290  uint16_t port = 50000;
291  Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
292  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
293  ApplicationContainer sinkApp = sinkHelper.Install (n3n4.Get (1));
294  sinkApp.Start (Seconds (sink_start_time));
295  sinkApp.Stop (Seconds (sink_stop_time));
296 
297  // Connection one
298  // Clients are in left side
299  /*
300  * Create the OnOff applications to send TCP to the server
301  * onoffhelper is a client that send data to TCP destination
302  */
303  OnOffHelper clientHelper1 ("ns3::TcpSocketFactory", Address ());
304  clientHelper1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
305  clientHelper1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
306  clientHelper1.SetAttribute ("PacketSize", UintegerValue (pktSize));
307  clientHelper1.SetAttribute ("DataRate", DataRateValue (DataRate ("100Mbps")));
308 
309  // Connection two
310  OnOffHelper clientHelper2 ("ns3::TcpSocketFactory", Address ());
311  clientHelper2.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
312  clientHelper2.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
313  clientHelper2.SetAttribute ("PacketSize", UintegerValue (pktSize));
314  clientHelper2.SetAttribute ("DataRate", DataRateValue (DataRate ("100Mbps")));
315 
316  ApplicationContainer clientApps1;
317  AddressValue remoteAddress (InetSocketAddress (i3i4.GetAddress (1), port));
318  clientHelper1.SetAttribute ("Remote", remoteAddress);
319  clientApps1.Add (clientHelper1.Install (n0n2.Get (0)));
320  clientApps1.Start (Seconds (client_start_time));
321  clientApps1.Stop (Seconds (client_stop_time));
322 
323  ApplicationContainer clientApps2;
324  clientHelper2.SetAttribute ("Remote", remoteAddress);
325  clientApps2.Add (clientHelper2.Install (n1n2.Get (0)));
326  clientApps2.Start (Seconds (client_start_time));
327  clientApps2.Stop (Seconds (client_stop_time));
328 
329  Simulator::Stop (Seconds (sink_stop_time));
330  Simulator::Run ();
331 
332  PieQueueDisc::Stats st = StaticCast<PieQueueDisc> (queueDiscs.Get (0))->GetStats ();
333 
334  NS_TEST_EXPECT_MSG_NE (st.unforcedDrop, 0, "There should be some packets dropped due to prob mark");
335  NS_TEST_EXPECT_MSG_EQ (st.forcedDrop, 0, "There should be zero packets dropped due to queue limit");
336 
337  Simulator::Destroy ();
338 }
339 
340 void
342 {
343  RunPieTest (StringValue ("QUEUE_MODE_PACKETS"));
344  RunPieTest (StringValue ("QUEUE_MODE_BYTES"));
345  Simulator::Destroy ();
346 }
347 
348 static class PieQueueDiscTestSuite : public TestSuite
349 {
350 public:
352  : TestSuite ("pie-queue-disc", UNIT)
353  {
354  AddTestCase (new PieQueueDiscTestCase (), TestCase::QUICK);
355  }
holds a vector of ns3::Application pointers.
an Inet address class
AttributeValue implementation for Boolean.
Definition: boolean.h:34
QueueDiscContainer Install(NetDeviceContainer c)
bool Enqueue(Ptr< QueueDiscItem > item)
Pass a packet to store to the queue discipline.
Definition: queue-disc.cc:451
holds a vector of std::pair of Ptr and interface index.
uint32_t unforcedDrop
Early probability drops: proactive.
Hold variables of type string.
Definition: string.h:41
NodeContainer n3n5
NetDeviceContainer Install(NodeContainer c)
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
void RunPieTest(StringValue mode)
Ipv4InterfaceContainer i3i5
A suite of tests to run.
Definition: test.h:1333
void SetQueue(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue())
Each point to point net device must have a queue to pass packets through.
Ipv4InterfaceContainer i1i2
uint64_t GetUid(void) const
Returns the packet's Uid.
Definition: packet.cc:368
Ipv4InterfaceContainer i3i4
aggregate IP/TCP/UDP functionality to existing Nodes.
#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:278
bool SetAttributeFailSafe(std::string name, const AttributeValue &value)
Set a single attribute without raising errors.
Definition: object-base.cc:211
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
QueueDiscItem is the abstract base class for items that are stored in a queue disc.
Definition: queue-disc.h:43
Build a set of PointToPointNetDevice objects.
encapsulates test code
Definition: test.h:1147
This test suite implements a Unit Test.
Definition: test.h:1343
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:42
Queue::QueueMode GetMode(void)
Get the encapsulation mode of this queue.
void SetQueueLimit(uint32_t lim)
Set the limit of the queue in bytes or packets.
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:90
NodeContainer n3n4
Holds a vector of ns3::QueueDisc pointers.
Class for representing data rates.
Definition: data-rate.h:88
Packet header for IPv4.
Definition: ipv4-header.h:33
double client_start_time
Ptr< QueueDisc > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
double sink_stop_time
virtual void DoRun(void)
Implementation to actually run this TestCase.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Definition: test.cc:298
uint32_t forcedDrop
Drops due to queue limit: reactive.
AttributeValue implementation for Time.
Definition: nstime.h:957
Hold an unsigned integer type.
Definition: uinteger.h:44
holds a vector of ns3::NetDevice pointers
virtual void AddHeader(void)
Add the header to the packet.
Build a set of QueueDisc objects.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Ptr< QueueDiscItem > Dequeue(void)
Request the queue discipline to extract a packet.
Definition: queue-disc.cc:467
double sink_start_time
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
uint16_t SetRootQueueDisc(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to set a root queue disc of the given type and with the given attributes...
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
uint32_t GetQueueSize(void)
Get the current value of the queue in bytes or packets.
#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report if not.
Definition: test.h:732
NodeContainer n2n3
Ipv4InterfaceContainer i0i2
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
double client_stop_time
double global_start_time
AttributeValue implementation for Address.
Definition: address.h:278
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
void AddInternalQueues(uint16_t handle, uint16_t count, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add the given number of internal queues (of the given type and with the given...
AttributeValue implementation for DataRate.
Definition: data-rate.h:242
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:774
PieQueueDiscTestSuite g_pieQueueTestSuite
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
NodeContainer n0n2
void Enqueue(Ptr< PieQueueDisc > queue, uint32_t size, uint32_t nPkt)
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
double global_stop_time
virtual uint32_t GetSerializedSize(void) const
Definition: ipv4-header.cc:375
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
NodeContainer n1n2
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Ipv4InterfaceContainer i2i3
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const