23 #include "ns3/wifi-net-device.h"
24 #include "ns3/yans-wifi-channel.h"
25 #include "ns3/adhoc-wifi-mac.h"
26 #include "ns3/yans-wifi-phy.h"
27 #include "ns3/arf-wifi-manager.h"
28 #include "ns3/propagation-delay-model.h"
29 #include "ns3/propagation-loss-model.h"
30 #include "ns3/error-rate-model.h"
31 #include "ns3/yans-error-rate-model.h"
32 #include "ns3/constant-position-mobility-model.h"
34 #include "ns3/simulator.h"
36 #include "ns3/object-factory.h"
37 #include "ns3/dca-txop.h"
38 #include "ns3/mac-rx-middle.h"
39 #include "ns3/pointer.h"
40 #include "ns3/rng-seed-manager.h"
41 #include "ns3/edca-txop-n.h"
42 #include "ns3/config.h"
43 #include "ns3/boolean.h"
52 int64_t currentStream = stream;
84 virtual void DoRun (
void);
104 dev->Send (p, dev->GetBroadcast (), 1);
118 phy->SetErrorRateModel (error);
119 phy->SetChannel (channel);
120 phy->SetDevice (dev);
121 phy->SetMobility (node);
125 mobility->SetPosition (pos);
130 dev->SetRemoteStationManager (manager);
142 channel->SetPropagationDelayModel (propDelay);
143 channel->SetPropagationLossModel (propLoss);
225 virtual void DoRun (
void);
237 :
TestCase (
"InterferenceHelperSequence")
245 dev->Send (p, dev->GetBroadcast (), 1);
266 phy->SetErrorRateModel (error);
267 phy->SetChannel (channel);
268 phy->SetDevice (dev);
269 phy->SetMobility (node);
273 mobility->SetPosition (pos);
278 dev->SetRemoteStationManager (manager);
294 channel->SetPropagationDelayModel (propDelay);
295 channel->SetPropagationLossModel (propLoss);
302 propLoss->SetDefaultLoss (999);
306 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
310 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
314 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
318 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
365 virtual void DoRun (
void);
383 :
TestCase (
"Test case for Bug 555")
406 dev->Send (p, dev->GetBroadcast (), 1);
428 channel->SetPropagationDelayModel (propDelay);
429 channel->SetPropagationLossModel (propLoss);
431 Ptr<Node> txNode = CreateObject<Node> ();
444 txPhy->SetErrorRateModel (txError);
445 txPhy->SetChannel (channel);
446 txPhy->SetDevice (txDev);
447 txPhy->SetMobility (txNode);
452 txMobility->SetPosition (
Vector (0.0, 0.0, 0.0));
455 txDev->SetMac (txMac);
456 txDev->SetPhy (txPhy);
475 uint32_t expectedWait1 = 1408 + (0 * 9) + 16 + 18;
476 Time expectedSecondTransmissionTime = MicroSeconds (expectedWait1) + Seconds (1.0);
void SendOnePacket(Ptr< WifiNetDevice > dev)
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
keep track of time values and allow control of global simulation resolution
ObjectFactory m_propDelay
smart pointer class similar to boost::intrusive_ptr
ObjectFactory m_propDelay
Time m_firstTransmissionTime
void SendOnePacket(Ptr< WifiNetDevice > dev)
unsigned int m_numSentPackets
static void Run(void)
Run the simulation until one of:
void ConfigureStandard(enum WifiPhyStandard standard)
InterferenceHelperSequenceTest()
void SetTypeId(TypeId tid)
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet. ...
virtual void DoRun(void)
Implementation to actually run this TestCase.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
ObjectFactory m_propDelay
static void SetRun(uint64_t run)
Set the run number of simulation.
Keep track of the current position and velocity of an object.
This queue contains packets for a particular access class.
void SwitchCh(Ptr< WifiNetDevice > dev)
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
Ptr< Object > Create(void) const
base class for all MAC-level wifi objects.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
virtual void DoRun(void)
Implementation to actually run this TestCase.
calculate a propagation delay.
Ptr< NetDevice > GetDevice(uint32_t index) const
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Ptr< Node > CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
hold a list of per-remote-station state.
void AggregateObject(Ptr< Object > other)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void SetDefault(std::string name, const AttributeValue &value)
OFDM PHY for the 5 GHz band (Clause 17)
QosUtilsIsOldPacketTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
void GetAttribute(std::string name, AttributeValue &value) const
static Time Now(void)
Return the "current simulation time".
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
virtual void SetChannelNumber(uint16_t id)=0
Set channel number.
static void SetSeed(uint32_t seed)
set the seed it will duplicate the seed value 6 times
#define NS_ASSERT_MSG(condition, message)
instantiate subclasses of ns3::Object.
void SendOnePacket(Ptr< WifiNetDevice > dev)
uint32_t AddDevice(Ptr< NetDevice > device)
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Time m_secondTransmissionTime
void CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
handle packet fragmentation and retransmissions.
static WifiTestSuite g_wifiTestSuite
void NotifyPhyTxBegin(Ptr< const Packet > p)
Ptr< T > GetObject(void) const
Make sure that when multiple broadcast packets are queued on the same device in a short succession no...
#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.