A Discrete-Event Network Simulator
API
nix-test.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2021 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  * Author: Ameya Deshpande <ameyanrd@outlook.com>
19  */
20 
21 #include "ns3/test.h"
22 #include "ns3/socket-factory.h"
23 #include "ns3/udp-socket-factory.h"
24 #include "ns3/simulator.h"
25 #include "ns3/socket.h"
26 
27 #include "ns3/internet-stack-helper.h"
28 #include "ns3/ipv4-address-helper.h"
29 #include "ns3/ipv4-l3-protocol.h"
30 #include "ns3/icmpv4-l4-protocol.h"
31 #include "ns3/ipv6-address-helper.h"
32 #include "ns3/ipv6-l3-protocol.h"
33 #include "ns3/icmpv6-l4-protocol.h"
34 #include "ns3/udp-l4-protocol.h"
35 #include "ns3/simple-net-device-helper.h"
36 #include "ns3/nix-vector-helper.h"
37 
38 using namespace ns3;
67 {
69 
75  void DoSendDatav4 (Ptr<Socket> socket, Ipv4Address to);
76 
82  void DoSendDatav6 (Ptr<Socket> socket, Ipv6Address to);
83 
90  void SendData (Time delay, Ptr<Socket> socket, Ipv4Address to);
91 
98  void SendData (Time delay, Ptr<Socket> socket, Ipv6Address to);
99 
100 public:
101  virtual void DoRun (void);
103 
108  void ReceivePkt (Ptr<Socket> socket);
109 
110  std::vector<uint32_t> m_receivedPacketSizes;
111 };
112 
114  : TestCase ("three router, two path test")
115 {
116 }
117 
119 {
120  uint32_t availableData;
121  availableData = socket->GetRxAvailable ();
123  NS_TEST_ASSERT_MSG_EQ (availableData, m_receivedPacket->GetSize (),
124  "availableData should be equal to the size of packet received.");
125  NS_UNUSED (availableData);
127 }
128 
129 void
131 {
132  Address realTo = InetSocketAddress (to, 1234);
133  socket->SendTo (Create<Packet> (123), 0, realTo);
134 }
135 
136 void
138 {
139  Address realTo = Inet6SocketAddress (to, 1234);
140  socket->SendTo (Create<Packet> (123), 0, realTo);
141 }
142 
143 void
145 {
146  m_receivedPacket = Create<Packet> ();
147  Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), delay,
148  &NixVectorRoutingTest::DoSendDatav4, this, socket, to);
149 }
150 
151 void
153 {
154  m_receivedPacket = Create<Packet> ();
155  Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), delay,
156  &NixVectorRoutingTest::DoSendDatav6, this, socket, to);
157 }
158 
159 void
161 {
162  // Create topology
163  NodeContainer nSrcnA;
164  NodeContainer nAnB;
165  NodeContainer nBnC;
166  NodeContainer nCnDst;
167  NodeContainer nAnC;
168 
169  nSrcnA.Create (2);
170 
171  nAnB.Add (nSrcnA.Get (1));
172  nAnB.Create (1);
173 
174  nBnC.Add (nAnB.Get (1));
175  nBnC.Create (1);
176 
177  nCnDst.Add (nBnC.Get (1));
178  nCnDst.Create (1);
179 
180  nAnC.Add (nAnB.Get (0));
181  nAnC.Add (nCnDst.Get (0));
182 
183  SimpleNetDeviceHelper devHelper;
184  devHelper.SetNetDevicePointToPointMode (true);
185 
186  NodeContainer allNodes = NodeContainer (nSrcnA, nBnC, nCnDst.Get (1));
187 
188  std::ostringstream stringStream1v4;
189  Ptr<OutputStreamWrapper> routingStream1v4 = Create<OutputStreamWrapper> (&stringStream1v4);
190  std::ostringstream stringStream1v6;
191  Ptr<OutputStreamWrapper> routingStream1v6 = Create<OutputStreamWrapper> (&stringStream1v6);
192  std::ostringstream stringStream2v4;
193  Ptr<OutputStreamWrapper> cacheStreamv4 = Create<OutputStreamWrapper> (&stringStream2v4);
194  std::ostringstream stringStream2v6;
195  Ptr<OutputStreamWrapper> cacheStreamv6 = Create<OutputStreamWrapper> (&stringStream2v6);
196  std::ostringstream stringStream3v4;
197  Ptr<OutputStreamWrapper> routingStream3v4 = Create<OutputStreamWrapper> (&stringStream3v4);
198  std::ostringstream stringStream3v6;
199  Ptr<OutputStreamWrapper> routingStream3v6 = Create<OutputStreamWrapper> (&stringStream3v6);
200 
201  // NixHelper to install nix-vector routing on all nodes
202  Ipv4NixVectorHelper ipv4NixRouting;
203  Ipv6NixVectorHelper ipv6NixRouting;
205  stack.SetRoutingHelper (ipv4NixRouting); // has effect on the next Install ()
206  stack.SetRoutingHelper (ipv6NixRouting); // has effect on the next Install ()
207  stack.Install (allNodes);
208 
209  NetDeviceContainer dSrcdA;
210  NetDeviceContainer dAdB;
211  NetDeviceContainer dBdC;
212  NetDeviceContainer dCdDst;
213  NetDeviceContainer dAdC;
214  dSrcdA = devHelper.Install (nSrcnA);
215  dAdB = devHelper.Install (nAnB);
216  dBdC = devHelper.Install (nBnC);
217  dCdDst = devHelper.Install (nCnDst);
218  dAdC = devHelper.Install (nAnC);
219 
220  Ipv4AddressHelper aSrcaAv4;
221  aSrcaAv4.SetBase ("10.1.0.0", "255.255.255.0");
222  Ipv4AddressHelper aAaBv4;
223  aAaBv4.SetBase ("10.1.1.0", "255.255.255.0");
224  Ipv4AddressHelper aBaCv4;
225  aBaCv4.SetBase ("10.1.2.0", "255.255.255.0");
226  Ipv4AddressHelper aCaDstv4;
227  aCaDstv4.SetBase ("10.1.3.0", "255.255.255.0");
228  Ipv4AddressHelper aAaCv4;
229  aAaCv4.SetBase ("10.1.4.0", "255.255.255.0");
230 
231  Ipv6AddressHelper aSrcaAv6;
232  aSrcaAv6.SetBase (Ipv6Address ("2001:0::"), Ipv6Prefix (64));
233  Ipv6AddressHelper aAaBv6;
234  aAaBv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
235  Ipv6AddressHelper aBaCv6;
236  aBaCv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
237  Ipv6AddressHelper aCaDstv6;
238  aCaDstv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
239  Ipv6AddressHelper aAaCv6;
240  aAaCv6.SetBase (Ipv6Address ("2001:4::"), Ipv6Prefix (64));
241 
242  aSrcaAv4.Assign (dSrcdA);
243  aAaBv4.Assign (dAdB);
244  aBaCv4.Assign (dBdC);
245  Ipv4InterfaceContainer iCiDstv4 = aCaDstv4.Assign (dCdDst);
246  Ipv4InterfaceContainer iAiCv4 = aAaCv4.Assign (dAdC);
247 
248  aSrcaAv6.Assign (dSrcdA);
249  aAaBv6.Assign (dAdB);
250  aBaCv6.Assign (dBdC);
251  Ipv6InterfaceContainer iCiDstv6 = aCaDstv6.Assign (dCdDst);
252  Ipv6InterfaceContainer iAiCv6 = aAaCv6.Assign (dAdC);
253 
254  // Create the UDP sockets
255  Ptr<SocketFactory> rxSocketFactory = nCnDst.Get (1)->GetObject<UdpSocketFactory> ();
256  Ptr<Socket> rxSocketv4 = rxSocketFactory->CreateSocket ();
257  Ptr<Socket> rxSocketv6 = rxSocketFactory->CreateSocket ();
258  NS_TEST_EXPECT_MSG_EQ (rxSocketv4->Bind (InetSocketAddress (iCiDstv4.GetAddress (1), 1234)), 0, "trivial");
259  NS_TEST_EXPECT_MSG_EQ (rxSocketv6->Bind (Inet6SocketAddress (iCiDstv6.GetAddress (1, 1), 1234)), 0, "trivial");
260  rxSocketv4->SetRecvCallback (MakeCallback (&NixVectorRoutingTest::ReceivePkt, this));
262 
263  Ptr<SocketFactory> txSocketFactory = nSrcnA.Get (0)->GetObject<UdpSocketFactory> ();
264  Ptr<Socket> txSocket = txSocketFactory->CreateSocket ();
265  txSocket->SetAllowBroadcast (true);
266 
267  SendData (Seconds (2), txSocket, Ipv4Address ("10.1.3.2"));
268  SendData (Seconds (2), txSocket, Ipv6Address ("2001:3::200:ff:fe00:8"));
269 
270  ipv4NixRouting.PrintRoutingPathAt (Seconds (3), nSrcnA.Get (0), iCiDstv4.GetAddress (1), routingStream1v4);
271  ipv6NixRouting.PrintRoutingPathAt (Seconds (3), nSrcnA.Get (0), iCiDstv6.GetAddress (1, 1), routingStream1v6);
272 
273  // Set the IPv4 nA interface on nA - nC channel down.
274  Ptr<Ipv4> ipv4 = nAnC.Get (0)->GetObject<Ipv4> ();
275  int32_t ifIndex = ipv4->GetInterfaceForDevice (dAdC.Get (0));
276  Simulator::Schedule (Seconds (5), &Ipv4::SetDown, ipv4, ifIndex);
277 
278  // Set the IPv6 nA interface on nA - nC channel down.
279  Ptr<Ipv6> ipv6 = nAnC.Get (0)->GetObject<Ipv6> ();
280  ifIndex = ipv6->GetInterfaceForDevice (dAdC.Get (0));
281  Simulator::Schedule (Seconds (5), &Ipv6::SetDown, ipv6, ifIndex);
282 
283  ipv4NixRouting.PrintRoutingTableAllAt (Seconds (7), cacheStreamv4);
284  ipv6NixRouting.PrintRoutingTableAllAt (Seconds (7), cacheStreamv6);
285 
286  SendData (Seconds (8), txSocket, Ipv4Address ("10.1.3.2"));
287  SendData (Seconds (8), txSocket, Ipv6Address ("2001:3::200:ff:fe00:8"));
288 
289  ipv4NixRouting.PrintRoutingPathAt (Seconds (9), nSrcnA.Get (0), iCiDstv4.GetAddress (1), routingStream3v4);
290  ipv6NixRouting.PrintRoutingPathAt (Seconds (9), nSrcnA.Get (0), iCiDstv6.GetAddress (1, 1), routingStream3v6);
291 
292  // Set the IPv4 nC interface on nB - nC channel down.
293  ipv4 = nBnC.Get (1)->GetObject<Ipv4> ();
294  ifIndex = ipv4->GetInterfaceForDevice (dBdC.Get (1));
295  Simulator::Schedule (Seconds (10), &Ipv4::SetDown, ipv4, ifIndex);
296 
297  // Set the IPv6 nC interface on nB - nC channel down.
298  ipv6 = nBnC.Get (1)->GetObject<Ipv6> ();
299  ifIndex = ipv6->GetInterfaceForDevice (dBdC.Get (1));
300  Simulator::Schedule (Seconds (10), &Ipv6::SetDown, ipv6, ifIndex);
301 
302  SendData (Seconds (11), txSocket, Ipv4Address ("10.1.3.2"));
303  SendData (Seconds (11), txSocket, Ipv6Address ("2001:3::200:ff:fe00:8"));
304 
305  Simulator::Stop (Seconds (66));
306  Simulator::Run ();
307 
308  // ------ Now the tests ------------
309 
310  // Test the Routing
311  NS_TEST_EXPECT_MSG_EQ (m_receivedPacketSizes[0], 123, "IPv4 Nix-Vector Routing should work.");
312  NS_TEST_EXPECT_MSG_EQ (m_receivedPacketSizes[1], 123, "IPv6 Nix-Vector Routing should work.");
313  NS_TEST_EXPECT_MSG_EQ (m_receivedPacketSizes.size (), 4, "IPv4 and IPv6 Nix-Vector Routing should have received only 1 packet.");
314 
315  // Test the Path
316  const std::string p_nSrcnAnCnDstv4 = "Time: +3s, Nix Routing\n"
317  "Route Path: (Node 0 to Node 4, Nix Vector: 01001)\n"
318  "10.1.0.1 (Node 0) ----> 10.1.0.2 (Node 1)\n"
319  "10.1.4.1 (Node 1) ----> 10.1.4.2 (Node 3)\n"
320  "10.1.3.1 (Node 3) ----> 10.1.3.2 (Node 4)\n\n";
321  NS_TEST_EXPECT_MSG_EQ (stringStream1v4.str (), p_nSrcnAnCnDstv4, "Routing Path is incorrect.");
322 
323  const std::string p_nSrcnAnCnDstv6 = "Time: +3s, Nix Routing\n"
324  "Route Path: (Node 0 to Node 4, Nix Vector: 01001)\n"
325  "2001::200:ff:fe00:1 (Node 0) ----> fe80::200:ff:fe00:2 (Node 1)\n"
326  "fe80::200:ff:fe00:9 (Node 1) ----> fe80::200:ff:fe00:a (Node 3)\n"
327  "fe80::200:ff:fe00:7 (Node 3) ----> 2001:3::200:ff:fe00:8 (Node 4)\n\n";
328  NS_TEST_EXPECT_MSG_EQ (stringStream1v6.str (), p_nSrcnAnCnDstv6, "Routing Path is incorrect.");
329 
330  const std::string p_nSrcnAnBnCnDstv4 = "Time: +9s, Nix Routing\n"
331  "Route Path: (Node 0 to Node 4, Nix Vector: 0111)\n"
332  "10.1.0.1 (Node 0) ----> 10.1.0.2 (Node 1)\n"
333  "10.1.1.1 (Node 1) ----> 10.1.1.2 (Node 2)\n"
334  "10.1.2.1 (Node 2) ----> 10.1.2.2 (Node 3)\n"
335  "10.1.3.1 (Node 3) ----> 10.1.3.2 (Node 4)\n\n";
336  NS_TEST_EXPECT_MSG_EQ (stringStream3v4.str (), p_nSrcnAnBnCnDstv4, "Routing Path is incorrect.");
337 
338  const std::string p_nSrcnAnBnCnDstv6 = "Time: +9s, Nix Routing\n"
339  "Route Path: (Node 0 to Node 4, Nix Vector: 0111)\n"
340  "2001::200:ff:fe00:1 (Node 0) ----> fe80::200:ff:fe00:2 (Node 1)\n"
341  "fe80::200:ff:fe00:3 (Node 1) ----> fe80::200:ff:fe00:4 (Node 2)\n"
342  "fe80::200:ff:fe00:5 (Node 2) ----> fe80::200:ff:fe00:6 (Node 3)\n"
343  "fe80::200:ff:fe00:7 (Node 3) ----> 2001:3::200:ff:fe00:8 (Node 4)\n\n";
344  NS_TEST_EXPECT_MSG_EQ (stringStream3v6.str (), p_nSrcnAnBnCnDstv6, "Routing Path is incorrect.");
345 
346  const std::string emptyCaches = "Node: 0, Time: +7s, Local time: +7s, Nix Routing\n"
347  "NixCache:\n"
348  "IpRouteCache:\n\n"
349  "Node: 1, Time: +7s, Local time: +7s, Nix Routing\n"
350  "NixCache:\n"
351  "IpRouteCache:\n\n"
352  "Node: 2, Time: +7s, Local time: +7s, Nix Routing\n"
353  "NixCache:\n"
354  "IpRouteCache:\n\n"
355  "Node: 3, Time: +7s, Local time: +7s, Nix Routing\n"
356  "NixCache:\n"
357  "IpRouteCache:\n\n"
358  "Node: 4, Time: +7s, Local time: +7s, Nix Routing\n"
359  "NixCache:\n"
360  "IpRouteCache:\n\n";
361  NS_TEST_EXPECT_MSG_EQ (stringStream2v4.str (), emptyCaches, "The caches should have been empty.");
362  NS_TEST_EXPECT_MSG_EQ (stringStream2v6.str (), emptyCaches, "The caches should have been empty.");
363 
364  Simulator::Destroy ();
365 }
366 
374 {
375 public:
376  NixVectorRoutingTestSuite () : TestSuite ("nix-vector-routing", UNIT)
377  {
378  AddTestCase (new NixVectorRoutingTest (), TestCase::QUICK);
379  }
380 };
381 
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition: net-device-container.h:42
ns3::InetSocketAddress
an Inet address class
Definition: inet-socket-address.h:41
NixVectorRoutingTest
The topology is of the form:
Definition: nix-test.cc:67
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
ns3::UdpSocketFactory
API to create UDP socket instances.
Definition: udp-socket-factory.h:42
ns3::Socket::SetAllowBroadcast
virtual bool SetAllowBroadcast(bool allowBroadcast)=0
Configure whether broadcast datagram transmissions are allowed.
ns3::Socket::Bind
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
ns3::Packet::GetSize
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
ns3::Node::GetId
uint32_t GetId(void) const
Definition: node.cc:109
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv4AddressHelper
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Definition: ipv4-address-helper.h:48
ns3::Socket::GetNode
virtual Ptr< Node > GetNode(void) const =0
Return the node this socket is associated with.
ns3::Object::GetObject
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ns3::Ipv6::GetInterfaceForDevice
virtual int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const =0
Get the interface index of the specified NetDevice.
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
NixVectorRoutingTest::SendData
void SendData(Time delay, Ptr< Socket > socket, Ipv4Address to)
Schedules the DoSendData () function to send the data.
Definition: nix-test.cc:144
ns3::Ipv6AddressHelper::SetBase
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Definition: ipv6-address-helper.cc:69
ns3::Ipv6AddressHelper
Helper class to auto-assign global IPv6 unicast addresses.
Definition: ipv6-address-helper.h:83
ns3::Socket::SendTo
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
ns3::NodeContainer::Create
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Definition: node-container.cc:98
ns3::TestCase
encapsulates test code
Definition: test.h:1154
ns3::NodeContainer::Add
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Definition: node-container.cc:114
ns3::Ipv4AddressHelper::SetBase
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Definition: ipv4-address-helper.cc:64
ns3::Ipv4
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:77
ns3::Ipv6AddressHelper::Assign
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Definition: ipv6-address-helper.cc:210
ns3::Ptr< Packet >
ns3::NixVectorHelper
Helper class that adds Nix-vector routing to nodes.
Definition: nix-vector-helper.h:51
ns3::Socket::SetRecvCallback
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
Definition: socket.cc:128
first.stack
stack
Definition: first.py:41
ns3::Ipv4::GetInterfaceForDevice
virtual int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const =0
max
#define max(a, b)
Definition: 80211b.c:43
ns3::Address
a polymophic address class
Definition: address.h:91
NixVectorRoutingTest::NixVectorRoutingTest
NixVectorRoutingTest()
Definition: nix-test.cc:113
ns3::Ipv6InterfaceContainer::GetAddress
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Definition: ipv6-interface-container.cc:57
NS_UNUSED
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition: ipv4-interface-container.h:55
ns3::Ipv6InterfaceContainer
Keep track of a set of IPv6 interfaces.
Definition: ipv6-interface-container.h:42
ns3::NodeContainer::Get
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Definition: node-container.cc:93
ns3::SimpleNetDeviceHelper
build a set of SimpleNetDevice objects
Definition: simple-net-device-helper.h:37
NS_TEST_EXPECT_MSG_EQ
#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
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
NixVectorRoutingTest::ReceivePkt
void ReceivePkt(Ptr< Socket > socket)
Receive data.
Definition: nix-test.cc:118
ns3::SimpleNetDeviceHelper::Install
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
Definition: simple-net-device-helper.cc:100
NixVectorRoutingTest::DoRun
virtual void DoRun(void)
Implementation to actually run this TestCase.
Definition: nix-test.cc:160
ns3::SocketFactory::CreateSocket
virtual Ptr< Socket > CreateSocket(void)=0
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
NixVectorRoutingTest::DoSendDatav6
void DoSendDatav6(Ptr< Socket > socket, Ipv6Address to)
Send data immediately after being called.
Definition: nix-test.cc:137
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1344
NixVectorRoutingTest::DoSendDatav4
void DoSendDatav4(Ptr< Socket > socket, Ipv4Address to)
Send data immediately after being called.
Definition: nix-test.cc:130
NS_TEST_ASSERT_MSG_EQ
#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
NixVectorRoutingTest::m_receivedPacket
Ptr< Packet > m_receivedPacket
Received packet.
Definition: nix-test.cc:68
ns3::TestSuite::UNIT
@ UNIT
This test suite implements a Unit Test.
Definition: test.h:1353
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::Inet6SocketAddress
An Inet6 address class.
Definition: inet6-socket-address.h:37
ns3::Ipv4AddressHelper::Assign
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Definition: ipv4-address-helper.cc:135
NixVectorRoutingTest::m_receivedPacketSizes
std::vector< uint32_t > m_receivedPacketSizes
Received packet sizes.
Definition: nix-test.cc:110
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::Ipv6
Access to the IPv6 forwarding table, interfaces, and configuration.
Definition: ipv6.h:82
g_nixVectorRoutingTestSuite
static NixVectorRoutingTestSuite g_nixVectorRoutingTestSuite
Static variable for test initialization.
Definition: nix-test.cc:383
ns3::Ipv4InterfaceContainer::GetAddress
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Definition: ipv4-interface-container.cc:59
NixVectorRoutingTestSuite::NixVectorRoutingTestSuite
NixVectorRoutingTestSuite()
Definition: nix-test.cc:376
NixVectorRoutingTestSuite
IPv4 Nix-Vector Routing TestSuite.
Definition: nix-test.cc:374
ns3::Socket::GetRxAvailable
virtual uint32_t GetRxAvailable(void) const =0
Return number of bytes which can be returned from one or multiple calls to Recv.
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition: ipv6-address.h:456
ns3::InternetStackHelper
aggregate IP/TCP/UDP functionality to existing Nodes.
Definition: internet-stack-helper.h:88
ns3::NetDeviceContainer::Get
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Definition: net-device-container.cc:62
ns3::NixVectorHelper::PrintRoutingPathAt
void PrintRoutingPathAt(Time printTime, Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the routing path for a source and destination at a particular time.
Definition: nix-vector-helper.cc:67
ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
Definition: simple-net-device-helper.cc:94
ns3::Socket::Recv
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.