author | Kirill Andreev <andreev@iitp.ru> |
Mon, 03 Aug 2009 19:13:46 +0400 | |
changeset 5145 | 7f50ab7ce59d |
parent 5134 | 26472734b69f |
child 5147 | 546c5d9a7e64 |
permissions | -rw-r--r-- |
4793 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2008,2009 IITP RAS |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
4793 | 7 |
* published by the Free Software Foundation; |
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Authors: Kirill Andreev <andreev@iitp.ru> |
|
19 |
*/ |
|
20 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
21 |
#include "hwmp-protocol.h" |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
22 |
#include "hwmp-protocol-mac.h" |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
23 |
#include "hwmp-tag.h" |
4891
b8db474bce60
Added HWMP tag to mercurial :)
Kirill Andreev <andreev@iitp.ru>
parents:
4889
diff
changeset
|
24 |
#include "hwmp-rtable.h" |
4793 | 25 |
#include "ns3/log.h" |
26 |
#include "ns3/simulator.h" |
|
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
27 |
#include "ns3/packet.h" |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
28 |
#include "ns3/mesh-point-device.h" |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
29 |
#include "ns3/wifi-net-device.h" |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
30 |
#include "ns3/mesh-point-device.h" |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
31 |
#include "ns3/mesh-wifi-interface-mac.h" |
4964 | 32 |
#include "ns3/random-variable.h" |
5054 | 33 |
#include "airtime-metric.h" |
4895 | 34 |
#include "ie-dot11s-preq.h" |
35 |
#include "ie-dot11s-prep.h" |
|
4793 | 36 |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
37 |
NS_LOG_COMPONENT_DEFINE ("HwmpProtocol"); |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
38 |
|
5132
aee541a30256
Restored newline at namespace
Kirill Andreev <andreev@iitp.ru>
parents:
5130
diff
changeset
|
39 |
namespace ns3 { |
aee541a30256
Restored newline at namespace
Kirill Andreev <andreev@iitp.ru>
parents:
5130
diff
changeset
|
40 |
namespace dot11s { |
4793 | 41 |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
42 |
NS_OBJECT_ENSURE_REGISTERED (HwmpProtocol); |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
43 |
TypeId |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
44 |
HwmpProtocol::GetTypeId () |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
45 |
{ |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4896
diff
changeset
|
46 |
static TypeId tid = TypeId ("ns3::dot11s::HwmpProtocol") |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
47 |
.SetParent<MeshL2RoutingProtocol> () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
48 |
.AddConstructor<HwmpProtocol> () |
5129 | 49 |
.AddAttribute ( "RandomStart", |
50 |
"Random delay at first proactive PREQ", |
|
51 |
TimeValue (Seconds (0.1)), |
|
52 |
MakeTimeAccessor ( |
|
53 |
&HwmpProtocol::m_randomStart), |
|
54 |
MakeTimeChecker () |
|
55 |
) |
|
56 |
.AddAttribute ( "maxQueueSize", |
|
57 |
"Maximum number of packets we can store when resolving route", |
|
58 |
UintegerValue (255), |
|
59 |
MakeUintegerAccessor ( |
|
60 |
&HwmpProtocol::m_maxQueueSize), |
|
61 |
MakeUintegerChecker<uint16_t> (1) |
|
62 |
) |
|
63 |
.AddAttribute ( "dot11MeshHWMPmaxPREQretries", |
|
64 |
"Maximum number of retries before we suppose the destination to be unreachable", |
|
65 |
UintegerValue (3), |
|
66 |
MakeUintegerAccessor ( |
|
67 |
&HwmpProtocol::m_dot11MeshHWMPmaxPREQretries), |
|
68 |
MakeUintegerChecker<uint8_t> (1) |
|
69 |
) |
|
70 |
.AddAttribute ( "dot11MeshHWMPnetDiameterTraversalTime", |
|
71 |
"Time we suppose the packet to go from one edge of the network to another", |
|
72 |
TimeValue (MicroSeconds (1024*100)), |
|
73 |
MakeTimeAccessor ( |
|
74 |
&HwmpProtocol::m_dot11MeshHWMPnetDiameterTraversalTime), |
|
75 |
MakeTimeChecker () |
|
76 |
) |
|
77 |
.AddAttribute ( "dot11MeshHWMPpreqMinInterval", |
|
78 |
"Minimal interval between to successive PREQs", |
|
79 |
TimeValue (MicroSeconds (1024*100)), |
|
80 |
MakeTimeAccessor ( |
|
81 |
&HwmpProtocol::m_dot11MeshHWMPpreqMinInterval), |
|
82 |
MakeTimeChecker () |
|
83 |
) |
|
84 |
.AddAttribute ( "dot11MeshHWMPperrMinInterval", |
|
85 |
"Minimal interval between to successive PREQs", |
|
86 |
TimeValue (MicroSeconds (1024*100)), |
|
87 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPperrMinInterval), |
|
88 |
MakeTimeChecker () |
|
89 |
) |
|
90 |
.AddAttribute ( "dot11MeshHWMPactiveRootTimeout", |
|
91 |
"Lifetime of poractive routing information", |
|
92 |
TimeValue (MicroSeconds (1024*5000)), |
|
93 |
MakeTimeAccessor ( |
|
94 |
&HwmpProtocol::m_dot11MeshHWMPactiveRootTimeout), |
|
95 |
MakeTimeChecker () |
|
96 |
) |
|
97 |
.AddAttribute ( "dot11MeshHWMPactivePathTimeout", |
|
98 |
"Lifetime of reactive routing information", |
|
99 |
TimeValue (MicroSeconds (1024*5000)), |
|
100 |
MakeTimeAccessor ( |
|
101 |
&HwmpProtocol::m_dot11MeshHWMPactivePathTimeout), |
|
102 |
MakeTimeChecker () |
|
103 |
) |
|
104 |
.AddAttribute ( "dot11MeshHWMPpathToRootInterval", |
|
105 |
"Interval between two successive proactive PREQs", |
|
106 |
TimeValue (MicroSeconds (1024*2000)), |
|
107 |
MakeTimeAccessor ( |
|
108 |
&HwmpProtocol::m_dot11MeshHWMPpathToRootInterval), |
|
109 |
MakeTimeChecker () |
|
110 |
) |
|
111 |
.AddAttribute ( "dot11MeshHWMPrannInterval", |
|
112 |
"Lifetime of poractive routing information", |
|
113 |
TimeValue (MicroSeconds (1024*5000)), |
|
114 |
MakeTimeAccessor ( |
|
115 |
&HwmpProtocol::m_dot11MeshHWMPrannInterval), |
|
116 |
MakeTimeChecker () |
|
117 |
) |
|
118 |
.AddAttribute ( "maxTtl", |
|
119 |
"Initial value of Time To Live field", |
|
120 |
UintegerValue (32), |
|
121 |
MakeUintegerAccessor ( |
|
122 |
&HwmpProtocol::m_maxTtl), |
|
123 |
MakeUintegerChecker<uint8_t> (2) |
|
124 |
) |
|
125 |
.AddAttribute ( "unicastPerrThreshold", |
|
126 |
"Maximum number of PERR receivers, when we send a PERR as a chain of unicasts", |
|
127 |
UintegerValue (32), |
|
128 |
MakeUintegerAccessor ( |
|
129 |
&HwmpProtocol::m_unicastPerrThreshold), |
|
130 |
MakeUintegerChecker<uint8_t> (1) |
|
131 |
) |
|
132 |
.AddAttribute ( "unicastPreqThreshold", |
|
133 |
"Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts", |
|
134 |
UintegerValue (1), |
|
135 |
MakeUintegerAccessor ( |
|
136 |
&HwmpProtocol::m_unicastPreqThreshold), |
|
137 |
MakeUintegerChecker<uint8_t> (1) |
|
138 |
) |
|
139 |
.AddAttribute ( "unicastDataThreshold", |
|
140 |
"Maximum number ofbroadcast receivers, when we send a broadcast as a chain of unicasts", |
|
141 |
UintegerValue (1), |
|
142 |
MakeUintegerAccessor ( |
|
143 |
&HwmpProtocol::m_unicastDataThreshold), |
|
144 |
MakeUintegerChecker<uint8_t> (1) |
|
145 |
) |
|
146 |
.AddAttribute ( "doFlag", |
|
147 |
"Destination only HWMP flag", |
|
148 |
BooleanValue (false), |
|
149 |
MakeBooleanAccessor ( |
|
150 |
&HwmpProtocol::m_doFlag), |
|
151 |
MakeBooleanChecker () |
|
152 |
) |
|
153 |
.AddAttribute ( "rfFlag", |
|
154 |
"Reply and forward flag", |
|
155 |
BooleanValue (true), |
|
156 |
MakeBooleanAccessor ( |
|
157 |
&HwmpProtocol::m_rfFlag), |
|
158 |
MakeBooleanChecker () |
|
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
159 |
); |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
160 |
return tid; |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
161 |
} |
5129 | 162 |
|
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
163 |
HwmpProtocol::HwmpProtocol (): |
5129 | 164 |
m_dataSeqno (1), |
165 |
m_hwmpSeqno (1), |
|
166 |
m_preqId (0), |
|
167 |
m_rtable (CreateObject<HwmpRtable> ()), |
|
168 |
m_randomStart(Seconds (0.1)), |
|
169 |
m_maxQueueSize (255), |
|
170 |
m_dot11MeshHWMPmaxPREQretries (3), |
|
171 |
m_dot11MeshHWMPnetDiameterTraversalTime (MicroSeconds (1024*100)), |
|
172 |
m_dot11MeshHWMPpreqMinInterval (MicroSeconds (1024*100)), |
|
173 |
m_dot11MeshHWMPperrMinInterval (MicroSeconds (1024*100)), |
|
174 |
m_dot11MeshHWMPactiveRootTimeout (MicroSeconds (1024*5000)), |
|
175 |
m_dot11MeshHWMPactivePathTimeout (MicroSeconds (1024*5000)), |
|
176 |
m_dot11MeshHWMPpathToRootInterval (MicroSeconds (1024*2000)), |
|
177 |
m_dot11MeshHWMPrannInterval (MicroSeconds (1024*5000)), |
|
178 |
m_isRoot (false), |
|
179 |
m_maxTtl (32), |
|
180 |
m_unicastPerrThreshold (32), |
|
181 |
m_unicastPreqThreshold (1), |
|
182 |
m_unicastDataThreshold (1), |
|
183 |
m_doFlag (false), |
|
184 |
m_rfFlag (false) |
|
4793 | 185 |
{ |
5129 | 186 |
|
5130 | 187 |
if (m_isRoot) |
5129 | 188 |
{ |
189 |
SetRoot (); |
|
190 |
} |
|
4793 | 191 |
} |
192 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
193 |
HwmpProtocol::~HwmpProtocol () |
4793 | 194 |
{ |
195 |
} |
|
196 |
||
197 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
198 |
HwmpProtocol::DoDispose () |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
199 |
{ |
5130 | 200 |
for (std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.begin (); i != m_preqTimeouts.end (); i ++) |
5129 | 201 |
{ |
202 |
i->second.Cancel (); |
|
203 |
} |
|
5145
7f50ab7ce59d
Added path update to FLAME
Kirill Andreev <andreev@iitp.ru>
parents:
5134
diff
changeset
|
204 |
m_proactivePreqTimer.Cancel(); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
205 |
m_preqTimeouts.clear (); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
206 |
m_lastDataSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
207 |
m_lastHwmpSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
208 |
m_rqueue.clear (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
209 |
m_rtable = 0; |
4793 | 210 |
} |
211 |
||
212 |
bool |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
213 |
HwmpProtocol::RequestRoute ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
214 |
uint32_t sourceIface, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
215 |
const Mac48Address source, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
216 |
const Mac48Address destination, |
5070
c70964936d2e
added 'const' label to packet in MeshPointDevice::Forward and
Kirill Andreev <andreev@iitp.ru>
parents:
5066
diff
changeset
|
217 |
Ptr<const Packet> constPacket, |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
218 |
uint16_t protocolType, //ethrnet 'Protocol' field |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
219 |
MeshL2RoutingProtocol::RouteReplyCallback routeReply |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
220 |
) |
4793 | 221 |
{ |
5070
c70964936d2e
added 'const' label to packet in MeshPointDevice::Forward and
Kirill Andreev <andreev@iitp.ru>
parents:
5066
diff
changeset
|
222 |
Ptr <Packet> packet = constPacket->Copy (); |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
223 |
HwmpTag tag; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
224 |
if (sourceIface == GetMeshPoint ()->GetIfIndex()) |
4953
0226369989a3
Added {} in 'if' where ASSERT exists
Kirill Andreev <andreev@iitp.ru>
parents:
4950
diff
changeset
|
225 |
{ |
5130 | 226 |
// packet from level 3 |
227 |
if (packet->PeekPacketTag (tag)) |
|
5129 | 228 |
{ |
229 |
NS_FATAL_ERROR ("HWMP tag has come with a packet from upper layer. This must not occur..."); |
|
230 |
} |
|
231 |
//Filling TAG: |
|
232 |
if (destination == Mac48Address::GetBroadcast ()) |
|
233 |
{ |
|
234 |
tag.SetSeqno (m_dataSeqno++); |
|
235 |
} |
|
236 |
tag.SetTtl (m_maxTtl); |
|
4953
0226369989a3
Added {} in 'if' where ASSERT exists
Kirill Andreev <andreev@iitp.ru>
parents:
4950
diff
changeset
|
237 |
} |
4918 | 238 |
else |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
239 |
{ |
5130 | 240 |
if (!packet->RemovePacketTag (tag)) |
5129 | 241 |
{ |
242 |
NS_FATAL_ERROR ("HWMP tag is supposed to be here at this point."); |
|
243 |
} |
|
244 |
tag.DecrementTtl (); |
|
245 |
if (tag.GetTtl () == 0) |
|
246 |
{ |
|
247 |
m_stats.droppedTtl ++; |
|
248 |
return false; |
|
249 |
} |
|
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
250 |
} |
5129 | 251 |
if (destination == Mac48Address::GetBroadcast ()) |
5039
65524e2ec376
Added dropped TTL field to stats
Kirill Andreev <andreev@iitp.ru>
parents:
5038
diff
changeset
|
252 |
{ |
5129 | 253 |
m_stats.txBroadcast ++; |
254 |
m_stats.txBytes += packet->GetSize (); |
|
255 |
//channel IDs where we have already sent broadcast: |
|
256 |
std::vector<uint16_t> channels; |
|
257 |
for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
258 |
{ |
5129 | 259 |
bool should_send = true; |
5130 | 260 |
for (std::vector<uint16_t>::const_iterator chan = channels.begin (); chan != channels.end (); chan ++) |
5129 | 261 |
{ |
262 |
if ((*chan) == plugin->second->GetChannelId ()) |
|
263 |
{ |
|
264 |
should_send = false; |
|
265 |
} |
|
266 |
} |
|
267 |
if (!should_send) |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
268 |
{ |
5129 | 269 |
continue; |
270 |
} |
|
5130 | 271 |
channels.push_back (plugin->second->GetChannelId ()); |
5129 | 272 |
std::vector<Mac48Address> receivers = GetBroadcastReceivers (plugin->first); |
5130 | 273 |
for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end (); i ++) |
5129 | 274 |
{ |
275 |
Ptr<Packet> packet_copy = packet->Copy(); |
|
276 |
tag.SetAddress (*i); |
|
277 |
packet_copy->AddPacketTag (tag); |
|
278 |
routeReply (true, packet_copy, source, destination, protocolType, plugin->first); |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
279 |
} |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
280 |
} |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
281 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
282 |
else |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
283 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
284 |
return ForwardUnicast (sourceIface, source, destination, packet, protocolType, routeReply, tag.GetTtl ()); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
285 |
} |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
286 |
return true; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
287 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
288 |
bool |
5083
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
289 |
HwmpProtocol::RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
290 |
const Mac48Address destination, Ptr<Packet> packet, uint16_t& protocolType) |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
291 |
{ |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
292 |
HwmpTag tag; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
293 |
if (!packet->RemovePacketTag (tag)) |
5129 | 294 |
{ |
295 |
NS_FATAL_ERROR ("HWMP tag must exist when packet received from the network"); |
|
296 |
} |
|
5083
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
297 |
return true; |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
298 |
} |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
299 |
bool |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
300 |
HwmpProtocol::ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
301 |
Ptr<Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
302 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
303 |
NS_ASSERT(destination != Mac48Address::GetBroadcast ()); |
5130 | 304 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive (destination); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
305 |
NS_LOG_DEBUG("Requested src = "<<source<<", dst = "<<destination<<", I am "<<GetAddress ()<<", RA = "<<result.retransmitter); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
306 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
307 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
308 |
result = m_rtable->LookupProactive (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
309 |
} |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
310 |
HwmpTag tag; |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
311 |
tag.SetAddress (result.retransmitter); |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
312 |
tag.SetTtl (ttl); |
5057
95a72c98f08d
Added dot11s installator, fixed bug with adding tag in proactive mode of HWMP
Kirill Andreev <andreev@iitp.ru>
parents:
5054
diff
changeset
|
313 |
//seqno and metric is not used; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
314 |
packet->AddPacketTag (tag); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
315 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
5129 | 316 |
{ |
317 |
//reply immediately: |
|
318 |
routeReply (true, packet, source, destination, protocolType, result.ifIndex); |
|
319 |
m_stats.txUnicast ++; |
|
320 |
m_stats.txBytes += packet->GetSize (); |
|
321 |
return true; |
|
322 |
} |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
323 |
if (sourceIface != GetMeshPoint ()->GetIfIndex ()) |
5129 | 324 |
{ |
325 |
//Start path error procedure: |
|
326 |
NS_LOG_DEBUG ("Must Send PERR"); |
|
327 |
result = m_rtable->LookupReactiveExpired (destination); |
|
328 |
//1. Lookup expired reactive path. If exists - start path error |
|
329 |
// procedure towards a next hop of this path |
|
330 |
//2. If there was no reactive path, we lookup expired proactive |
|
331 |
// path. If exist - start path error procedure towards path to |
|
332 |
// root |
|
333 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
|
334 |
{ |
|
335 |
result = m_rtable->LookupProactiveExpired (); |
|
336 |
} |
|
337 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
|
338 |
{ |
|
339 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (result.retransmitter); |
|
340 |
InitiatePathError (MakePathError (destinations)); |
|
341 |
} |
|
342 |
m_stats.totalDropped ++; |
|
343 |
return false; |
|
344 |
} |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
345 |
//Request a destination: |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
346 |
result = m_rtable->LookupReactiveExpired (destination); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
347 |
if (ShouldSendPreq (destination)) |
5129 | 348 |
{ |
349 |
uint32_t originator_seqno = GetNextHwmpSeqno (); |
|
350 |
uint32_t dst_seqno = 0; |
|
351 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
|
352 |
{ |
|
353 |
dst_seqno = result.seqnum; |
|
354 |
} |
|
355 |
m_stats.initiatedPreq ++; |
|
356 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
|
357 |
{ |
|
5130 | 358 |
i->second->RequestDestination (destination, originator_seqno, dst_seqno); |
5129 | 359 |
} |
360 |
} |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
361 |
QueuedPacket pkt; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
362 |
pkt.pkt = packet; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
363 |
pkt.dst = destination; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
364 |
pkt.src = source; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
365 |
pkt.protocol = protocolType; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
366 |
pkt.reply = routeReply; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
367 |
pkt.inInterface = sourceIface; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
368 |
if (QueuePacket (pkt)) |
5129 | 369 |
{ |
370 |
m_stats.totalQueued ++; |
|
371 |
return true; |
|
372 |
} |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
373 |
else |
5129 | 374 |
{ |
375 |
m_stats.totalDropped ++; |
|
376 |
return false; |
|
377 |
} |
|
4793 | 378 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
379 |
void |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
380 |
HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
381 |
{ |
4946
f97e16db1d79
Added airtime link metric. packet error rate is not done yet
Kirill Andreev <andreev@iitp.ru>
parents:
4945
diff
changeset
|
382 |
preq.IncrementMetric (metric); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
383 |
//acceptance cretirea: |
4945 | 384 |
std::map<Mac48Address, uint32_t>::const_iterator i = m_lastHwmpSeqno.find (preq.GetOriginatorAddress()); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
385 |
if (i == m_lastHwmpSeqno.end ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
386 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
387 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
388 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric (); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
389 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
390 |
else |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
391 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
392 |
if (i->second > preq.GetOriginatorSeqNumber ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
393 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
394 |
return; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
395 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
396 |
if (i->second == preq.GetOriginatorSeqNumber ()) |
5129 | 397 |
{ |
398 |
//find metric |
|
399 |
std::map<Mac48Address, uint32_t>::const_iterator j = m_lastHwmpMetric.find (preq.GetOriginatorAddress()); |
|
5130 | 400 |
NS_ASSERT (j != m_lastHwmpSeqno.end ()); |
5129 | 401 |
if (j->second <= preq.GetMetric ()) |
402 |
{ |
|
403 |
return; |
|
404 |
} |
|
405 |
} |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
406 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
407 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric (); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
408 |
} |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
409 |
NS_LOG_DEBUG("I am " << GetAddress () << "Accepted preq from address" << from << ", preq:" << preq); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
410 |
std::vector<Ptr<DestinationAddressUnit> > destinations = preq.GetDestinationList (); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
411 |
//Add reactive path to originator: |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
412 |
if ( |
5130 | 413 |
((m_rtable->LookupReactive (preq.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || |
414 |
((m_rtable->LookupReactive (preq.GetOriginatorAddress ())).metric > preq.GetMetric ()) |
|
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
415 |
) |
5129 | 416 |
{ |
417 |
m_rtable->AddReactivePath ( |
|
418 |
preq.GetOriginatorAddress (), |
|
419 |
from, |
|
420 |
interface, |
|
421 |
preq.GetMetric (), |
|
422 |
MicroSeconds (preq.GetLifetime () * 1024), |
|
423 |
preq.GetOriginatorSeqNumber () |
|
424 |
); |
|
425 |
ReactivePathResolved (preq.GetOriginatorAddress ()); |
|
426 |
} |
|
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
427 |
//Add reactive path for precursor: |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
428 |
if ( |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
429 |
((m_rtable->LookupReactive (fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
430 |
((m_rtable->LookupReactive (fromMp)).metric > preq.GetMetric ()) |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
431 |
) |
5129 | 432 |
{ |
433 |
m_rtable->AddReactivePath ( |
|
434 |
fromMp, |
|
435 |
from, |
|
436 |
interface, |
|
437 |
metric, |
|
438 |
MicroSeconds (preq.GetLifetime () * 1024), |
|
439 |
preq.GetOriginatorSeqNumber () |
|
440 |
); |
|
441 |
ReactivePathResolved (fromMp); |
|
442 |
} |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
443 |
for (std::vector<Ptr<DestinationAddressUnit> >::const_iterator i = destinations.begin (); i != destinations.end (); i++) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
444 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
445 |
if ((*i)->GetDestinationAddress () == Mac48Address::GetBroadcast()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
446 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
447 |
//only proactive PREQ contains destination |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
448 |
//address as broadcast! Proactive preq MUST |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
449 |
//have destination count equal to 1 and |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
450 |
//per destination flags DO and RF |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
451 |
NS_ASSERT (preq.GetDestCount() == 1); |
5130 | 452 |
NS_ASSERT (((*i)->IsDo ()) && ((*i)->IsRf ())); |
4964 | 453 |
//Add proactive path only if it is the better then existed |
454 |
//before |
|
5130 | 455 |
if ( |
4964 | 456 |
((m_rtable->LookupProactive ()).retransmitter == Mac48Address::GetBroadcast ()) || |
457 |
((m_rtable->LookupProactive ()).metric > preq.GetMetric ()) |
|
458 |
) |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
459 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
460 |
m_rtable->AddProactivePath ( |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
461 |
preq.GetMetric (), |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
462 |
preq.GetOriginatorAddress (), |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
463 |
from, |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
464 |
interface, |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
465 |
MicroSeconds (preq.GetLifetime () * 1024), |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
466 |
preq.GetOriginatorSeqNumber () |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
467 |
); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
468 |
ProactivePathResolved (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
469 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
470 |
if (!preq.IsNeedNotPrep ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
471 |
{ |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
472 |
SendPrep ( |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
473 |
GetAddress (), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
474 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
475 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
476 |
preq.GetMetric (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
477 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
478 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
479 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
480 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
481 |
); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
482 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
483 |
break; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
484 |
} |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
485 |
if ((*i)->GetDestinationAddress () == GetAddress ()) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
486 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
487 |
SendPrep ( |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
488 |
GetAddress (), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
489 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
490 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
491 |
(uint32_t)0, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
492 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
493 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
494 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
495 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
496 |
); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
497 |
NS_ASSERT(m_rtable->LookupReactive (preq.GetOriginatorAddress ()).retransmitter != Mac48Address::GetBroadcast ()); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
498 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
499 |
continue; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
500 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
501 |
//check if can answer: |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
502 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive ((*i)->GetDestinationAddress ()); |
5130 | 503 |
if ((! ((*i)->IsDo ())) && (result.retransmitter != Mac48Address::GetBroadcast ())) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
504 |
{ |
4978
b73c15d25e81
Intermediate reply bugfix
Kirill Andreev <andreev@iitp.ru>
parents:
4972
diff
changeset
|
505 |
//have a valid information and can answer |
4983 | 506 |
//!NB: If there is information from peer - set lifetime as |
507 |
//we have got from PREQ, and set the rest lifetime of the |
|
508 |
//route if the information is correct |
|
4998 | 509 |
uint32_t lifetime = result.lifetime.GetMicroSeconds () / 1024; |
5134 | 510 |
if ((lifetime > 0) && (result.seqnum >= (*i)->GetDestSeqNumber ())) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
511 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
512 |
SendPrep ( |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
513 |
(*i)->GetDestinationAddress (), |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
514 |
preq.GetOriginatorAddress (), |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
515 |
from, |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
516 |
result.metric, |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
517 |
preq.GetOriginatorSeqNumber (), |
5134 | 518 |
result.seqnum, |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
519 |
lifetime, |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
520 |
interface |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
521 |
); |
5134 | 522 |
if ((*i)->IsRf ()) |
523 |
{ |
|
524 |
(*i)->SetFlags (true, false, (*i)->IsUsn ()); //DO = 1, RF = 0 |
|
525 |
} |
|
526 |
else |
|
527 |
{ |
|
528 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); |
|
529 |
continue; |
|
530 |
} |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
531 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
532 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
533 |
} |
5063 | 534 |
//check if must retransmit: |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
535 |
if (preq.GetDestCount () == 0) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
536 |
{ |
5129 | 537 |
return; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
538 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
539 |
//Forward PREQ to all interfaces: |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
540 |
NS_LOG_DEBUG("I am " << GetAddress () << "retransmitting PREQ:" << preq); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
541 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
542 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
543 |
i->second->SendPreq (preq); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
544 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
545 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
546 |
void |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
547 |
HwmpProtocol::ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
548 |
{ |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
549 |
prep.IncrementMetric (metric); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
550 |
//acceptance cretirea: |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
551 |
std::map<Mac48Address, uint32_t>::const_iterator i = m_lastHwmpSeqno.find (prep.GetOriginatorAddress ()); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
552 |
if (i == m_lastHwmpSeqno.end ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
553 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
554 |
m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber (); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
555 |
} |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
556 |
else |
4947 | 557 |
{ |
4999
467519eba260
Fixed asimmetrical routes
Kirill Andreev <andreev@iitp.ru>
parents:
4998
diff
changeset
|
558 |
if (i->second > prep.GetOriginatorSeqNumber ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
559 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
560 |
return; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
561 |
} |
4947 | 562 |
else |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
563 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
564 |
m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
565 |
} |
4947 | 566 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
567 |
//update routing info |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
568 |
//Now add a path to destination and add precursor to source |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
569 |
NS_LOG_DEBUG("I am " << GetAddress () << ", received prep from " << prep.GetOriginatorAddress () << ", receiver was:" << from); |
5130 | 570 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive (prep.GetDestinationAddress ()); |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
571 |
//Add a reactive path only if it is better than existing: |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
572 |
if ( |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
573 |
((m_rtable->LookupReactive (prep.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
574 |
((m_rtable->LookupReactive (prep.GetOriginatorAddress ())).metric > prep.GetMetric ()) |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
575 |
) |
5129 | 576 |
{ |
577 |
m_rtable->AddReactivePath ( |
|
578 |
prep.GetOriginatorAddress (), |
|
579 |
from, |
|
580 |
interface, |
|
581 |
prep.GetMetric (), |
|
582 |
MicroSeconds(prep.GetLifetime () * 1024), |
|
583 |
prep.GetOriginatorSeqNumber ()); |
|
584 |
m_rtable->AddPrecursor (prep.GetDestinationAddress (), interface, from); |
|
585 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
|
586 |
{ |
|
587 |
m_rtable->AddPrecursor (prep.GetOriginatorAddress (), interface, result.retransmitter); |
|
588 |
} |
|
589 |
ReactivePathResolved (prep.GetOriginatorAddress ()); |
|
590 |
} |
|
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
591 |
if ( |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
592 |
((m_rtable->LookupReactive (fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
593 |
((m_rtable->LookupReactive (fromMp)).metric > prep.GetMetric ()) |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
594 |
) |
5129 | 595 |
{ |
596 |
m_rtable->AddReactivePath ( |
|
597 |
fromMp, |
|
598 |
from, |
|
599 |
interface, |
|
600 |
metric, |
|
601 |
MicroSeconds(prep.GetLifetime () * 1024), |
|
602 |
prep.GetOriginatorSeqNumber ()); |
|
603 |
ReactivePathResolved (fromMp); |
|
604 |
} |
|
5130 | 605 |
if (prep.GetDestinationAddress () == GetAddress ()) |
5129 | 606 |
{ |
607 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<", resolved "<<prep.GetOriginatorAddress ()); |
|
608 |
return; |
|
609 |
} |
|
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
610 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
611 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
612 |
//try to look for default route |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
613 |
result = m_rtable->LookupProactive (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
614 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
615 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
616 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
617 |
return; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
618 |
} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
619 |
//Forward PREP |
5087 | 620 |
HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (result.ifIndex); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
621 |
NS_ASSERT (prep_sender != m_interfaces.end ()); |
4998 | 622 |
prep_sender->second->SendPrep (prep, result.retransmitter); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
623 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
624 |
void |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
625 |
HwmpProtocol::ReceivePerr (std::vector<IePerr::FailedDestination> destinations, Mac48Address from, uint32_t interface, Mac48Address fromMp) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
626 |
{ |
4923 | 627 |
//Acceptance cretirea: |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
628 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<", received PERR from "<<from); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
629 |
std::vector<IePerr::FailedDestination> retval; |
4923 | 630 |
HwmpRtable::LookupResult result; |
5130 | 631 |
for (unsigned int i = 0; i < destinations.size (); i ++) |
4923 | 632 |
{ |
633 |
result = m_rtable->LookupReactive (destinations[i].destination); |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
634 |
if (!( |
4923 | 635 |
(result.retransmitter != from) || |
636 |
(result.ifIndex != interface) || |
|
637 |
(result.seqnum > destinations[i].seqnum) |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
638 |
)) |
5129 | 639 |
{ |
5130 | 640 |
retval.push_back (destinations[i]); |
5129 | 641 |
} |
4923 | 642 |
} |
5130 | 643 |
if (retval.size () == 0) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
644 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
645 |
return; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
646 |
} |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
647 |
ForwardPathError (MakePathError (retval)); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
648 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
649 |
void |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
650 |
HwmpProtocol::SendPrep ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
651 |
Mac48Address src, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
652 |
Mac48Address dst, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
653 |
Mac48Address retransmitter, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
654 |
uint32_t initMetric, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
655 |
uint32_t originatorDsn, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
656 |
uint32_t destinationSN, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
657 |
uint32_t lifetime, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
658 |
uint32_t interface) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
659 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
660 |
IePrep prep; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
661 |
prep.SetHopcount (0); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
662 |
prep.SetTtl (m_maxTtl); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
663 |
prep.SetDestinationAddress (dst); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
664 |
prep.SetDestinationSeqNumber (destinationSN); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
665 |
prep.SetLifetime (lifetime); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
666 |
prep.SetMetric (0); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
667 |
prep.SetOriginatorAddress (src); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
668 |
prep.SetOriginatorSeqNumber (originatorDsn); |
5087 | 669 |
HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (interface); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
670 |
NS_ASSERT(prep_sender != m_interfaces.end ()); |
4998 | 671 |
prep_sender->second->SendPrep (prep, retransmitter); |
5108
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
672 |
m_stats.initiatedPrep ++; |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
673 |
} |
4793 | 674 |
bool |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
675 |
HwmpProtocol::Install (Ptr<MeshPointDevice> mp) |
4793 | 676 |
{ |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
677 |
m_mp = mp; |
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
678 |
std::vector<Ptr<NetDevice> > interfaces = mp->GetInterfaces (); |
5130 | 679 |
for (std::vector<Ptr<NetDevice> >::const_iterator i = interfaces.begin (); i != interfaces.end (); i++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
680 |
{ |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4896
diff
changeset
|
681 |
// Checking for compatible net device |
5012 | 682 |
Ptr<WifiNetDevice> wifiNetDev = (*i)->GetObject<WifiNetDevice> (); |
683 |
if (wifiNetDev == 0) |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
684 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
685 |
return false; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
686 |
} |
5012 | 687 |
Ptr<MeshWifiInterfaceMac> mac = wifiNetDev->GetMac ()->GetObject<MeshWifiInterfaceMac> (); |
688 |
if (mac == 0) |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
689 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
690 |
return false; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
691 |
} |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4896
diff
changeset
|
692 |
// Installing plugins: |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
693 |
Ptr<HwmpProtocolMac> hwmpMac = Create<HwmpProtocolMac> (wifiNetDev->GetIfIndex (), this); |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
694 |
m_interfaces[wifiNetDev->GetIfIndex ()] = hwmpMac; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
695 |
mac->InstallPlugin (hwmpMac); |
5054 | 696 |
//Installing airtime link metric: |
697 |
Ptr<AirtimeLinkMetricCalculator> metric = CreateObject <AirtimeLinkMetricCalculator> (); |
|
5130 | 698 |
mac->SetLinkMetricCallback (MakeCallback (&AirtimeLinkMetricCalculator::CalculateMetric, metric)); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
699 |
} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
700 |
mp->SetRoutingProtocol (this); |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4896
diff
changeset
|
701 |
// Mesh point aggregates all installed protocols |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
702 |
mp->AggregateObject (this); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
703 |
m_address = Mac48Address::ConvertFrom (mp->GetAddress ());// address; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
704 |
return true; |
4793 | 705 |
} |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
706 |
void |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4926
diff
changeset
|
707 |
HwmpProtocol::PeerLinkStatus(Mac48Address meshPointAddress, Mac48Address peerAddress, uint32_t interface, bool status) |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
708 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
709 |
if (status) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
710 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
711 |
return; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
712 |
} |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
713 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (peerAddress); |
5111 | 714 |
InitiatePathError (MakePathError (destinations)); |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
715 |
} |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
716 |
void |
5130 | 717 |
HwmpProtocol::SetNeighboursCallback (Callback<std::vector<Mac48Address>, uint32_t> cb) |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
718 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
719 |
m_neighboursCallback = cb; |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
720 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
721 |
bool |
5130 | 722 |
HwmpProtocol::DropDataFrame (uint32_t seqno, Mac48Address source) |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
723 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
724 |
if (source == GetAddress ()) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
725 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
726 |
return true; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
727 |
} |
4945 | 728 |
std::map<Mac48Address, uint32_t,std::less<Mac48Address> >::const_iterator i = m_lastDataSeqno.find (source); |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
729 |
if (i == m_lastDataSeqno.end ()) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
730 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
731 |
m_lastDataSeqno[source] = seqno; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
732 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
733 |
else |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
734 |
{ |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
735 |
if (i->second >= seqno) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
736 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
737 |
return true; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
738 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
739 |
m_lastDataSeqno[source] = seqno; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
740 |
} |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
741 |
return false; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
742 |
} |
5111 | 743 |
HwmpProtocol::PathError |
4923 | 744 |
HwmpProtocol::MakePathError (std::vector<IePerr::FailedDestination> destinations) |
4793 | 745 |
{ |
5111 | 746 |
PathError retval; |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
747 |
//HwmpRtable increments a sequence number as written in 11B.9.7.2 |
5111 | 748 |
retval.receivers = GetPerrReceivers (destinations); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
749 |
if (retval.receivers.size () == 0) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
750 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
751 |
return retval; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
752 |
} |
5108
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
753 |
m_stats.initiatedPerr ++; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
754 |
for (unsigned int i = 0; i < destinations.size (); i ++) |
4923 | 755 |
{ |
5130 | 756 |
retval.destinations.push_back (destinations[i]); |
757 |
m_rtable->DeleteReactivePath (destinations[i].destination); |
|
4923 | 758 |
} |
5111 | 759 |
return retval; |
760 |
} |
|
761 |
void |
|
762 |
HwmpProtocol::InitiatePathError(PathError perr) |
|
763 |
{ |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
764 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4923 | 765 |
{ |
766 |
std::vector<Mac48Address> receivers_for_interface; |
|
5130 | 767 |
for (unsigned int j = 0; j < perr.receivers.size (); j ++) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
768 |
{ |
5129 | 769 |
if (i->first == perr.receivers[j].first) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
770 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
771 |
receivers_for_interface.push_back (perr.receivers[j].second); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
772 |
} |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
773 |
} |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
774 |
i->second->InitiatePerr (perr.destinations, receivers_for_interface); |
4923 | 775 |
} |
4793 | 776 |
} |
5111 | 777 |
void |
778 |
HwmpProtocol::ForwardPathError(PathError perr) |
|
779 |
{ |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
780 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
5111 | 781 |
{ |
782 |
std::vector<Mac48Address> receivers_for_interface; |
|
5130 | 783 |
for (unsigned int j = 0; j < perr.receivers.size (); j ++) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
784 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
785 |
if (i->first == perr.receivers[j].first) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
786 |
{ |
5130 | 787 |
receivers_for_interface.push_back (perr.receivers[j].second); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
788 |
} |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
789 |
} |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
790 |
i->second->ForwardPerr (perr.destinations, receivers_for_interface); |
5111 | 791 |
} |
792 |
} |
|
793 |
||
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
794 |
std::vector<std::pair<uint32_t, Mac48Address> > |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
795 |
HwmpProtocol::GetPerrReceivers (std::vector<IePerr::FailedDestination> failedDest) |
4793 | 796 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4919
diff
changeset
|
797 |
HwmpRtable::PrecursorList retval; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
798 |
for (unsigned int i = 0; i < failedDest.size (); i ++) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
799 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
800 |
HwmpRtable::PrecursorList precursors = m_rtable->GetPrecursors (failedDest[i].destination); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
801 |
m_rtable->DeleteReactivePath (failedDest[i].destination); |
5130 | 802 |
m_rtable->DeleteProactivePath (failedDest[i].destination); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
803 |
for (unsigned int j = 0; j < precursors.size (); j ++) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
804 |
{ |
5130 | 805 |
retval.push_back (precursors[j]); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
806 |
} |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
807 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
808 |
//Check if we have dublicates in retval and precursors: |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
809 |
for (unsigned int i = 0; i < retval.size (); i ++) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
810 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
811 |
for (unsigned int j = i+1; j < retval.size (); j ++) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
812 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
813 |
if (retval[i].second == retval[j].second) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
814 |
{ |
5130 | 815 |
retval.erase (retval.begin () + j); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
816 |
} |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
817 |
} |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
818 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
819 |
return retval; |
4793 | 820 |
} |
4895 | 821 |
std::vector<Mac48Address> |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
822 |
HwmpProtocol::GetPreqReceivers (uint32_t interface) |
4895 | 823 |
{ |
824 |
std::vector<Mac48Address> retval; |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
825 |
if (!m_neighboursCallback.IsNull ()) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
826 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
827 |
retval = m_neighboursCallback (interface); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
828 |
} |
5130 | 829 |
if ((retval.size () >= m_unicastPreqThreshold) || (retval.size () == 0)) |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
830 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
831 |
retval.clear (); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
832 |
retval.push_back (Mac48Address::GetBroadcast ()); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
833 |
} |
4895 | 834 |
return retval; |
835 |
} |
|
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
836 |
std::vector<Mac48Address> |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
837 |
HwmpProtocol::GetBroadcastReceivers (uint32_t interface) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
838 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
839 |
std::vector<Mac48Address> retval; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
840 |
if (!m_neighboursCallback.IsNull ()) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
841 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
842 |
retval = m_neighboursCallback (interface); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
843 |
} |
5130 | 844 |
if ((retval.size () >= m_unicastDataThreshold) || (retval.size () == 0)) |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
845 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
846 |
retval.clear (); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
847 |
retval.push_back (Mac48Address::GetBroadcast ()); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
848 |
} |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
849 |
return retval; |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
850 |
} |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
851 |
|
4793 | 852 |
bool |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
853 |
HwmpProtocol::QueuePacket (QueuedPacket packet) |
4793 | 854 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
855 |
if (m_rqueue.size () > m_maxQueueSize) |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
856 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
857 |
return false; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
858 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
859 |
m_rqueue.push_back (packet); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
860 |
return true; |
4793 | 861 |
} |
862 |
||
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
863 |
HwmpProtocol::QueuedPacket |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
864 |
HwmpProtocol::DequeueFirstPacketByDst (Mac48Address dst) |
4793 | 865 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
866 |
QueuedPacket retval; |
5063 | 867 |
retval.pkt = 0; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
868 |
for (std::vector<QueuedPacket>::iterator i = m_rqueue.begin (); i != m_rqueue.end (); i++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
869 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
870 |
if ((*i).dst == dst) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
871 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
872 |
retval = (*i); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
873 |
m_rqueue.erase (i); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
874 |
break; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
875 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
876 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
877 |
return retval; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
878 |
} |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
879 |
|
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
880 |
HwmpProtocol::QueuedPacket |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
881 |
HwmpProtocol::DequeueFirstPacket () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
882 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
883 |
QueuedPacket retval; |
5066
94d5c01b1534
Fixed tests, removes NS_ASSERT (false)
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
884 |
retval.pkt = 0; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
885 |
if (m_rqueue.size () != 0) |
5129 | 886 |
{ |
887 |
retval = m_rqueue[0]; |
|
888 |
m_rqueue.erase (m_rqueue.begin ()); |
|
889 |
} |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
890 |
return retval; |
4793 | 891 |
} |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
892 |
|
4793 | 893 |
void |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
894 |
HwmpProtocol::ReactivePathResolved (Mac48Address dst) |
4793 | 895 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
896 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive (dst); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
897 |
NS_ASSERT(result.retransmitter != Mac48Address::GetBroadcast ()); |
5129 | 898 |
//Send all packets stored for this destination |
5063 | 899 |
QueuedPacket packet = DequeueFirstPacketByDst (dst); |
900 |
while (packet.pkt != 0) |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
901 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
902 |
//set RA tag for retransmitter: |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
903 |
HwmpTag tag; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
904 |
packet.pkt->RemovePacketTag (tag); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
905 |
tag.SetAddress (result.retransmitter); |
4918 | 906 |
packet.pkt->AddPacketTag (tag); |
5038 | 907 |
m_stats.txUnicast ++; |
908 |
m_stats.txBytes += packet.pkt->GetSize (); |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
909 |
packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); |
5129 | 910 |
|
5063 | 911 |
packet = DequeueFirstPacketByDst (dst); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
912 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
913 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
914 |
void |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
915 |
HwmpProtocol::ProactivePathResolved () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
916 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
917 |
//send all packets to root |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
918 |
HwmpRtable::LookupResult result = m_rtable->LookupProactive (); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
919 |
NS_ASSERT (result.retransmitter != Mac48Address::GetBroadcast ()); |
5063 | 920 |
QueuedPacket packet = DequeueFirstPacket (); |
921 |
while (packet.pkt != 0) |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
922 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
923 |
//set RA tag for retransmitter: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
924 |
HwmpTag tag; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
925 |
if (!packet.pkt->RemovePacketTag (tag)) |
5129 | 926 |
{ |
927 |
NS_FATAL_ERROR ("HWMP tag must be present at this point"); |
|
928 |
} |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
929 |
tag.SetAddress (result.retransmitter); |
4918 | 930 |
packet.pkt->AddPacketTag (tag); |
5038 | 931 |
m_stats.txUnicast ++; |
932 |
m_stats.txBytes += packet.pkt->GetSize (); |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
933 |
packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); |
5129 | 934 |
|
5063 | 935 |
packet = DequeueFirstPacket (); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
936 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
937 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
938 |
|
4793 | 939 |
bool |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
940 |
HwmpProtocol::ShouldSendPreq (Mac48Address dst) |
4793 | 941 |
{ |
4945 | 942 |
std::map<Mac48Address, EventId>::const_iterator i = m_preqTimeouts.find (dst); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
943 |
if (i == m_preqTimeouts.end ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
944 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
945 |
m_preqTimeouts[dst] = Simulator::Schedule ( |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
946 |
MilliSeconds (2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
947 |
&HwmpProtocol::RetryPathDiscovery, this, dst, 0); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
948 |
return true; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
949 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
950 |
return false; |
4793 | 951 |
} |
952 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
953 |
HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) |
4793 | 954 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
955 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive (dst); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
956 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
957 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
958 |
result = m_rtable->LookupProactive (); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
959 |
} |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
960 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
961 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
962 |
std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.find (dst); |
5130 | 963 |
NS_ASSERT (i != m_preqTimeouts.end ()); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
964 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
965 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
966 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
967 |
numOfRetry++; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
968 |
if (numOfRetry > m_dot11MeshHWMPmaxPREQretries) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
969 |
{ |
5063 | 970 |
QueuedPacket packet = DequeueFirstPacketByDst (dst); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
971 |
//purge queue and delete entry from retryDatabase |
5063 | 972 |
while (packet.pkt != 0) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
973 |
{ |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
974 |
m_stats.totalDropped ++; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
975 |
packet.reply (false, packet.pkt, packet.src, packet.dst, packet.protocol, HwmpRtable::MAX_METRIC); |
5063 | 976 |
packet = DequeueFirstPacketByDst (dst); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
977 |
} |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
978 |
std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.find (dst); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
979 |
NS_ASSERT (i != m_preqTimeouts.end ()); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
980 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
981 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
982 |
} |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
983 |
uint32_t originator_seqno = GetNextHwmpSeqno (); |
5134 | 984 |
uint32_t dst_seqno = m_rtable->LookupReactiveExpired (dst).seqnum; |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
985 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
986 |
{ |
5130 | 987 |
i->second->RequestDestination (dst, originator_seqno, dst_seqno); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
988 |
} |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
989 |
m_preqTimeouts[dst] = Simulator::Schedule ( |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
990 |
MilliSeconds (2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())), |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
991 |
&HwmpProtocol::RetryPathDiscovery, this, dst, numOfRetry); |
4793 | 992 |
} |
4895 | 993 |
//Proactive PREQ routines: |
994 |
void |
|
995 |
HwmpProtocol::SetRoot () |
|
996 |
{ |
|
4964 | 997 |
UniformVariable coefficient (0.0, m_randomStart.GetSeconds()); |
5130 | 998 |
Time randomStart = Seconds (coefficient.GetValue ()); |
4964 | 999 |
m_proactivePreqTimer = Simulator::Schedule (randomStart, &HwmpProtocol::SendProactivePreq, this); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1000 |
NS_LOG_DEBUG ("ROOT IS: " << m_address); |
4895 | 1001 |
SendProactivePreq (); |
1002 |
m_isRoot = true; |
|
1003 |
} |
|
1004 |
void |
|
1005 |
HwmpProtocol::UnsetRoot () |
|
1006 |
{ |
|
1007 |
m_proactivePreqTimer.Cancel (); |
|
1008 |
} |
|
1009 |
void |
|
1010 |
HwmpProtocol::SendProactivePreq () |
|
1011 |
{ |
|
1012 |
IePreq preq; |
|
1013 |
//By default: must answer |
|
1014 |
preq.SetHopcount (0); |
|
1015 |
preq.SetTTL (m_maxTtl); |
|
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
1016 |
preq.SetLifetime (m_dot11MeshHWMPactiveRootTimeout.GetMicroSeconds () /1024); |
4895 | 1017 |
//\attention: do not forget to set originator address, sequence |
1018 |
//number and preq ID in HWMP-MAC plugin |
|
1019 |
preq.AddDestinationAddressElement (true, true, Mac48Address::GetBroadcast (), 0); |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1020 |
preq.SetOriginatorAddress (GetAddress ()); |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
1021 |
preq.SetPreqID (GetNextPreqId ()); |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
1022 |
preq.SetOriginatorSeqNumber (GetNextHwmpSeqno ()); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1023 |
for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1024 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1025 |
i->second->SendPreq (preq); |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1026 |
} |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
1027 |
m_proactivePreqTimer = Simulator::Schedule (m_dot11MeshHWMPpathToRootInterval, &HwmpProtocol::SendProactivePreq, this); |
4895 | 1028 |
} |
1029 |
bool |
|
1030 |
HwmpProtocol::GetDoFlag () |
|
1031 |
{ |
|
1032 |
return m_doFlag; |
|
1033 |
} |
|
1034 |
bool |
|
1035 |
HwmpProtocol::GetRfFlag () |
|
1036 |
{ |
|
1037 |
return m_rfFlag; |
|
1038 |
} |
|
1039 |
Time |
|
1040 |
HwmpProtocol::GetPreqMinInterval () |
|
1041 |
{ |
|
1042 |
return m_dot11MeshHWMPpreqMinInterval; |
|
1043 |
} |
|
1044 |
Time |
|
1045 |
HwmpProtocol::GetPerrMinInterval () |
|
1046 |
{ |
|
1047 |
return m_dot11MeshHWMPperrMinInterval; |
|
1048 |
} |
|
1049 |
uint8_t |
|
1050 |
HwmpProtocol::GetMaxTtl () |
|
1051 |
{ |
|
1052 |
return m_maxTtl; |
|
1053 |
} |
|
1054 |
uint32_t |
|
1055 |
HwmpProtocol::GetNextPreqId () |
|
1056 |
{ |
|
1057 |
m_preqId ++; |
|
1058 |
return m_preqId; |
|
1059 |
} |
|
1060 |
uint32_t |
|
1061 |
HwmpProtocol::GetNextHwmpSeqno () |
|
1062 |
{ |
|
1063 |
m_hwmpSeqno ++; |
|
1064 |
return m_hwmpSeqno; |
|
1065 |
} |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
1066 |
uint32_t |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
1067 |
HwmpProtocol::GetActivePathLifetime () |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
1068 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
1069 |
return m_dot11MeshHWMPactivePathTimeout.GetMicroSeconds () / 1024; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
1070 |
} |
4923 | 1071 |
uint8_t |
5130 | 1072 |
HwmpProtocol::GetUnicastPerrThreshold () |
4923 | 1073 |
{ |
1074 |
return m_unicastPerrThreshold; |
|
1075 |
} |
|
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
1076 |
Mac48Address |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
1077 |
HwmpProtocol::GetAddress () |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
1078 |
{ |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
1079 |
return m_address; |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
1080 |
} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1081 |
//Statistics: |
5126
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1082 |
HwmpProtocol::Statistics::Statistics () : |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1083 |
txUnicast (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1084 |
txBroadcast (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1085 |
txBytes (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1086 |
droppedTtl (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1087 |
totalQueued (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1088 |
totalDropped (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1089 |
initiatedPreq (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1090 |
initiatedPrep (0), |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1091 |
initiatedPerr (0) |
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5124
diff
changeset
|
1092 |
{} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1093 |
void HwmpProtocol::Statistics::Print (std::ostream & os) const |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1094 |
{ |
5015 | 1095 |
os << "<Statistics " |
5038 | 1096 |
"txUnicast=\"" << txUnicast << "\" " |
1097 |
"txBroadcast=\"" << txBroadcast << "\" " |
|
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1098 |
"txBytes=\"" << txBytes << "\" " |
5039
65524e2ec376
Added dropped TTL field to stats
Kirill Andreev <andreev@iitp.ru>
parents:
5038
diff
changeset
|
1099 |
"droppedTtl=\"" << droppedTtl << "\" " |
5015 | 1100 |
"totalQueued=\"" << totalQueued << "\" " |
5108
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
1101 |
"totalDropped=\"" << totalDropped << "\" " |
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
1102 |
"initiatedPreq=\"" << initiatedPreq << "\" " |
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
1103 |
"initiatedPrep=\"" << initiatedPrep << "\" " |
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
1104 |
"initiatedPerr=\"" << initiatedPerr << "\"\n"; |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1105 |
} |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1106 |
void |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1107 |
HwmpProtocol::Report (std::ostream & os) const |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1108 |
{ |
5015 | 1109 |
os << "<Hwmp " |
1110 |
"address=\"" << m_address << "\"\n" |
|
1111 |
"maxQueueSize=\"" << m_maxQueueSize << "\"\n" |
|
1112 |
"dot11MeshHWMPmaxPREQretries=\"" << (uint16_t)m_dot11MeshHWMPmaxPREQretries << "\"\n" |
|
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1113 |
"dot11MeshHWMPnetDiameterTraversalTime=\"" << m_dot11MeshHWMPnetDiameterTraversalTime.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1114 |
"dot11MeshHWMPpreqMinInterval=\"" << m_dot11MeshHWMPpreqMinInterval.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1115 |
"dot11MeshHWMPperrMinInterval=\"" << m_dot11MeshHWMPperrMinInterval.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1116 |
"dot11MeshHWMPactiveRootTimeout=\"" << m_dot11MeshHWMPactiveRootTimeout.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1117 |
"dot11MeshHWMPactivePathTimeout=\"" << m_dot11MeshHWMPactivePathTimeout.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1118 |
"dot11MeshHWMPpathToRootInterval=\"" << m_dot11MeshHWMPpathToRootInterval.GetSeconds () << "\"\n" |
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
1119 |
"dot11MeshHWMPrannInterval=\"" << m_dot11MeshHWMPrannInterval.GetSeconds () << "\"\n" |
5015 | 1120 |
"isRoot=\"" << m_isRoot << "\"\n" |
1121 |
"maxTtl=\"" << (uint16_t)m_maxTtl << "\"\n" |
|
1122 |
"unicastPerrThreshold=\"" << (uint16_t)m_unicastPerrThreshold << "\"\n" |
|
1123 |
"unicastPreqThreshold=\"" << (uint16_t)m_unicastPreqThreshold << "\"\n" |
|
1124 |
"unicastDataThreshold=\"" << (uint16_t)m_unicastDataThreshold << "\"\n" |
|
1125 |
"doFlag=\"" << m_doFlag << "\"\n" |
|
1126 |
"rfFlag=\"" << m_rfFlag << "\">\n"; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1127 |
m_stats.Print (os); |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1128 |
for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
5012 | 1129 |
{ |
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1130 |
plugin->second->Report (os); |
5012 | 1131 |
} |
1132 |
os << "</Hwmp>\n"; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
1133 |
} |
5013 | 1134 |
void |
1135 |
HwmpProtocol::ResetStats () |
|
1136 |
{ |
|
1137 |
m_stats = Statistics::Statistics (); |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
1138 |
for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
5129 | 1139 |
{ |
5015 | 1140 |
plugin->second->ResetStats (); |
5129 | 1141 |
} |
5013 | 1142 |
} |
1143 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
1144 |
} //namespace dot11s |
5130 | 1145 |
} //namespace ns3 |