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/sta-wifi-mac.h"
32 #include "ns3/position-allocator.h"
33 #include "ns3/packet-socket-helper.h"
34 #include "ns3/mobility-helper.h"
35 #include "ns3/wifi-net-device.h"
36 #include "ns3/packet-socket-server.h"
37 #include "ns3/packet-socket-client.h"
38 #include "ns3/ocb-wifi-mac.h"
39 #include "ns3/wifi-80211p-helper.h"
40 #include "ns3/wave-mac-helper.h"
41 
42 using namespace ns3;
43 // helper function to assign streams to random variables, to control
44 // randomness in the tests
45 static void
47 {
48  int64_t currentStream = stream;
49  Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac);
50  if (rmac)
51  {
52  PointerValue ptr;
53  if (!rmac->GetQosSupported ())
54  {
55  rmac->GetAttribute ("Txop", ptr);
56  Ptr<Txop> txop = ptr.Get<Txop> ();
57  currentStream += txop->AssignStreams (currentStream);
58  }
59  else
60  {
61  rmac->GetAttribute ("VO_Txop", ptr);
62  Ptr<QosTxop> vo_txop = ptr.Get<QosTxop> ();
63  currentStream += vo_txop->AssignStreams (currentStream);
64 
65  rmac->GetAttribute ("VI_Txop", ptr);
66  Ptr<QosTxop> vi_txop = ptr.Get<QosTxop> ();
67  currentStream += vi_txop->AssignStreams (currentStream);
68 
69  rmac->GetAttribute ("BE_Txop", ptr);
70  Ptr<QosTxop> be_txop = ptr.Get<QosTxop> ();
71  currentStream += be_txop->AssignStreams (currentStream);
72 
73  rmac->GetAttribute ("BK_Txop", ptr);
74  Ptr<QosTxop> bk_txop = ptr.Get<QosTxop> ();
75  currentStream += bk_txop->AssignStreams (currentStream);
76  }
77  }
78 }
79 
87 {
88 public:
89  OcbWifiMacTestCase (void);
90  virtual ~OcbWifiMacTestCase (void);
91 private:
92  virtual void DoRun (void);
93 
99  void MacAssoc (std::string context, Mac48Address bssid);
108  void PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
117  void PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower);
123  Vector GetCurrentPosition (uint32_t i);
128  void AdvancePosition (Ptr<Node> node);
129 
131  void PreRandomConfiguration (void);
137  void ConfigureApStaMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
143  void ConfigureAdhocMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
149  void ConfigureOcbMode (Ptr<Node> static_node, Ptr<Node> mobile_node);
155  void PostDeviceConfiguration (Ptr<Node> static_node, Ptr<Node> mobile_node);
156 
158  Vector phytx_pos;
159 
161  Vector macassoc_pos;
162 
164  Vector phyrx_pos;
165 
166  // nodes.Get (0) is static node
167  // nodes.Get (1) is mobile node
169 };
170 
172  : TestCase ("Association time: Ap+Sta mode vs Adhoc mode vs Ocb mode")
173 {
174 }
175 
177 {
178 }
179 
180 // mobility is like walk on line with velocity 5 m/s
181 // We prefer to update 0.5m every 0.1s rather than 5m every 1s
182 void
184 {
186  Vector pos = mobility->GetPosition ();
187  pos.x -= 0.5;
188  if (pos.x < 1.0 )
189  {
190  pos.x = 1.0;
191  return;
192  }
193  mobility->SetPosition (pos);
194 
195  Simulator::Schedule (Seconds (0.1), &OcbWifiMacTestCase::AdvancePosition, this, node);
196 }
197 
198 // here are only two nodes, a stationary and a mobile one
199 // the i value of the first = 0; the i value of second = 1.
200 Vector
202 {
203  NS_ASSERT (i < 2);
204  Ptr<Node> node = nodes.Get (i);
206  Vector pos = mobility->GetPosition ();
207  return pos;
208 }
209 
210 void
211 OcbWifiMacTestCase::MacAssoc (std::string context,Mac48Address bssid)
212 {
213  if (macassoc_time == Time (0))
214  {
215  macassoc_time = Now ();
217  std::cout << "MacAssoc time = " << macassoc_time.As (Time::NS)
218  << " position = " << macassoc_pos
219  << std::endl;
220  }
221 }
222 
223 // We want to get the time that sta receives the first beacon frame from AP
224 // it means that in this time this sta has ability to receive frame
225 void
226 OcbWifiMacTestCase::PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
227 {
228  if (phyrx_time == Time (0))
229  {
230  phyrx_time = Now ();
232  std::cout << "PhyRxOk time = " << phyrx_time.As (Time::NS)
233  << " position = " << phyrx_pos
234  << std::endl;
235  }
236 }
237 
238 // We want to get the time that STA sends the first data packet successfully
239 void
240 OcbWifiMacTestCase::PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
241 {
242  WifiMacHeader h;
243  packet->PeekHeader (h);
244  if ((phytx_time == Time (0)) && h.IsData ())
245  {
246  phytx_time = Now ();
248  std::cout << "PhyTx data time = " << phytx_time.As (Time::NS)
249  << " position = " << phytx_pos
250  << std::endl;
251  }
252 }
253 
254 void
256 {
257  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
258  YansWifiPhyHelper wifiPhy;
259  wifiPhy.SetChannel (wifiChannel.Create ());
260 
261  Ssid ssid = Ssid ("wifi-default");
262  WifiMacHelper wifiStaMac;
263  wifiStaMac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid));
264  WifiMacHelper wifiApMac;
265  wifiApMac.SetType ("ns3::ApWifiMac","Ssid", SsidValue (ssid));
266 
268  wifi.SetStandard (WIFI_STANDARD_80211p);
269  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
270  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
271  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
272  wifi.Install (wifiPhy, wifiStaMac, mobile_node);
273  wifi.Install (wifiPhy, wifiApMac, static_node);
274 }
275 
276 void
278 {
279  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
280  YansWifiPhyHelper wifiPhy;
281  wifiPhy.SetChannel (wifiChannel.Create ());
282 
283  WifiMacHelper wifiMac;
284  wifiMac.SetType ("ns3::AdhocWifiMac");
285 
287  wifi.SetStandard (WIFI_STANDARD_80211p);
288  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
289  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
290  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
291  wifi.Install (wifiPhy, wifiMac, mobile_node);
292  wifi.Install (wifiPhy, wifiMac, static_node);
293 }
294 
295 void
297 {
298  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
299  YansWifiPhyHelper wifiPhy;
300  wifiPhy.SetChannel (wifiChannel.Create ());
301 
302  NqosWaveMacHelper wifi80211pMac = NqosWaveMacHelper::Default ();
303 
304  Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();
305  wifi80211p.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
306  "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"),
307  "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));
308  wifi80211p.Install (wifiPhy, wifi80211pMac, mobile_node);
309  wifi80211p.Install (wifiPhy, wifi80211pMac, static_node);
310 }
311 
312 void
314 {
315  Ptr<WifiNetDevice> static_device = DynamicCast<WifiNetDevice> (static_node->GetDevice (0));
316  Ptr<WifiNetDevice> mobile_device = DynamicCast<WifiNetDevice> (mobile_node->GetDevice (0));
317 
318  // Fix the stream assignment to the Dcf Txop objects (backoffs)
319  // The below stream assignment will result in the Txop object
320  // using a backoff value of zero for this test when the
321  // Txop::EndTxNoAck() calls to StartBackoffNow()
322  AssignWifiRandomStreams (static_device->GetMac (), 21);
323  AssignWifiRandomStreams (mobile_device->GetMac (), 22);
324 
325  // setup mobility
326  // the initial position of static node is at 0,
327  // and the initial position of mobile node is 350.
329  mobility.Install (mobile_node);
330  mobility.Install (static_node);
331  Ptr<MobilityModel> mm = mobile_node->GetObject<MobilityModel> ();
332  Vector possta = mm->GetPosition ();
333  possta.x = 350;
334  mm->SetPosition (possta);
335  Simulator::Schedule (Seconds (1.0), &OcbWifiMacTestCase::AdvancePosition, this, mobile_node);
336 
337  PacketSocketAddress socket;
338  socket.SetSingleDevice (mobile_device->GetIfIndex ());
339  socket.SetPhysicalAddress (static_device->GetAddress ());
340  socket.SetProtocol (1);
341 
342  // give packet socket powers to nodes.
343  PacketSocketHelper packetSocket;
344  packetSocket.Install (static_node);
345  packetSocket.Install (mobile_node);
346 
347  Ptr<PacketSocketClient> client = CreateObject<PacketSocketClient> ();
348  client->SetRemote (socket);
349  mobile_node->AddApplication (client);
350  client->SetStartTime (Seconds (0.5));
351  client->SetStopTime (Seconds (70.0));
352 
353  Ptr<PacketSocketServer> server = CreateObject<PacketSocketServer> ();
354  server->SetLocal (socket);
355  static_node->AddApplication (server);
356  server->SetStartTime (Seconds (0.0));
357  server->SetStopTime (Seconds (70.5));
358 
360  phytx_pos = macassoc_pos = phyrx_pos = Vector ();
361 
362  if ( DynamicCast<StaWifiMac> (mobile_device->GetMac () ) )
363  {
364  // This trace is available only in a StaWifiMac
365  Config::Connect ("/NodeList/1/DeviceList/*/Mac/Assoc", MakeCallback (&OcbWifiMacTestCase::MacAssoc, this));
366  }
367  Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/RxOk", MakeCallback (&OcbWifiMacTestCase::PhyRxOkTrace, this));
368  Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/Tx", MakeCallback (&OcbWifiMacTestCase::PhyTxTrace, this));
369 }
370 
384 void
386 {
387  std::cout << "test time point for Ap-Sta mode" << std::endl;
389  nodes = NodeContainer ();
390  nodes.Create (2);
391  Ptr<Node> static_node = nodes.Get (0);
392  Ptr<Node> mobile_node = nodes.Get (1);
393  ConfigureApStaMode (static_node, mobile_node);
394  PostDeviceConfiguration (static_node, mobile_node);
395  Simulator::Stop (Seconds (71.0));
396  Simulator::Run ();
397  Simulator::Destroy ();
398  NS_TEST_ASSERT_MSG_LT (phyrx_time, macassoc_time, "In Sta mode with AP, you cannot associate until receive beacon or AssocResponse frame" );
399  NS_TEST_ASSERT_MSG_LT (macassoc_time, phytx_time, "In Sta mode with AP, you cannot send data packet until associate" );
400  //Are these position tests redundant with time check tests?
401  //NS_TEST_ASSERT_MSG_GT ((phyrx_pos.x - macassoc_pos.x), 0.0, "");
402  //actually macassoc_pos.x - phytx_pos.x is greater than 0
403  //however associate switch to send is so fast with less than 100ms
404  //and in our mobility model that every 0.1s update position,
405  //so turn out to be that macassoc_pos.x - phytx_pos.x is equal to 0
406  //NS_TEST_ASSERT_MSG_GT ((macassoc_pos.x - phytx_pos.x), 0.0, "");
407 
408  std::cout << "test time point for Adhoc mode" << std::endl;
410  nodes = NodeContainer ();
411  nodes.Create (2);
412  static_node = nodes.Get (0);
413  mobile_node = nodes.Get (1);
414  ConfigureAdhocMode (static_node, mobile_node);
415  PostDeviceConfiguration (static_node, mobile_node);
416  Simulator::Stop (Seconds (71.0));
417  Simulator::Run ();
418  Simulator::Destroy ();
419  // below test assert will fail, because AdhocWifiMac has not implement state machine.
420  // if someone takes a look at the output in adhoc mode and in Ocb mode
421  // he will find these two outputs are almost same.
422  //NS_TEST_ASSERT_MSG_LT (phyrx_time, macassoc_time, "In Adhoc mode, you cannot associate until receive beacon or AssocResponse frame" );
423  //NS_TEST_ASSERT_MSG_LT (macassoc_time, phytx_time, "In Adhoc mode, you cannot send data packet until associate" );
424  //NS_TEST_ASSERT_MSG_GT ((phyrx_pos.x - macassoc_pos.x), 0.0, "");
425  // below test assert result refer to Ap-Sta mode
426  //NS_TEST_ASSERT_MSG_GT ((macassoc_pos.x - phytx_pos.x), 0.0, "");
427 
428  std::cout << "test time point for Ocb mode" << std::endl;
430  nodes = NodeContainer ();
431  nodes.Create (2);
432  static_node = nodes.Get (0);
433  mobile_node = nodes.Get (1);
434  ConfigureOcbMode (static_node, mobile_node);
435  PostDeviceConfiguration (static_node, mobile_node);
436  Simulator::Stop (Seconds (71.0));
437  Simulator::Run ();
438  Simulator::Destroy ();
439  NS_TEST_ASSERT_MSG_EQ (macassoc_time.GetNanoSeconds(), 0, "In Ocb mode, there is no associate state machine" );
440  NS_TEST_ASSERT_MSG_LT (phytx_time, phyrx_time, "before mobile node receives frames from far static node, it can send data packet directly" );
441  NS_TEST_ASSERT_MSG_EQ (macassoc_pos.x, 0.0, "");
442  NS_TEST_ASSERT_MSG_GT ((phytx_pos.x - phyrx_pos.x), 0.0, "");
443 }
444 void
446 {
447  // Assign a seed and run number, and later fix the assignment of streams to
448  // WiFi random variables, so that the first backoff used is zero slots
449  RngSeedManager::SetSeed (1);
450  RngSeedManager::SetRun (17);
451  // the WiFi random variables is set in PostDeviceConfiguration method.
452 }
453 
460 class OcbTestSuite : public TestSuite
461 {
462 public:
463  OcbTestSuite ();
464 };
465 
467  : TestSuite ("wave-80211p-ocb", UNIT)
468 {
469  // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
470  AddTestCase (new OcbWifiMacTestCase, TestCase::QUICK);
471 }
472 
473 // Do not forget to allocate an instance of this TestSuite
475 
ns3::Wifi80211pHelper
helps to create wifi 802.11p objects of WifiNetDevice class
Definition: wifi-80211p-helper.h:41
ns3::YansWifiPhyHelper
Make it easy to create and manage PHY objects for the YANS model.
Definition: yans-wifi-helper.h:161
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
OcbWifiMacTestCase::OcbWifiMacTestCase
OcbWifiMacTestCase(void)
Definition: ocb-test-suite.cc:171
NS_ASSERT
#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
ns3::Packet::PeekHeader
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
OcbWifiMacTestCase::ConfigureAdhocMode
void ConfigureAdhocMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure adhoc mode function.
Definition: ocb-test-suite.cc:277
ocbTestSuite
static OcbTestSuite ocbTestSuite
the test suite
Definition: ocb-test-suite.cc:474
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
OcbWifiMacTestCase::macassoc_time
Time macassoc_time
MAC associate time.
Definition: ocb-test-suite.cc:160
ns3::WifiHelper
helps to create WifiNetDevice objects
Definition: wifi-helper.h:327
OcbWifiMacTestCase::MacAssoc
void MacAssoc(std::string context, Mac48Address bssid)
MAC associate function.
Definition: ocb-test-suite.cc:211
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition: wifi-standards.h:130
ns3::Object::GetObject
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ns3::NqosWaveMacHelper
Nqos Wave Mac Helper class.
Definition: wave-mac-helper.h:35
OcbWifiMacTestCase::PhyTxTrace
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
Phy transmit trace function.
Definition: ocb-test-suite.cc:240
ns3::MobilityModel::SetPosition
void SetPosition(const Vector &position)
Definition: mobility-model.cc:88
ns3::PointerValue
Hold objects of type Ptr<T>.
Definition: pointer.h:37
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::PacketSocketAddress
an address for a packet socket
Definition: packet-socket-address.h:39
ns3::WifiNetDevice::GetAddress
Address GetAddress(void) const override
Definition: wifi-net-device.cc:243
third.mac
mac
Definition: third.py:99
ns3::Txop::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: txop.cc:309
ns3::Time::As
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:429
ns3::PacketSocketClient::SetRemote
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
Definition: packet-socket-client.cc:91
ns3::YansWifiPhyHelper::SetChannel
void SetChannel(Ptr< YansWifiChannel > channel)
Definition: yans-wifi-helper.cc:134
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: regular-wifi-mac.cc:641
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::SsidValue
AttributeValue implementation for Ssid.
Definition: ssid.h:105
ns3::Ssid
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
OcbTestSuite::OcbTestSuite
OcbTestSuite()
Definition: ocb-test-suite.cc:466
OcbWifiMacTestCase::PhyRxOkTrace
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
Phy receive ok trace function.
Definition: ocb-test-suite.cc:226
ns3::TestCase
encapsulates test code
Definition: test.h:1154
OcbWifiMacTestCase::ConfigureOcbMode
void ConfigureOcbMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure OCB mode function.
Definition: ocb-test-suite.cc:296
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::Application::SetStopTime
void SetStopTime(Time stop)
Specify application stop time.
Definition: application.cc:75
ns3::Wifi80211pHelper::Install
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &macHelper, NodeContainer c) const
Definition: wifi-80211p-helper.cc:76
OcbWifiMacTestCase::~OcbWifiMacTestCase
virtual ~OcbWifiMacTestCase(void)
Definition: ocb-test-suite.cc:176
ns3::PacketSocketHelper::Install
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Definition: packet-socket-helper.cc:37
third.wifi
wifi
Definition: third.py:96
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::Application::SetStartTime
void SetStartTime(Time start)
Specify application start time.
Definition: application.cc:69
ns3::YansWifiChannelHelper::Create
Ptr< YansWifiChannel > Create(void) const
Definition: yans-wifi-helper.cc:98
OcbWifiMacTestCase::phyrx_time
Time phyrx_time
Phy receive time.
Definition: ocb-test-suite.cc:163
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::Now
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
ns3::ObjectBase::GetAttribute
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:223
OcbWifiMacTestCase::macassoc_pos
Vector macassoc_pos
MAC associate position.
Definition: ocb-test-suite.cc:161
ns3::Node::AddApplication
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition: node.cc:159
OcbWifiMacTestCase::GetCurrentPosition
Vector GetCurrentPosition(uint32_t i)
Get current position function.
Definition: ocb-test-suite.cc:201
ns3::Node::GetDevice
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:144
NS_TEST_ASSERT_MSG_LT
#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:809
ns3::PointerValue::Get
Ptr< T > Get(void) const
Definition: pointer.h:201
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::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
OcbWifiMacTestCase::DoRun
virtual void DoRun(void)
static-node:0 <-— mobile-node:1
Definition: ocb-test-suite.cc:385
ns3::Time::GetNanoSeconds
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:392
ns3::PacketSocketAddress::SetSingleDevice
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Definition: packet-socket-address.cc:46
OcbWifiMacTestCase::phytx_pos
Vector phytx_pos
Phy transmit position.
Definition: ocb-test-suite.cc:158
ns3::PacketSocketHelper
Give ns3::PacketSocket powers to ns3::Node.
Definition: packet-socket-helper.h:32
ns3::QosTxop
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Definition: qos-txop.h:72
OcbWifiMacTestCase::phytx_time
Time phytx_time
Phy transmit time.
Definition: ocb-test-suite.cc:157
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
ns3::WifiNetDevice::GetIfIndex
uint32_t GetIfIndex(void) const override
Definition: wifi-net-device.cc:225
ns3::WifiHelper::SetRemoteStationManager
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:721
ns3::StringValue
Hold variables of type string.
Definition: string.h:41
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-phy-common.h:68
OcbWifiMacTestCase::PostDeviceConfiguration
void PostDeviceConfiguration(Ptr< Node > static_node, Ptr< Node > mobile_node)
Post device configuration function.
Definition: ocb-test-suite.cc:313
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1344
OcbWifiMacTestCase::ConfigureApStaMode
void ConfigureApStaMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Configure AP STA mode function.
Definition: ocb-test-suite.cc:255
PhyTxTrace
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
Definition: wifi-ap.cc:72
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
ns3::Config::Connect
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:920
AssignWifiRandomStreams
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
Definition: ocb-test-suite.cc:46
OcbWifiMacTestCase::AdvancePosition
void AdvancePosition(Ptr< Node > node)
Advance position function.
Definition: ocb-test-suite.cc:183
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
NS_TEST_ASSERT_MSG_GT
#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:995
ns3::Vector3D::Vector
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
Definition: vector.h:324
ns3::PacketSocketAddress::SetPhysicalAddress
void SetPhysicalAddress(const Address address)
Set the destination address.
Definition: packet-socket-address.cc:53
third.ssid
ssid
Definition: third.py:100
ns3::MobilityModel
Keep track of the current position and velocity of an object.
Definition: mobility-model.h:40
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::WifiMacHelper::SetType
void SetType(std::string type, Args &&... args)
Definition: wifi-mac-helper.h:130
ns3::PacketSocketAddress::SetProtocol
void SetProtocol(uint16_t protocol)
Set the protocol.
Definition: packet-socket-address.cc:33
AdvancePosition
static void AdvancePosition(Ptr< Node > node)
Definition: wifi-ap.cc:103
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:813
ns3::YansWifiChannelHelper
manage and create wifi channel objects for the YANS model.
Definition: yans-wifi-helper.h:37
OcbWifiMacTestCase::PreRandomConfiguration
void PreRandomConfiguration(void)
Pre random configuration function.
Definition: ocb-test-suite.cc:445
ns3::WifiMacHelper
create MAC layers for a ns3::WifiNetDevice.
Definition: wifi-mac-helper.h:48
OcbWifiMacTestCase::nodes
NodeContainer nodes
the nodes
Definition: ocb-test-suite.cc:168
OcbWifiMacTestCase::phyrx_pos
Vector phyrx_pos
Phy receive position.
Definition: ocb-test-suite.cc:164
ns3::PacketSocketServer::SetLocal
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
Definition: packet-socket-server.cc:102
OcbWifiMacTestCase
Ocb Wifi Mac Test Case.
Definition: ocb-test-suite.cc:87
OcbTestSuite
Ocb Test Suite.
Definition: ocb-test-suite.cc:461
ns3::MobilityModel::GetPosition
Vector GetPosition(void) const
Definition: mobility-model.cc:64
PhyRxOkTrace
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)
Definition: wifi-ap.cc:56
ns3::MobilityHelper
Helper class used to assign positions and mobility models to nodes.
Definition: mobility-helper.h:43
third.mobility
mobility
Definition: third.py:108
ns3::WifiNetDevice::GetMac
Ptr< WifiMac > GetMac(void) const
Definition: wifi-net-device.cc:201
ns3::Txop
Handle packet fragmentation and retransmissions for data and management frames.
Definition: txop.h:65