author | Quincy Tse <quincy.tse@gmail.com> |
Mon, 07 Jun 2010 16:22:21 +0200 | |
changeset 6340 | fe24c9edacb6 |
parent 5815 | 5629104d7747 |
child 6774 | 034f362af24d |
permissions | -rw-r--r-- |
2097 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
4325
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
2 |
/* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
4 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
7 |
* published by the Free Software Foundation; |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
8 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
12 |
* GNU General Public License for more details. |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
13 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
17 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2547
diff
changeset
|
19 |
*/ |
2097 | 20 |
|
21 |
#include "ns3/test.h" |
|
22 |
#include "ns3/simulator.h" |
|
23 |
#include "dcf-manager.h" |
|
24 |
||
25 |
namespace ns3 { |
|
26 |
||
27 |
class DcfManagerTest; |
|
28 |
||
29 |
class DcfStateTest : public DcfState |
|
30 |
{ |
|
31 |
public: |
|
32 |
DcfStateTest (DcfManagerTest *test, uint32_t i); |
|
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
33 |
void QueueTx (uint64_t txTime, uint64_t expectedGrantTime); |
2097 | 34 |
private: |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
35 |
friend class DcfManagerTest; |
2145
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
36 |
virtual void DoNotifyAccessGranted (void); |
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
37 |
virtual void DoNotifyInternalCollision (void); |
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
38 |
virtual void DoNotifyCollision (void); |
5189 | 39 |
virtual void DoNotifyChannelSwitching (void); |
2097 | 40 |
|
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
41 |
typedef std::pair<uint64_t,uint64_t> ExpectedGrant; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
42 |
typedef std::list<ExpectedGrant> ExpectedGrants; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
43 |
struct ExpectedCollision { |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
44 |
uint64_t at; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
45 |
uint32_t nSlots; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
46 |
}; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
47 |
typedef std::list<struct ExpectedCollision> ExpectedCollisions; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
48 |
|
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
49 |
ExpectedCollisions m_expectedInternalCollision; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
50 |
ExpectedCollisions m_expectedCollision; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
51 |
ExpectedGrants m_expectedGrants; |
2097 | 52 |
DcfManagerTest *m_test; |
53 |
uint32_t m_i; |
|
54 |
}; |
|
55 |
||
56 |
||
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
57 |
class DcfManagerTest : public TestCase |
2097 | 58 |
{ |
59 |
public: |
|
60 |
DcfManagerTest (); |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
61 |
virtual bool DoRun (void); |
2097 | 62 |
|
63 |
||
64 |
void NotifyAccessGranted (uint32_t i); |
|
65 |
void NotifyInternalCollision (uint32_t i); |
|
66 |
void NotifyCollision (uint32_t i); |
|
5189 | 67 |
void NotifyChannelSwitching (uint32_t i); |
2097 | 68 |
|
69 |
||
70 |
private: |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
71 |
void StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue = 20); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
72 |
void AddDcfState (uint32_t aifsn); |
2097 | 73 |
void EndTest (void); |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
74 |
void ExpectInternalCollision (uint64_t time, uint32_t from, uint32_t nSlots); |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
75 |
void ExpectCollision (uint64_t time, uint32_t from, uint32_t nSlots); |
2098 | 76 |
void AddRxOkEvt (uint64_t at, uint64_t duration); |
77 |
void AddRxErrorEvt (uint64_t at, uint64_t duration); |
|
4598
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
78 |
void AddRxInsideSifsEvt (uint64_t at, uint64_t duration); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
79 |
void AddTxEvt (uint64_t at, uint64_t duration); |
2098 | 80 |
void AddNavReset (uint64_t at, uint64_t duration); |
81 |
void AddNavStart (uint64_t at, uint64_t duration); |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
82 |
void AddAckTimeoutReset (uint64_t at); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
83 |
void AddAccessRequest (uint64_t at, uint64_t txTime, |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
84 |
uint64_t expectedGrantTime, uint32_t from); |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
85 |
void AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
86 |
uint64_t expectedGrantTime, uint32_t from); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
87 |
///\param ackDelay is delay of the ack after txEnd |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
88 |
void AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
89 |
uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
90 |
void DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, DcfStateTest *state); |
5189 | 91 |
void AddCcaBusyEvt (uint64_t at, uint64_t duration); |
92 |
void AddSwitchingEvt (uint64_t at, uint64_t duration); |
|
93 |
void AddRxStartEvt (uint64_t at, uint64_t duration); |
|
2098 | 94 |
|
2101
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
95 |
typedef std::vector<DcfStateTest *> DcfStates; |
2097 | 96 |
|
97 |
DcfManager *m_dcfManager; |
|
98 |
DcfStates m_dcfStates; |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
99 |
uint32_t m_ackTimeoutValue; |
2097 | 100 |
}; |
101 |
||
102 |
||
103 |
||
104 |
DcfStateTest::DcfStateTest (DcfManagerTest *test, uint32_t i) |
|
105 |
: m_test (test), m_i(i) |
|
106 |
{} |
|
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
107 |
void |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
108 |
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime) |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
109 |
{ |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
110 |
m_expectedGrants.push_back (std::make_pair (txTime, expectedGrantTime)); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
111 |
} |
2097 | 112 |
void |
2145
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
113 |
DcfStateTest::DoNotifyAccessGranted (void) |
2097 | 114 |
{ |
115 |
m_test->NotifyAccessGranted (m_i); |
|
116 |
} |
|
117 |
void |
|
2145
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
118 |
DcfStateTest::DoNotifyInternalCollision (void) |
2097 | 119 |
{ |
120 |
m_test->NotifyInternalCollision (m_i); |
|
121 |
} |
|
122 |
void |
|
2145
8f3c8ef34b0a
use a simple request/grant scheme for dcf accesses
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2143
diff
changeset
|
123 |
DcfStateTest::DoNotifyCollision (void) |
2097 | 124 |
{ |
125 |
m_test->NotifyCollision (m_i); |
|
126 |
} |
|
5189 | 127 |
void |
128 |
DcfStateTest::DoNotifyChannelSwitching (void) |
|
129 |
{ |
|
130 |
m_test->NotifyChannelSwitching (m_i); |
|
131 |
} |
|
2097 | 132 |
|
133 |
||
134 |
DcfManagerTest::DcfManagerTest () |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
135 |
: TestCase ("DcfManager") |
2097 | 136 |
{} |
137 |
||
138 |
void |
|
139 |
DcfManagerTest::NotifyAccessGranted (uint32_t i) |
|
140 |
{ |
|
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
141 |
DcfStateTest *state = m_dcfStates[i]; |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
142 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedGrants.empty (), false, "Have expected grants"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
143 |
std::pair<uint64_t, uint64_t> expected = state->m_expectedGrants.front (); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
144 |
state->m_expectedGrants.pop_front (); |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
145 |
NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.second), "Expected access grant is now"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
146 |
m_dcfManager->NotifyTxStartNow (MicroSeconds (expected.first)); |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
147 |
m_dcfManager->NotifyAckTimeoutStartNow (MicroSeconds (m_ackTimeoutValue + expected.first)); |
2097 | 148 |
} |
4598
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
149 |
void |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
150 |
DcfManagerTest::AddTxEvt (uint64_t at, uint64_t duration) |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
151 |
{ |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
152 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
153 |
&DcfManager::NotifyTxStartNow, m_dcfManager, |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
154 |
MicroSeconds (duration)); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
155 |
} |
2097 | 156 |
void |
157 |
DcfManagerTest::NotifyInternalCollision (uint32_t i) |
|
2098 | 158 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
159 |
DcfStateTest *state = m_dcfStates[i]; |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
160 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedInternalCollision.empty (), false, "Have expected internal collisions"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
161 |
struct DcfStateTest::ExpectedCollision expected = state->m_expectedInternalCollision.front (); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
162 |
state->m_expectedInternalCollision.pop_front (); |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
163 |
NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.at), "Expected internal collision time is now"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
164 |
state->StartBackoffNow (expected.nSlots); |
2098 | 165 |
} |
2097 | 166 |
void |
167 |
DcfManagerTest::NotifyCollision (uint32_t i) |
|
2098 | 168 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
169 |
DcfStateTest *state = m_dcfStates[i]; |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
170 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedCollision.empty (), false, "Have expected collisions"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
171 |
struct DcfStateTest::ExpectedCollision expected = state->m_expectedCollision.front (); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
172 |
state->m_expectedCollision.pop_front (); |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
173 |
NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.at), "Expected collision is now"); |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
174 |
state->StartBackoffNow (expected.nSlots); |
2098 | 175 |
} |
5189 | 176 |
void |
177 |
DcfManagerTest::NotifyChannelSwitching (uint32_t i) |
|
178 |
{ |
|
179 |
DcfStateTest *state = m_dcfStates[i]; |
|
180 |
if (!state->m_expectedGrants.empty ()) |
|
181 |
{ |
|
182 |
std::pair<uint64_t, uint64_t> expected = state->m_expectedGrants.front (); |
|
183 |
state->m_expectedGrants.pop_front (); |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
184 |
NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.second), "Expected grant is now"); |
5189 | 185 |
} |
186 |
} |
|
2097 | 187 |
|
188 |
void |
|
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
189 |
DcfManagerTest::ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from) |
2098 | 190 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
191 |
DcfStateTest *state = m_dcfStates[from]; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
192 |
struct DcfStateTest::ExpectedCollision col; |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
193 |
col.at = time; |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
194 |
col.nSlots = nSlots; |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
195 |
state->m_expectedInternalCollision.push_back (col); |
2098 | 196 |
} |
197 |
void |
|
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
198 |
DcfManagerTest::ExpectCollision (uint64_t time, uint32_t nSlots, uint32_t from) |
2098 | 199 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
200 |
DcfStateTest *state = m_dcfStates[from]; |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
201 |
struct DcfStateTest::ExpectedCollision col; |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
202 |
col.at = time; |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
203 |
col.nSlots = nSlots; |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
204 |
state->m_expectedCollision.push_back (col); |
2098 | 205 |
} |
2097 | 206 |
|
207 |
void |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
208 |
DcfManagerTest::StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue) |
2097 | 209 |
{ |
210 |
m_dcfManager = new DcfManager (); |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
211 |
m_dcfManager->SetSlot (MicroSeconds (slotTime)); |
2105
e883a100109a
get rid of MacParameters from DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2104
diff
changeset
|
212 |
m_dcfManager->SetSifs (MicroSeconds (sifs)); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
213 |
m_dcfManager->SetEifsNoDifs (MicroSeconds (eifsNoDifsNoSifs+sifs)); |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
214 |
m_ackTimeoutValue = ackTimeoutValue; |
2097 | 215 |
} |
216 |
||
217 |
void |
|
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
218 |
DcfManagerTest::AddDcfState (uint32_t aifsn) |
2097 | 219 |
{ |
2101
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
220 |
DcfStateTest *state = new DcfStateTest (this, m_dcfStates.size ()); |
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
221 |
state->SetAifsn (aifsn); |
2097 | 222 |
m_dcfStates.push_back (state); |
2101
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
223 |
m_dcfManager->Add (state); |
2097 | 224 |
} |
225 |
||
226 |
void |
|
227 |
DcfManagerTest::EndTest (void) |
|
228 |
{ |
|
229 |
Simulator::Run (); |
|
230 |
Simulator::Destroy (); |
|
2101
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
231 |
for (DcfStates::const_iterator i = m_dcfStates.begin (); i != m_dcfStates.end (); i++) |
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
232 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
233 |
DcfStateTest *state = *i; |
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
234 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedGrants.empty (), true, "Have no expected grants"); |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
235 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedInternalCollision.empty (), true, "Have no internal collisions"); |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
236 |
NS_TEST_EXPECT_MSG_EQ (state->m_expectedCollision.empty (), true, "Have no expected collisions"); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
237 |
delete state; |
2101
05c4a31c0a58
simplify memory management
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2098
diff
changeset
|
238 |
} |
2097 | 239 |
m_dcfStates.clear (); |
240 |
delete m_dcfManager; |
|
241 |
} |
|
242 |
||
2098 | 243 |
void |
244 |
DcfManagerTest::AddRxOkEvt (uint64_t at, uint64_t duration) |
|
245 |
{ |
|
246 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
247 |
&DcfManager::NotifyRxStartNow, m_dcfManager, |
|
248 |
MicroSeconds (duration)); |
|
249 |
Simulator::Schedule (MicroSeconds (at+duration) - Now (), |
|
250 |
&DcfManager::NotifyRxEndOkNow, m_dcfManager); |
|
251 |
} |
|
4598
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
252 |
void |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
253 |
DcfManagerTest::AddRxInsideSifsEvt (uint64_t at, uint64_t duration) |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
254 |
{ |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
255 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
256 |
&DcfManager::NotifyRxStartNow, m_dcfManager, |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
257 |
MicroSeconds (duration)); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
258 |
} |
2098 | 259 |
void |
260 |
DcfManagerTest::AddRxErrorEvt (uint64_t at, uint64_t duration) |
|
261 |
{ |
|
262 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
263 |
&DcfManager::NotifyRxStartNow, m_dcfManager, |
|
264 |
MicroSeconds (duration)); |
|
265 |
Simulator::Schedule (MicroSeconds (at+duration) - Now (), |
|
266 |
&DcfManager::NotifyRxEndErrorNow, m_dcfManager); |
|
267 |
} |
|
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
268 |
|
2098 | 269 |
void |
270 |
DcfManagerTest::AddNavReset (uint64_t at, uint64_t duration) |
|
271 |
{ |
|
272 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
273 |
&DcfManager::NotifyNavResetNow, m_dcfManager, |
|
274 |
MicroSeconds (duration)); |
|
275 |
} |
|
276 |
void |
|
277 |
DcfManagerTest::AddNavStart (uint64_t at, uint64_t duration) |
|
278 |
{ |
|
279 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
280 |
&DcfManager::NotifyNavStartNow, m_dcfManager, |
|
281 |
MicroSeconds (duration)); |
|
282 |
} |
|
283 |
void |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
284 |
DcfManagerTest::AddAckTimeoutReset (uint64_t at) |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
285 |
{ |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
286 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
287 |
&DcfManager::NotifyAckTimeoutResetNow, m_dcfManager); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
288 |
} |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
289 |
void |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
290 |
DcfManagerTest::AddAccessRequest (uint64_t at, uint64_t txTime, |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
291 |
uint64_t expectedGrantTime, uint32_t from) |
2098 | 292 |
{ |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
293 |
AddAccessRequestWithSuccessfullAck (at, txTime, expectedGrantTime, 0, from); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
294 |
} |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
295 |
void |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
296 |
DcfManagerTest::AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
297 |
uint64_t expectedGrantTime, uint32_t from) |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
298 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
299 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
300 |
&DcfManagerTest::DoAccessRequest, this, |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
301 |
txTime, expectedGrantTime, m_dcfStates[from]); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
302 |
} |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
303 |
void |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
304 |
DcfManagerTest::AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
305 |
uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from) |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
306 |
{ |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
307 |
NS_ASSERT(ackDelay < m_ackTimeoutValue); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
308 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
309 |
&DcfManagerTest::DoAccessRequest, this, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
310 |
txTime, expectedGrantTime, m_dcfStates[from]); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
311 |
AddAckTimeoutReset (expectedGrantTime + txTime + ackDelay); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
312 |
} |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
313 |
void |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
314 |
DcfManagerTest::DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, DcfStateTest *state) |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
315 |
{ |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
316 |
state->QueueTx (txTime, expectedGrantTime); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
317 |
m_dcfManager->RequestAccess (state); |
2098 | 318 |
} |
5189 | 319 |
void |
320 |
DcfManagerTest::AddCcaBusyEvt (uint64_t at, uint64_t duration) |
|
321 |
{ |
|
322 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
323 |
&DcfManager::NotifyMaybeCcaBusyStartNow, m_dcfManager, |
|
324 |
MicroSeconds (duration)); |
|
325 |
} |
|
326 |
void |
|
327 |
DcfManagerTest::AddSwitchingEvt (uint64_t at, uint64_t duration) |
|
328 |
{ |
|
329 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
330 |
&DcfManager::NotifySwitchingStartNow, m_dcfManager, |
|
331 |
MicroSeconds (duration)); |
|
332 |
} |
|
333 |
void |
|
334 |
DcfManagerTest::AddRxStartEvt (uint64_t at, uint64_t duration) |
|
335 |
{ |
|
336 |
Simulator::Schedule (MicroSeconds (at) - Now (), |
|
337 |
&DcfManager::NotifyRxStartNow, m_dcfManager, |
|
338 |
MicroSeconds (duration)); |
|
339 |
} |
|
2098 | 340 |
|
341 |
||
342 |
||
343 |
bool |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
344 |
DcfManagerTest::DoRun (void) |
2098 | 345 |
{ |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
346 |
// 0 3 4 5 8 9 10 12 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
347 |
// | sifs | aifsn | tx | sifs | aifsn | | tx | |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
348 |
// |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
349 |
StartTest (1, 3, 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
350 |
AddDcfState (1); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
351 |
AddAccessRequest (1, 1, 4, 0); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
352 |
AddAccessRequest (10, 2, 10, 0); |
2098 | 353 |
EndTest (); |
4598
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
354 |
// Check that receiving inside SIFS shall be cancelled properly: |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
355 |
// 0 3 4 5 8 9 12 13 14 |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
356 |
// | sifs | aifsn | tx | sifs | ack | sifs | aifsn | |tx | |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
357 |
// |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
358 |
StartTest (1, 3, 10); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
359 |
AddDcfState (1); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
360 |
AddAccessRequest (1, 1, 4, 0); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
361 |
AddRxInsideSifsEvt (6, 10); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
362 |
AddTxEvt(8, 1); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
363 |
AddAccessRequest (14, 2, 14, 0); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
364 |
EndTest (); |
9b07308116ed
bug 595: PHY may start receive packet inside SIFS
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4509
diff
changeset
|
365 |
|
2098 | 366 |
|
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
367 |
// The test below mainly intends to test the case where the medium |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
368 |
// becomes busy in the middle of a backoff slot: the backoff counter |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
369 |
// must not be decremented for this backoff slot. This is the case |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
370 |
// below for the backoff slot starting at time 78us. |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
371 |
// |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
372 |
// 20 60 66 70 74 78 80 100 106 110 114 118 120 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
373 |
// | rx | sifs | aifsn | bslot0 | bslot1 | | rx | sifs | aifsn | bslot2 | bslot3 | tx | |
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
374 |
// | |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
375 |
// 30 request access. backoff slots: 4 |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
376 |
StartTest (4, 6, 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
377 |
AddDcfState (1); |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
378 |
AddRxOkEvt (20, 40); |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
379 |
AddRxOkEvt (80, 20); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
380 |
AddAccessRequest (30, 2, 118, 0); |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
381 |
ExpectCollision (30, 4, 0); // backoff: 4 slots |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
382 |
EndTest (); |
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
383 |
|
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
384 |
// Test the case where the backoff slots is zero. |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
385 |
// |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
386 |
// 20 60 66 70 72 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
387 |
// | rx | sifs | aifsn | tx | |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
388 |
// | |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
389 |
// 30 request access. backoff slots: 0 |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
390 |
StartTest (4, 6 , 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
391 |
AddDcfState (1); |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
392 |
AddRxOkEvt (20, 40); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
393 |
AddAccessRequest (30, 2, 70, 0); |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
394 |
ExpectCollision (30, 0, 0); // backoff: 0 slots |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
395 |
EndTest (); |
4686
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
396 |
// Test shows when two frames are received without interval between |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
397 |
// them: |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
398 |
// 20 60 100 106 110 112 |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
399 |
// | rx | rx |sifs | aifsn | tx | |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
400 |
// | |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
401 |
// 30 request access. backoff slots: 0 |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
402 |
|
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
403 |
StartTest (4, 6 , 10); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
404 |
AddDcfState (1); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
405 |
AddRxOkEvt (20, 40); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
406 |
AddRxOkEvt (60, 40); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
407 |
AddAccessRequest (30, 2, 110, 0); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
408 |
ExpectCollision (30, 0, 0); // backoff: 0 slots |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
409 |
EndTest (); |
f17f12944235
Bug 625: Wrong calculation of GetAccessGrantStart in DcfManager.
Kirill Andreev <andreev@iitp.ru>
parents:
4598
diff
changeset
|
410 |
|
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
411 |
|
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
412 |
// The test below is subject to some discussion because I am |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
413 |
// not sure I understand the intent of the spec here. |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
414 |
// i.e., what happens if you make a request to get access |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
415 |
// to the medium during the difs idle time after a busy period ? |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
416 |
// do you need to start a backoff ? Or do you need to wait until |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
417 |
// the end of difs and access the medium ? |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
418 |
// Here, we wait until the end of difs and access the medium. |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
419 |
// |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
420 |
// 20 60 66 70 72 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
421 |
// | rx | sifs | aifsn | tx | |
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
422 |
// | |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
423 |
// 62 request access. |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
424 |
// |
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
425 |
StartTest (4, 6 , 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
426 |
AddDcfState (1); |
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
427 |
AddRxOkEvt (20, 40); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
428 |
AddAccessRequest (62, 2, 70, 0); |
2121
60c0176e2389
a new test-case with some comments
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2119
diff
changeset
|
429 |
EndTest (); |
2118
864b31ff0c01
add a new test-case
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2113
diff
changeset
|
430 |
|
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
431 |
|
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
432 |
// Test an EIFS |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
433 |
// |
5815
5629104d7747
Bug 674 - EIFS is not handled correctly in DcfManager::GetAccessGrantStart
Kirill Andreev <andreev@iitp.ru>
parents:
5320
diff
changeset
|
434 |
// 20 60 66 76 86 90 94 98 102 106 |
5629104d7747
Bug 674 - EIFS is not handled correctly in DcfManager::GetAccessGrantStart
Kirill Andreev <andreev@iitp.ru>
parents:
5320
diff
changeset
|
435 |
// | rx | sifs | acktxttime | sifs + aifsn | bslot0 | bslot1 | bslot2 | bslot3 | tx | |
5629104d7747
Bug 674 - EIFS is not handled correctly in DcfManager::GetAccessGrantStart
Kirill Andreev <andreev@iitp.ru>
parents:
5320
diff
changeset
|
436 |
// | | <------eifs------>| |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
437 |
// 30 request access. backoff slots: 4 |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
438 |
StartTest (4, 6, 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
439 |
AddDcfState (1); |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
440 |
AddRxErrorEvt (20, 40); |
5815
5629104d7747
Bug 674 - EIFS is not handled correctly in DcfManager::GetAccessGrantStart
Kirill Andreev <andreev@iitp.ru>
parents:
5320
diff
changeset
|
441 |
AddAccessRequest (30, 2, 102, 0); |
2124
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
442 |
ExpectCollision (30, 4, 0); // backoff: 4 slots |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
443 |
EndTest (); |
d95795a9767f
more working tests.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2121
diff
changeset
|
444 |
|
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
445 |
// Test an EIFS which is interupted by a successfull transmission. |
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
446 |
// |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
447 |
// 20 60 66 69 75 81 85 89 93 97 101 103 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
448 |
// | rx | sifs | | rx | sifs | aifsn | bslot0 | bslot1 | bslot2 | bslot3 | tx | |
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
449 |
// | | <--eifs-->| |
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
450 |
// 30 request access. backoff slots: 4 |
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
451 |
StartTest (4, 6, 10); |
2126
c2f1ec692e70
ignore cwmin/cwmax parameters since we set the backoff slots for every collision.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2125
diff
changeset
|
452 |
AddDcfState (1); |
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
453 |
AddRxErrorEvt (20, 40); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
454 |
AddAccessRequest (30, 2, 101, 0); |
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
455 |
ExpectCollision (30, 4, 0); // backoff: 4 slots |
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
456 |
AddRxOkEvt (69, 6); |
2131
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
457 |
EndTest (); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
458 |
|
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
459 |
|
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
460 |
// Test two DCFs which suffer an internal collision. the first DCF has a higher |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
461 |
// priority than the second DCF. |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
462 |
// |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
463 |
// 20 60 66 70 74 78 88 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
464 |
// DCF0 | rx | sifs | aifsn | bslot0 | bslot1 | tx | |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
465 |
// DCF1 | rx | sifs | aifsn | aifsn | aifsn | | sifs | aifsn | aifsn | aifsn | bslot | tx | |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
466 |
// 94 98 102 106 110 112 |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
467 |
StartTest (4, 6, 10); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
468 |
AddDcfState (1); // high priority DCF |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
469 |
AddDcfState (3); // low priority DCF |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
470 |
AddRxOkEvt (20, 40); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
471 |
AddAccessRequest (30, 10, 78, 0); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
472 |
ExpectCollision (30, 2, 0); // backoff: 2 slot |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
473 |
|
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
474 |
AddAccessRequest (40, 2, 110, 1); |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
475 |
ExpectCollision (40, 0, 1); // backoff: 0 slot |
a43aabcfa388
test internal collisions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2126
diff
changeset
|
476 |
ExpectInternalCollision (78, 1, 1); // backoff: 1 slot |
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
477 |
EndTest (); |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
478 |
|
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
479 |
// Test of AckTimeout handling: First queue requests access and ack procedure fails, |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
480 |
// inside the ack timeout second queue with higher priority requests access. |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
481 |
// |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
482 |
// 20 40 50 60 66 76 |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
483 |
// DCF0 - low | tx | ack timeout |sifs| | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
484 |
// DCF1 - high | | |sifs| tx | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
485 |
// ^ request access |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
486 |
StartTest (4, 6, 10); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
487 |
AddDcfState (2); // high priority DCF |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
488 |
AddDcfState (0); // low priority DCF |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
489 |
AddAccessRequestWithAckTimeout (20, 20, 20, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
490 |
AddAccessRequest (50, 10, 66, 1); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
491 |
EndTest (); |
2125
15ba30b939d1
test interupted eifs
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2124
diff
changeset
|
492 |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
493 |
// Test of AckTimeout handling: |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
494 |
// |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
495 |
// First queue requests access and ack is 2 us delayed (got ack interval at the picture), |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
496 |
// inside this interval second queue with higher priority requests access. |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
497 |
// |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
498 |
// 20 40 41 42 48 58 |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
499 |
// DCF0 - low | tx |got ack |sifs| | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
500 |
// DCF1 - high | | |sifs| tx | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
501 |
// ^ request access |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
502 |
StartTest (4, 6, 10); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
503 |
AddDcfState (2); // high priority DCF |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
504 |
AddDcfState (0); // low priority DCF |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
505 |
AddAccessRequestWithSuccessfullAck (20, 20, 20, 2, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
506 |
AddAccessRequest (41, 10, 48, 1); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
507 |
EndTest (); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
508 |
|
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
509 |
//Repeat the same but with one queue: |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
510 |
// 20 40 41 42 48 58 |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
511 |
// DCF0 - low | tx |got ack |sifs| | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
512 |
// ^ request access |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
513 |
StartTest (4, 6, 10); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
514 |
AddDcfState (2); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
515 |
AddAccessRequestWithSuccessfullAck (20, 20, 20, 2, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
516 |
AddAccessRequest (41, 10, 56, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
517 |
EndTest (); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
518 |
|
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
519 |
//Repeat the same when ack was delayed: |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
520 |
//and request the next access before previous tx end: |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
521 |
// 20 39 40 42 64 74 |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
522 |
// DCF0 - low | tx |got ack |sifs + 4 * slot| | |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
523 |
// ^ request access |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
524 |
StartTest (4, 6, 10); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
525 |
AddDcfState (2); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
526 |
AddAccessRequestWithSuccessfullAck (20, 20, 20, 2, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
527 |
AddAccessRequest (39, 10, 64, 0); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
528 |
ExpectCollision (39, 2, 0); // backoff: 2 slot |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
4325
diff
changeset
|
529 |
EndTest (); |
2133
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
530 |
|
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
531 |
// |
2134
cf59f463794a
more comment on the test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2133
diff
changeset
|
532 |
// test simple NAV count. This scenario modelizes a simple DATA+ACK handshake |
cf59f463794a
more comment on the test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2133
diff
changeset
|
533 |
// where the data rate used for the ACK is higher than expected by the DATA source |
cf59f463794a
more comment on the test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2133
diff
changeset
|
534 |
// so, the data exchange completes before the end of nav. |
2133
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
535 |
// |
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
536 |
StartTest (4, 6, 10); |
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
537 |
AddDcfState (1); |
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
538 |
AddRxOkEvt (20, 40); |
2134
cf59f463794a
more comment on the test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2133
diff
changeset
|
539 |
AddNavStart (60, 15); |
2133
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
540 |
AddRxOkEvt (66, 5); |
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
541 |
AddNavStart (71, 0); |
2134
cf59f463794a
more comment on the test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2133
diff
changeset
|
542 |
AddAccessRequest (30, 10, 93, 0); |
2133
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
543 |
ExpectCollision (30, 2, 0); // backoff: 2 slot |
df077fb96353
simple NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2131
diff
changeset
|
544 |
EndTest (); |
2135
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
545 |
|
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
546 |
// |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
547 |
// test more complex NAV handling by a CF-poll. This scenario modelizes a |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
548 |
// simple DATA+ACK handshake interrupted by a CF-poll which resets the |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
549 |
// NAV counter. |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
550 |
// |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
551 |
StartTest (4, 6, 10); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
552 |
AddDcfState (1); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
553 |
AddRxOkEvt (20, 40); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
554 |
AddNavStart (60, 15); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
555 |
AddRxOkEvt (66, 5); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
556 |
AddNavReset (71, 2); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
557 |
AddAccessRequest (30, 10, 91, 0); |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
558 |
ExpectCollision (30, 2, 0); // backoff: 2 slot |
21354fae90b2
another more complex NAV test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2134
diff
changeset
|
559 |
EndTest (); |
2141
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
560 |
|
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
561 |
|
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
562 |
StartTest (4, 6, 10); |
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
563 |
AddDcfState (2); |
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
564 |
AddRxOkEvt (20, 40); |
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
565 |
AddAccessRequest (80, 10, 80, 0); |
bb6670fc71cb
another DCF test
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2135
diff
changeset
|
566 |
EndTest (); |
2143
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
567 |
|
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
568 |
|
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
569 |
StartTest (4, 6, 10); |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
570 |
AddDcfState (2); |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
571 |
AddRxOkEvt (20, 40); |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
572 |
AddRxOkEvt (78, 8); |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
573 |
AddAccessRequest (30, 50, 108, 0); |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
574 |
ExpectCollision (30, 3, 0); // backoff: 3 slots |
c3c874d850a1
test a backoff with an AIFSN != 1
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2141
diff
changeset
|
575 |
EndTest (); |
5189 | 576 |
|
577 |
||
578 |
// Channel switching tests |
|
579 |
||
580 |
// 0 20 23 24 25 |
|
581 |
// | switching | sifs | aifsn | tx | |
|
582 |
// | |
|
583 |
// 21 access request. |
|
584 |
StartTest (1, 3, 10); |
|
585 |
AddDcfState (1); |
|
586 |
AddSwitchingEvt(0,20); |
|
587 |
AddAccessRequest (21, 1, 24, 0); |
|
588 |
EndTest (); |
|
589 |
||
590 |
// 20 40 50 53 54 55 |
|
591 |
// | switching | busy | sifs | aifsn | tx | |
|
592 |
// | | |
|
593 |
// 30 busy. 45 access request. |
|
594 |
// |
|
595 |
StartTest (1, 3, 10); |
|
596 |
AddDcfState (1); |
|
597 |
AddSwitchingEvt(20,20); |
|
598 |
AddCcaBusyEvt(30,20); |
|
599 |
AddAccessRequest (45, 1, 54, 0); |
|
600 |
EndTest (); |
|
601 |
||
602 |
// 20 30 50 53 54 55 |
|
603 |
// | rx | switching | sifs | aifsn | tx | |
|
604 |
// | |
|
605 |
// 51 access request. |
|
606 |
// |
|
607 |
StartTest (1, 3, 10); |
|
608 |
AddDcfState (1); |
|
609 |
AddRxStartEvt (20,40); |
|
610 |
AddSwitchingEvt(30,20); |
|
611 |
AddAccessRequest (51, 1, 54, 0); |
|
612 |
EndTest (); |
|
613 |
||
614 |
// 20 30 50 53 54 55 |
|
615 |
// | busy | switching | sifs | aifsn | tx | |
|
616 |
// | |
|
617 |
// 51 access request. |
|
618 |
// |
|
619 |
StartTest (1, 3, 10); |
|
620 |
AddDcfState (1); |
|
621 |
AddCcaBusyEvt (20,40); |
|
622 |
AddSwitchingEvt(30,20); |
|
623 |
AddAccessRequest (51, 1, 54, 0); |
|
624 |
EndTest (); |
|
625 |
||
626 |
// 20 30 50 53 54 55 |
|
627 |
// | nav | switching | sifs | aifsn | tx | |
|
628 |
// | |
|
629 |
// 51 access request. |
|
630 |
// |
|
631 |
StartTest (1, 3, 10); |
|
632 |
AddDcfState (1); |
|
633 |
AddNavStart (20,40); |
|
634 |
AddSwitchingEvt(30,20); |
|
635 |
AddAccessRequest (51, 1, 54, 0); |
|
636 |
EndTest (); |
|
637 |
||
638 |
// 20 40 50 55 58 59 60 |
|
639 |
// | tx | ack timeout | switching | sifs | aifsn | tx | |
|
640 |
// | | |
|
641 |
// 45 access request. 56 access request. |
|
642 |
// |
|
643 |
StartTest (1, 3, 10); |
|
644 |
AddDcfState (1); |
|
645 |
AddAccessRequestWithAckTimeout (20, 20, 20, 0); |
|
646 |
AddAccessRequest (45, 1, 50, 0); |
|
647 |
AddSwitchingEvt(50,5); |
|
648 |
AddAccessRequest (56, 1, 59, 0); |
|
649 |
EndTest (); |
|
650 |
||
651 |
// 20 60 66 70 74 78 80 100 106 110 112 |
|
652 |
// | rx | sifs | aifsn | bslot0 | bslot1 | | switching | sifs | aifsn | tx | |
|
653 |
// | | |
|
654 |
// 30 access request. 101 access request. |
|
655 |
// |
|
656 |
StartTest (4, 6, 10); |
|
657 |
AddDcfState (1); |
|
658 |
AddRxOkEvt(20,40); |
|
659 |
AddAccessRequest (30, 2, 80, 0); |
|
660 |
ExpectCollision(30, 4, 0); // backoff: 4 slots |
|
661 |
AddSwitchingEvt(80,20); |
|
662 |
AddAccessRequest (101, 2, 110, 0); |
|
663 |
EndTest (); |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
664 |
|
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
665 |
return GetErrorStatus (); |
2098 | 666 |
} |
667 |
||
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
668 |
//----------------------------------------------------------------------------- |
2098 | 669 |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
670 |
class DcfTestSuite : public TestSuite |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
671 |
{ |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
672 |
public: |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
673 |
DcfTestSuite (); |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
674 |
}; |
2097 | 675 |
|
5320
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
676 |
DcfTestSuite::DcfTestSuite () |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
677 |
: TestSuite ("devices-wifi-dcf", UNIT) |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
678 |
{ |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
679 |
AddTestCase (new DcfManagerTest); |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
680 |
} |
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
681 |
|
0fb5a9f1a9c0
wifi unit tests ported to new framework
Pavel Boyko <boyko@iitp.ru>
parents:
5189
diff
changeset
|
682 |
DcfTestSuite g_dcfTestSuite; |
2097 | 683 |
|
684 |
} // namespace ns3 |