21 #include "ns3/rng-seed-manager.h"
22 #include "ns3/config.h"
23 #include "ns3/data-rate.h"
24 #include "ns3/vector.h"
25 #include "ns3/string.h"
27 #include "ns3/packet-socket-address.h"
28 #include "ns3/mobility-model.h"
29 #include "ns3/on-off-helper.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/nqos-wifi-mac-helper.h"
35 #include "ns3/wifi-net-device.h"
38 #include "ns3/ocb-wifi-mac.h"
39 #include "ns3/wifi-80211p-helper.h"
40 #include "ns3/wave-mac-helper.h"
48 int64_t currentStream = stream;
81 virtual void DoRun (
void);
86 Vector GetCurrentPosition (uint32_t i);
89 void PreRandomConfiguration (
void);
110 :
TestCase (
"Association time: Ap+Sta mode vs Adhoc mode vs Ocb mode")
209 "ControlMode",
StringValue (
"OfdmRate6MbpsBW10MHz"));
210 wifi.
Install (wifiPhy, wifiStaMac, mobile_node);
211 wifi.
Install (wifiPhy, wifiApMac, static_node);
222 wifiMac.
SetType (
"ns3::AdhocWifiMac");
228 "ControlMode",
StringValue (
"OfdmRate6MbpsBW10MHz"));
229 wifi.
Install (wifiPhy, wifiMac, mobile_node);
230 wifi.
Install (wifiPhy, wifiMac, static_node);
245 "ControlMode",
StringValue (
"OfdmRate6MbpsBW10MHz"));
246 wifi80211p.
Install (wifiPhy, wifi80211pMac, mobile_node);
247 wifi80211p.
Install (wifiPhy, wifi80211pMac, static_node);
267 mobility.
Install (mobile_node);
268 mobility.Install (static_node);
282 packetSocket.
Install (static_node);
283 packetSocket.
Install (mobile_node);
288 apps.
Start (Seconds (0.5));
289 apps.
Stop (Seconds (70.0));
315 std::cout <<
"test time point for Ap-Sta mode" << std::endl;
323 Simulator::Stop (Seconds (71.0));
325 Simulator::Destroy ();
335 std::cout <<
"test time point for Adhoc mode" << std::endl;
343 Simulator::Stop (Seconds (71.0));
345 Simulator::Destroy ();
355 std::cout <<
"test time point for Ocb mode" << std::endl;
363 Simulator::Stop (Seconds (71.0));
365 Simulator::Destroy ();
376 RngSeedManager::SetSeed (1);
377 RngSeedManager::SetRun (17);
holds a vector of ns3::Application pointers.
helps to create wifi 802.11p objects of WifiNetDevice class
double x
x coordinate of vector
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
static void AdvancePosition(Ptr< Node > node)
void MacAssoc(std::string context, Mac48Address bssid)
Ptr< YansWifiChannel > Create(void) const
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())
hold variables of type string
Make it easy to create and manage PHY objects for the yans model.
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())
virtual Address GetAddress(void) const
an address for a packet socket
#define NS_ASSERT(condition)
Vector GetPosition(void) const
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
void ConfigureOcbMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void Connect(std::string path, const CallbackBase &cb)
static OcbTestSuite ocbTestSuite
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
helps to create WifiNetDevice objects
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
a polymophic address class
Class for representing data rates.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Keep track of the current position and velocity of an object.
void SetChannel(Ptr< YansWifiChannel > channel)
#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.
This queue contains packets for a particular access class.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
virtual ~OcbWifiMacTestCase(void)
virtual void SetStandard(enum WifiPhyStandard standard)
Vector GetCurrentPosition(uint32_t i)
Ptr< NetDevice > GetDevice(uint32_t index) const
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
void PhyRxOkTrace(std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
create non QoS-enabled MAC layers for a ns3::WifiNetDevice.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
void AdvancePosition(Ptr< Node > node)
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &macHelper, NodeContainer c) const
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
void SetPhysicalAddress(const Address address)
keep track of a set of node pointers.
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
void PostDeviceConfiguration(Ptr< Node > static_node, Ptr< Node > mobile_node)
virtual void DoRun(void)
static-node:0 <-— mobile-node:1
manage and create wifi channel objects for the yans model.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
void GetAttribute(std::string name, AttributeValue &value) const
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void SetPosition(const Vector &position)
The IEEE 802.11 SSID Information Element.
int64_t GetNanoSeconds(void) const
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
Helper class used to assign positions and mobility models to nodes.
void ConfigureApStaMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
hold objects of type ns3::Ssid
void SetProtocol(uint16_t protocol)
#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.
Ptr< WifiMac > GetMac(void) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void PreRandomConfiguration(void)
handle packet fragmentation and retransmissions.
void ConfigureAdhocMode(Ptr< Node > static_node, Ptr< Node > mobile_node)
Ptr< T > GetObject(void) const
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
#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.