A Discrete-Event Network Simulator
API
ocb-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) 2013 Dalian University of Technology
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: Junling Bu <linlinjavaer@gmail.com>
19  */
20 
21 #include <iostream>
22 #include "ns3/test.h"
23 #include "ns3/rng-seed-manager.h"
24 #include "ns3/config.h"
25 #include "ns3/data-rate.h"
26 #include "ns3/vector.h"
27 #include "ns3/string.h"
28 #include "ns3/packet-socket-address.h"
29 #include "ns3/mobility-model.h"
30 #include "ns3/yans-wifi-helper.h"
31 #include "ns3/position-allocator.h"
32 #include "ns3/packet-socket-helper.h"
33 #include "ns3/mobility-helper.h"
34 #include "ns3/wifi-net-device.h"
35 #include "ns3/packet-socket-server.h"
36 #include "ns3/packet-socket-client.h"
37 #include "ns3/ocb-wifi-mac.h"
38 #include "ns3/wifi-80211p-helper.h"
39 #include "ns3/wave-mac-helper.h"
40 
41 using namespace ns3;
42 // helper function to assign streams to random variables, to control
43 // randomness in the tests
44 static void
46 {
47  int64_t currentStream = stream;
48  Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac);
49  if (rmac)
50  {
51  PointerValue ptr;
52  rmac->GetAttribute ("Txop", ptr);
53  Ptr<Txop> txop = ptr.Get<Txop> ();
54  currentStream += txop->AssignStreams (currentStream);
55 
56  rmac->GetAttribute ("VO_Txop", ptr);
57  Ptr<QosTxop> vo_txop = ptr.Get<QosTxop> ();
58  currentStream += vo_txop->AssignStreams (currentStream);
59 
60  rmac->GetAttribute ("VI_Txop", ptr);
61  Ptr<QosTxop> vi_txop = ptr.Get<QosTxop> ();
62  currentStream += vi_txop->AssignStreams (currentStream);
63 
64  rmac->GetAttribute ("BE_Txop", ptr);
65  Ptr<QosTxop> be_txop = ptr.Get<QosTxop> ();
66  currentStream += be_txop->AssignStreams (currentStream);
67 
68  rmac->GetAttribute ("BK_Txop", ptr);
69  Ptr<QosTxop> bk_txop = ptr.Get<QosTxop> ();
70  currentStream += bk_txop->AssignStreams (currentStream);
71  }
72 }
73 
81 {
82 public:
83  OcbWifiMacTestCase (void);
84  virtual ~OcbWifiMacTestCase (void);
85 private:
86  virtual void DoRun (void);
87 
93  void MacAssoc (std::string context, Mac48Address bssid);
102  void PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
111  void PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower);
117  Vector GetCurrentPosition (uint32_t i);
122  void AdvancePosition (Ptr<Node> node);
123 
125  void PreRandomConfiguration (void);
131  void ConfigureApStaMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
137  void ConfigureAdhocMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
143  void ConfigureOcbMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
149  void PostDeviceConfiguration (Ptr<Node> static_node, Ptr<Node> mobile_node);
150 
152  Vector phytx_pos;
153 
155  Vector macassoc_pos;
156 
158  Vector phyrx_pos;
159 
160  // nodes.Get (0) is static node
161  // nodes.Get (1) is mobile node
163 };
164 
166  : TestCase ("Association time: Ap+Sta mode vs Adhoc mode vs Ocb mode")
167 {
168 }
169 
171 {
172 }
173 
174 // mobility is like walk on line with velocity 5 m/s
175 // We prefer to update 0.5m every 0.1s rather than 5m every 1s
176 void
178 {
180  Vector pos = mobility->GetPosition ();
181  pos.x -= 0.5;
182  if (pos.x < 1.0 )
183  {
184  pos.x = 1.0;
185  return;
186  }
187  mobility->SetPosition (pos);
188 
189  Simulator::Schedule (Seconds (0.1), &OcbWifiMacTestCase::AdvancePosition, this, node);
190 }
191 
192 // here are only two nodes, a stationary and a mobile one
193 // the i value of the first = 0; the i value of second = 1.
194 Vector
196 {
197  NS_ASSERT (i < 2);
198  Ptr<Node> node = nodes.Get (i);
200  Vector pos = mobility->GetPosition ();
201  return pos;
202 }
203 
204 void
205 OcbWifiMacTestCase::MacAssoc (std::string context,Mac48Address bssid)
206 {
207  if (macassoc_time == Time (0))
208  {
209  macassoc_time = Now ();
211  std::cout << "MacAssoc time = " << macassoc_time.GetNanoSeconds ()
212  << " position = " << macassoc_pos
213  << std::endl;
214  }
215 }
216 
217 // We want to get the time that sta receives the first beacon frame from AP
218 // it means that in this time this sta has ability to receive frame
219 void
220 OcbWifiMacTestCase::PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
221 {
222  if (phyrx_time == Time (0))
223  {
224  phyrx_time = Now ();
226  std::cout << "PhyRxOk time = " << phyrx_time.GetNanoSeconds ()
227  << " position = " << phyrx_pos
228  << std::endl;
229  }
230 }
231 
232 // We want to get the time that STA sends the first data packet successfully
233 void
234 OcbWifiMacTestCase::PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
235 {
236  WifiMacHeader h;
237  packet->PeekHeader (h);
238  if ((phytx_time == Time (0)) && h.IsData ())
239  {
240  phytx_time = Now ();
242  std::cout << "PhyTx data time = " << phytx_time.GetNanoSeconds ()
243  << " position = " << phytx_pos
244  << std::endl;
245  }
246 }
247 
248 void
250 {
251  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
252  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
253  wifiPhy.SetChannel (wifiChannel.Create ());
254 
255  Ssid ssid = Ssid ("wifi-default");
256  WifiMacHelper wifiStaMac;
257  wifiStaMac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid));
258  WifiMacHelper wifiApMac;
259  wifiApMac.SetType ("ns3::ApWifiMac","Ssid", SsidValue (ssid));
260 
262  wifi.SetStandard (WIFI_PHY_STANDARD_80211_10MHZ);
263  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
264  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
265  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
266  wifi.Install (wifiPhy, wifiStaMac, mobile_node);
267  wifi.Install (wifiPhy, wifiApMac, static_node);
268 }
269 
270 void
272 {
273  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
274  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
275  wifiPhy.SetChannel (wifiChannel.Create ());
276 
277  WifiMacHelper wifiMac;
278  wifiMac.SetType ("ns3::AdhocWifiMac");
279 
281  wifi.SetStandard (WIFI_PHY_STANDARD_80211_10MHZ);
282  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
283  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
284  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
285  wifi.Install (wifiPhy, wifiMac, mobile_node);
286  wifi.Install (wifiPhy, wifiMac, static_node);
287 }
288 
289 void
291 {
292  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
293  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
294  wifiPhy.SetChannel (wifiChannel.Create ());
295 
296  NqosWaveMacHelper wifi80211pMac = NqosWaveMacHelper::Default ();
297 
298  Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();
299  wifi80211p.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
300  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
301  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
302  wifi80211p.Install (wifiPhy, wifi80211pMac, mobile_node);
303  wifi80211p.Install (wifiPhy, wifi80211pMac, static_node);
304 }
305 
306 void
308 {
309  Ptr<WifiNetDevice> static_device = DynamicCast<WifiNetDevice> (static_node->GetDevice (0));
310  Ptr<WifiNetDevice> mobile_device = DynamicCast<WifiNetDevice> (mobile_node->GetDevice (0));
311 
312  // Fix the stream assignment to the Dcf Txop objects (backoffs)
313  // The below stream assignment will result in the Txop object
314  // using a backoff value of zero for this test when the
315  // Txop::EndTxNoAck() calls to StartBackoffNow()
316  AssignWifiRandomStreams (static_device->GetMac (), 21);
317  AssignWifiRandomStreams (mobile_device->GetMac (), 22);
318 
319  // setup mobility
320  // the initial position of static node is at 0,
321  // and the initial position of mobile node is 350.
323  mobility.Install (mobile_node);
324  mobility.Install (static_node);
325  Ptr<MobilityModel> mm = mobile_node->GetObject<MobilityModel> ();
326  Vector possta = mm->GetPosition ();
327  possta.x = 350;
328  mm->SetPosition (possta);
329  Simulator::Schedule (Seconds (1.0), &OcbWifiMacTestCase::AdvancePosition, this, mobile_node);
330 
331  PacketSocketAddress socket;
332  socket.SetSingleDevice (mobile_device->GetIfIndex ());
333  socket.SetPhysicalAddress (static_device->GetAddress ());
334  socket.SetProtocol (1);
335 
336  // give packet socket powers to nodes.
337  PacketSocketHelper packetSocket;
338  packetSocket.Install (static_node);
339  packetSocket.Install (mobile_node);
340 
341  Ptr<PacketSocketClient> client = CreateObject<PacketSocketClient> ();
342  client->SetRemote (socket);
343  mobile_node->AddApplication (client);
344  client->SetStartTime (Seconds (0.5));
345  client->SetStopTime (Seconds (70.0));
346 
347  Ptr<PacketSocketServer> server = CreateObject<PacketSocketServer> ();
348  server->SetLocal (socket);
349  static_node->AddApplication (server);
350  server->SetStartTime (Seconds (0.0));
351  server->SetStopTime (Seconds (70.5));
352 
354  phytx_pos = macassoc_pos = phyrx_pos = Vector ();
355 
356  Config::Connect ("/NodeList/1/DeviceList/*/Mac/Assoc", MakeCallback (&OcbWifiMacTestCase::MacAssoc, this));
357  Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/RxOk", MakeCallback (&OcbWifiMacTestCase::PhyRxOkTrace, this));
358  Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/Tx", MakeCallback (&OcbWifiMacTestCase::PhyTxTrace, this));
359 }
360 
374 void
376 {
377  std::cout << "test time point for Ap-Sta mode" << std::endl;
379  nodes = NodeContainer ();
380  nodes.Create (2);
381  Ptr<Node> static_node = nodes.Get (0);
382  Ptr<Node> mobile_node = nodes.Get (1);
383  ConfigureApStaMode (static_node, mobile_node);
384  PostDeviceConfiguration (static_node, mobile_node);
385  Simulator::Stop (Seconds (71.0));
386  Simulator::Run ();
387  Simulator::Destroy ();
388  NS_TEST_ASSERT_MSG_LT (phyrx_time, macassoc_time, "In Sta mode with AP, you cannot associate until receive beacon or AssocResponse frame" );
389  NS_TEST_ASSERT_MSG_LT (macassoc_time, phytx_time, "In Sta mode with AP, you cannot send data packet until associate" );
390  //Are these position tests redundant with time check tests?
391  //NS_TEST_ASSERT_MSG_GT ((phyrx_pos.x - macassoc_pos.x), 0.0, "");
392  //actually macassoc_pos.x - phytx_pos.x is greater than 0
393  //however associate switch to send is so fast with less than 100ms
394  //and in our mobility model that every 0.1s update position,
395  //so turn out to be that macassoc_pos.x - phytx_pos.x is equal to 0
396  //NS_TEST_ASSERT_MSG_GT ((macassoc_pos.x - phytx_pos.x), 0.0, "");
397 
398  std::cout << "test time point for Adhoc mode" << std::endl;
400  nodes = NodeContainer ();
401  nodes.Create (2);
402  static_node = nodes.Get (0);
403  mobile_node = nodes.Get (1);
404  ConfigureAdhocMode (static_node, mobile_node);
405  PostDeviceConfiguration (static_node, mobile_node);
406  Simulator::Stop (Seconds (71.0));
407  Simulator::Run ();
408  Simulator::Destroy ();
409  // below test assert will fail, because AdhocWifiMac has not implement state machine.
410  // if someone takes a look at the output in adhoc mode and in Ocb mode
411  // he will find these two outputs are almost same.
412  //NS_TEST_ASSERT_MSG_LT (phyrx_time, macassoc_time, "In Adhoc mode, you cannot associate until receive beacon or AssocResponse frame" );
413  //NS_TEST_ASSERT_MSG_LT (macassoc_time, phytx_time, "In Adhoc mode, you cannot send data packet until associate" );
414  //NS_TEST_ASSERT_MSG_GT ((phyrx_pos.x - macassoc_pos.x), 0.0, "");
415  // below test assert result refer to Ap-Sta mode
416  //NS_TEST_ASSERT_MSG_GT ((macassoc_pos.x - phytx_pos.x), 0.0, "");
417 
418  std::cout << "test time point for Ocb mode" << std::endl;
420  nodes = NodeContainer ();
421  nodes.Create (2);
422  static_node = nodes.Get (0);
423  mobile_node = nodes.Get (1);
424  ConfigureOcbMode (static_node, mobile_node);
425  PostDeviceConfiguration (static_node, mobile_node);
426  Simulator::Stop (Seconds (71.0));
427  Simulator::Run ();
428  Simulator::Destroy ();
429  NS_TEST_ASSERT_MSG_EQ (macassoc_time.GetNanoSeconds (), 0, "In Ocb mode, there is no associate state machine" );
430  NS_TEST_ASSERT_MSG_LT (phytx_time, phyrx_time, "before mobile node receives frames from far static node, it can send data packet directly" );
431  NS_TEST_ASSERT_MSG_EQ (macassoc_pos.x, 0.0, "");
432  NS_TEST_ASSERT_MSG_GT ((phytx_pos.x - phyrx_pos.x), 0.0, "");
433 }
434 void
436 {
437  // Assign a seed and run number, and later fix the assignment of streams to
438  // WiFi random variables, so that the first backoff used is zero slots
439  RngSeedManager::SetSeed (1);
440  RngSeedManager::SetRun (17);
441  // the WiFi random variables is set in PostDeviceConfiguration method.
442 }
443 
450 class OcbTestSuite : public TestSuite
451 {
452 public:
453  OcbTestSuite ();
454 };
455 
457  : TestSuite ("wifi-80211p-ocb", UNIT)
458 {
459  // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
460  AddTestCase (new OcbWifiMacTestCase, TestCase::QUICK);
461 }
462 
463 // Do not forget to allocate an instance of this TestSuite
465 
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition: node.cc:157
helps to create wifi 802.11p objects of WifiNetDevice class
void SetStopTime(Time stop)
Specify application stop time.
Definition: application.cc:75
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
static void AdvancePosition(Ptr< Node > node)
Definition: wifi-ap.cc:103
void MacAssoc(std::string context, Mac48Address bssid)
MAC associate function.
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), 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(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition: wifi-helper.cc:661
Hold variables of type string.
Definition: string.h:41
Make it easy to create and manage PHY objects for the yans model.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:142
A suite of tests to run.
Definition: test.h:1342
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:91
an address for a packet socket
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
void ConfigureOcbMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure OCB mode function.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:743
encapsulates test code
Definition: test.h:1155
static OcbTestSuite ocbTestSuite
the test suite
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
Phy transmit trace function.
helps to create WifiNetDevice objects
Definition: wifi-helper.h:299
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Address GetAddress(void) const
Ptr< YansWifiChannel > Create(void) const
mobility
Definition: third.py:101
Vector macassoc_pos
MAC associate position.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
Keep track of the current position and velocity of an object.
void SetChannel(Ptr< YansWifiChannel > channel)
Time phyrx_time
Phy receive time.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: txop.cc:321
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Vector3D Vector
Definition: vector.h:217
ssid
Definition: third.py:93
#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:168
virtual ~OcbWifiMacTestCase(void)
mac
Definition: third.py:92
Vector GetCurrentPosition(uint32_t i)
Get current position function.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)
Definition: wifi-ap.cc:56
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
Phy receive ok trace function.
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:871
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
void AdvancePosition(Ptr< Node > node)
Advance position function.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPhysicalAddress(const Address address)
Set the destination address.
keep track of a set of node pointers.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
bool IsData(void) const
Return true if the Type is DATA.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:367
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
Definition: wifi-ap.cc:72
void PostDeviceConfiguration(Ptr< Node > static_node, Ptr< Node > mobile_node)
Post device configuration function.
virtual void DoRun(void)
static-node:0 <-— mobile-node:1
an EUI-48 address
Definition: mac48-address.h:43
manage and create wifi channel objects for the yans model.
create MAC layers for a ns3::WifiNetDevice.
Nqos Wave Mac Helper class.
Time phytx_time
Phy transmit time.
void SetPosition(const Vector &position)
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), 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(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
Vector GetPosition(void) const
wifi
Definition: third.py:89
Helper class used to assign positions and mobility models to nodes.
void ConfigureApStaMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure AP STA mode function.
Ptr< WifiMac > GetMac(void) const
Vector phytx_pos
Phy transmit position.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &macHelper, NodeContainer c) const
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1062
AttributeValue implementation for Ssid.
Definition: ssid.h:110
Ocb Wifi Mac Test Case.
Ptr< T > Get(void) const
Definition: pointer.h:194
void SetProtocol(uint16_t protocol)
Set the protocol.
NodeContainer nodes
the nodes
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:309
Vector phyrx_pos
Phy receive position.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ocb Test Suite.
void PreRandomConfiguration(void)
Pre random configuration function.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
Definition: test.h:997
void ConfigureAdhocMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure adhoc mode function.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:223
void SetStartTime(Time start)
Specify application start time.
Definition: application.cc:69
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
Definition: test.h:811
Implements the IEEE 802.11 MAC header.
Time macassoc_time
MAC associate time.
Handle packet fragmentation and retransmissions for data and management frames.
Definition: txop.h:65