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);
118 phy->SetErrorRateModel (error);
119 phy->SetChannel (channel);
120 phy->SetDevice (dev);
121 phy->SetMobility (node);
127 mac->SetAddress (Mac48Address::Allocate ());
130 dev->SetRemoteStationManager (manager);
145 CreateOne (Vector (0.0, 0.0, 0.0), channel);
146 CreateOne (Vector (5.0, 0.0, 0.0), channel);
147 CreateOne (Vector (5.0, 0.0, 0.0), channel);
149 Simulator::Stop (
Seconds (10.0));
152 Simulator::Destroy ();
224 virtual void DoRun (
void);
236 :
TestCase (
"InterferenceHelperSequence")
265 phy->SetErrorRateModel (error);
266 phy->SetChannel (channel);
267 phy->SetDevice (dev);
268 phy->SetMobility (node);
274 mac->SetAddress (Mac48Address::Allocate ());
277 dev->SetRemoteStationManager (manager);
301 propLoss->SetDefaultLoss (999);
303 Simulator::Schedule (
Seconds (1.0),
305 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
307 Simulator::Schedule (
Seconds (1.0000001),
309 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
311 Simulator::Schedule (
Seconds (5.0),
313 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
315 Simulator::Schedule (
Seconds (7.0),
317 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
319 Simulator::Stop (
Seconds (100.0));
322 Simulator::Destroy ();
363 virtual void DoRun (
void);
381 :
TestCase (
"Test case for Bug 555")
416 RngSeedManager::SetSeed (1);
417 RngSeedManager::SetRun (17);
429 Ptr<Node> txNode = CreateObject<Node> ();
442 txPhy->SetErrorRateModel (txError);
443 txPhy->SetChannel (channel);
444 txPhy->SetDevice (txDev);
445 txPhy->SetMobility (txNode);
452 txMac->SetAddress (Mac48Address::Allocate ());
453 txDev->SetMac (txMac);
454 txDev->SetPhy (txPhy);
465 Simulator::Stop (
Seconds (2.0));
467 Simulator::Destroy ();
473 uint32_t expectedWait1 = 1408 + (0 * 9) + 16 + 18;
void NotifyPhyTxBegin(Ptr< const Packet > p)
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
AttributeValue implementation for Boolean.
void SetPropagationLossModel(Ptr< PropagationLossModel > loss)
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
void ConfigureStandard(enum WifiPhyStandard standard)
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet. ...
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
InterferenceHelperSequenceTest()
Keep track of the current position and velocity of an object.
Ptr< WifiPhy > GetPhy(void) const
Ptr< Node > CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
This queue contains packets for a particular access class.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Time m_secondTransmissionTime
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
base class for all MAC-level wifi objects.
Time m_firstTransmissionTime
#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.
QosUtilsIsOldPacketTest()
calculate a propagation delay.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
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)
Aggregate two Objects together.
void SwitchCh(Ptr< WifiNetDevice > dev)
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)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
static WifiTestSuite g_wifiTestSuite
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void DoRun(void)
Implementation to actually run this TestCase.
ObjectFactory m_propDelay
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
virtual void SetChannelNumber(uint16_t id)=0
Set channel number.
void SetPosition(const Vector &position)
ObjectFactory m_propDelay
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
virtual Address GetBroadcast(void) const
unsigned int m_numSentPackets
Instantiate subclasses of ns3::Object.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
ObjectFactory m_propDelay
Time Seconds(double value)
Construct a Time in the indicated unit.
void SendOnePacket(Ptr< WifiNetDevice > dev)
void SendOnePacket(Ptr< WifiNetDevice > dev)
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
handle packet fragmentation and retransmissions.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Make sure that when multiple broadcast packets are queued on the same device in a short succession no...
virtual void DoRun(void)
Implementation to actually run this TestCase.