22 #include "ns3/simulator.h"
23 #include "ns3/dcf-manager.h"
33 void QueueTx (uint64_t txTime, uint64_t expectedGrantTime);
34 bool IsEdca (
void)
const;
39 virtual void DoNotifyAccessGranted (
void);
40 virtual void DoNotifyInternalCollision (
void);
41 virtual void DoNotifyCollision (
void);
42 virtual void DoNotifyChannelSwitching (
void);
43 virtual void DoNotifySleep (
void);
44 virtual void DoNotifyWakeUp (
void);
67 virtual void DoRun (
void);
69 void NotifyAccessGranted (uint32_t i);
70 void NotifyInternalCollision (uint32_t i);
71 void NotifyCollision (uint32_t i);
72 void NotifyChannelSwitching (uint32_t i);
76 void StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue = 20);
77 void AddDcfState (uint32_t aifsn);
79 void ExpectInternalCollision (uint64_t time, uint32_t from, uint32_t nSlots);
80 void ExpectCollision (uint64_t time, uint32_t from, uint32_t nSlots);
81 void AddRxOkEvt (uint64_t at, uint64_t duration);
82 void AddRxErrorEvt (uint64_t at, uint64_t duration);
83 void AddRxInsideSifsEvt (uint64_t at, uint64_t duration);
84 void AddTxEvt (uint64_t at, uint64_t duration);
85 void AddNavReset (uint64_t at, uint64_t duration);
86 void AddNavStart (uint64_t at, uint64_t duration);
87 void AddAckTimeoutReset (uint64_t at);
88 void AddAccessRequest (uint64_t at, uint64_t txTime,
89 uint64_t expectedGrantTime, uint32_t from);
90 void AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime,
91 uint64_t expectedGrantTime, uint32_t from);
97 void AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime,
98 uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from);
99 void DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime,
DcfStateTest *state);
100 void AddCcaBusyEvt (uint64_t at, uint64_t duration);
101 void AddSwitchingEvt (uint64_t at, uint64_t duration);
102 void AddRxStartEvt (uint64_t at, uint64_t duration);
265 Simulator::Destroy ();
331 uint64_t expectedGrantTime, uint32_t from)
338 uint64_t expectedGrantTime, uint32_t from)
347 uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from)
359 state->
QueueTx (txTime, expectedGrantTime);
std::pair< uint64_t, uint64_t > ExpectedGrant
DcfManager * m_dcfManager
virtual void DoNotifyAccessGranted(void)
Called by DcfManager to notify a DcfState subclass that access to the medium is granted and can start...
static DcfTestSuite g_dcfTestSuite
void RequestAccess(DcfState *state)
ExpectedCollisions m_expectedInternalCollision
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void AddRxOkEvt(uint64_t at, uint64_t duration)
void AddAccessRequestWithAckTimeout(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from)
DcfStateTest(DcfManagerTest *test, uint32_t i)
void AddSwitchingEvt(uint64_t at, uint64_t duration)
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
void SetAifsn(uint32_t aifsn)
std::list< ExpectedGrant > ExpectedGrants
void AddTxEvt(uint64_t at, uint64_t duration)
void ExpectInternalCollision(uint64_t time, uint32_t from, uint32_t nSlots)
virtual void DoNotifyCollision(void)
Called by DcfManager to notify a DcfState subclass that a normal collision occured, that is, that the medium was busy when access was requested.
void DoAccessRequest(uint64_t txTime, uint64_t expectedGrantTime, DcfStateTest *state)
void AddRxInsideSifsEvt(uint64_t at, uint64_t duration)
void NotifyChannelSwitching(uint32_t i)
void StartTest(uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue=20)
ExpectedCollisions m_expectedCollision
void AddAckTimeoutReset(uint64_t at)
virtual void DoNotifySleep(void)
Called by DcfManager to notify a DcfState subclass that the device has begun to sleep.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
void NotifyTxStartNow(Time duration)
void NotifyAckTimeoutStartNow(Time duration)
Notify that ACK timer has started for the given duration.
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
void NotifyCollision(uint32_t i)
keep track of the state needed for a single DCF function.
void AddNavReset(uint64_t at, uint64_t duration)
void AddCcaBusyEvt(uint64_t at, uint64_t duration)
virtual void DoNotifyWakeUp(void)
Called by DcfManager to notify a DcfState subclass that the device has begun to wake up...
void StartBackoffNow(uint32_t nSlots)
ExpectedGrants m_expectedGrants
void SetEifsNoDifs(Time eifsNoDifs)
uint32_t m_ackTimeoutValue
void AddRxStartEvt(uint64_t at, uint64_t duration)
std::list< struct ExpectedCollision > ExpectedCollisions
void SetSlot(Time slotTime)
void ExpectCollision(uint64_t time, uint32_t from, uint32_t nSlots)
void NotifyAccessGranted(uint32_t i)
virtual void DoNotifyChannelSwitching(void)
Called by DcfManager to notify a DcfState subclass that a channel switching occured.
void NotifyInternalCollision(uint32_t i)
void AddNavStart(uint64_t at, uint64_t duration)
void AddAccessRequest(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from)
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.
virtual void DoNotifyInternalCollision(void)
Called by DcfManager to notify a DcfState subclass that an 'internal' collision occured, that is, that the backoff timer of a higher priority DcfState expired at the same time and that access was granted to this higher priority DcfState.
void AddDcfState(uint32_t aifsn)
void AddAccessRequestWithSuccessfullAck(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from)
std::vector< DcfStateTest * > DcfStates
void AddRxErrorEvt(uint64_t at, uint64_t duration)
void test(void)
Example use of ns3::SystemThread.
void QueueTx(uint64_t txTime, uint64_t expectedGrantTime)
virtual void DoRun(void)
Implementation to actually run this TestCase.