author | Kirill Andreev <andreev@iitp.ru> |
Wed, 01 Apr 2009 16:21:42 +0400 | |
changeset 4924 | aa4bd88fadb9 |
parent 4923 | 9ea8561480a2 |
parent 4920 | fbd04c749aaa |
child 4925 | 765deb024525 |
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 |
||
21 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
22 |
#include "hwmp-protocol.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
|
23 |
#include "hwmp-mac-plugin.h" |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
24 |
#include "hwmp-tag.h" |
4891
b8db474bce60
Added HWMP tag to mercurial :)
Kirill Andreev <andreev@iitp.ru>
parents:
4889
diff
changeset
|
25 |
#include "hwmp-rtable.h" |
4793 | 26 |
#include "ns3/log.h" |
27 |
#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
|
28 |
#include "ns3/packet.h" |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
29 |
#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
|
30 |
#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
|
31 |
#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
|
32 |
#include "ns3/mesh-wifi-interface-mac.h" |
4895 | 33 |
#include "ie-dot11s-preq.h" |
34 |
#include "ie-dot11s-prep.h" |
|
35 |
#include "ie-dot11s-perr.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 |
|
4793 | 39 |
namespace ns3 { |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
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> () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
49 |
.AddAttribute ("dot11MeshHWMPmaxPREQretries", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
50 |
"Maximum number of retries before we suppose the destination to be unreachable", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
51 |
UintegerValue (3), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
52 |
MakeUintegerAccessor (&HwmpProtocol::m_dot11MeshHWMPmaxPREQretries), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
53 |
MakeUintegerChecker<uint8_t> (1) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
54 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
55 |
.AddAttribute ("dot11MeshHWMPnetDiameterTraversalTime", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
56 |
"Time we suppose the packet to go from one edge of the network to another", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
57 |
TimeValue (MicroSeconds (1024*10)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
58 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPnetDiameterTraversalTime), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
59 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
60 |
) |
4895 | 61 |
.AddAttribute ("dot11MeshHWMPpreqMinInterval", |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
62 |
"Minimal interval between to successive PREQs", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
63 |
TimeValue (MicroSeconds (1024*100)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
64 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPpreqMinInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
65 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
66 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
67 |
.AddAttribute ("dot11MeshHWMPperrMinInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
68 |
"Minimal interval between to successive PREQs", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
69 |
TimeValue (MicroSeconds (1024*100)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
70 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPperrMinInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
71 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
72 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
73 |
.AddAttribute ("dot11MeshHWMPactiveRootTimeout", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
74 |
"Lifetime of poractive routing information", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
75 |
TimeValue (MicroSeconds (1024*5000)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
76 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPactiveRootTimeout), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
77 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
78 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
79 |
.AddAttribute ("dot11MeshHWMPactivePathTimeout", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
80 |
"Lifetime of reactive routing information", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
81 |
TimeValue (MicroSeconds (1024*5000)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
82 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPactivePathTimeout), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
83 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
84 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
85 |
.AddAttribute ("dot11MeshHWMPpathToRootInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
86 |
"Interval between two successive proactive PREQs", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
87 |
TimeValue (MicroSeconds (1024*5000)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
88 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPpathToRootInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
89 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
90 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
91 |
.AddAttribute ("dot11MeshHWMPrannInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
92 |
"Lifetime of poractive routing information", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
93 |
TimeValue (MicroSeconds (1024*5000)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
94 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPrannInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
95 |
MakeTimeChecker () |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
96 |
) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
97 |
.AddAttribute ("maxQueueSize", |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
98 |
"Maximum number of packets we can store when resolving route", |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
99 |
UintegerValue (255), |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
100 |
MakeUintegerAccessor (&HwmpProtocol::m_maxQueueSize), |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
101 |
MakeUintegerChecker<uint16_t> (1) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
102 |
) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
103 |
.AddAttribute ("maxTtl", |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
104 |
"Initial value of Time To Live field", |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
105 |
UintegerValue (32), |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
106 |
MakeUintegerAccessor (&HwmpProtocol::m_maxTtl), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
107 |
MakeUintegerChecker<uint8_t> (2) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
108 |
) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
109 |
.AddAttribute ("unicastPerrThreshold", |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
110 |
"Maximum number of PERR receivers, when we send a PERR as a chain of unicasts", |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
111 |
UintegerValue (32), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
112 |
MakeUintegerAccessor (&HwmpProtocol::m_unicastPerrThreshold), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
113 |
MakeUintegerChecker<uint8_t> (1) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
114 |
) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
115 |
.AddAttribute ("unicastPreqThreshold", |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
116 |
"Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts", |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
117 |
UintegerValue (0), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
118 |
MakeUintegerAccessor (&HwmpProtocol::m_unicastPreqThreshold), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
119 |
MakeUintegerChecker<uint8_t> (0) |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
120 |
); |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
121 |
return tid; |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
122 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
123 |
HwmpProtocol::HwmpProtocol (): |
4895 | 124 |
m_dataSeqno (1), |
125 |
m_hwmpSeqno (1), |
|
126 |
m_preqId (0), |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
127 |
m_rtable (CreateObject<HwmpRtable> ()), |
4895 | 128 |
m_isRoot (false), |
129 |
m_doFlag (false), |
|
130 |
m_rfFlag (false) |
|
4793 | 131 |
{ |
132 |
} |
|
133 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
134 |
HwmpProtocol::~HwmpProtocol () |
4793 | 135 |
{ |
136 |
} |
|
137 |
||
138 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
139 |
HwmpProtocol::DoDispose () |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
140 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
141 |
for (std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.begin (); i != m_preqTimeouts.end(); i ++) |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
142 |
i->second.Cancel (); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
143 |
m_preqTimeouts.clear (); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
144 |
m_lastDataSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
145 |
m_lastHwmpSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
146 |
m_rqueue.clear (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
147 |
m_rtable = 0; |
4895 | 148 |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
149 |
//TODO: clear plugins |
4793 | 150 |
} |
151 |
||
152 |
bool |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
153 |
HwmpProtocol::RequestRoute ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
154 |
uint32_t sourceIface, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
155 |
const Mac48Address source, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
156 |
const Mac48Address destination, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
157 |
Ptr<Packet> packet, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
158 |
uint16_t protocolType, //ethrnet 'Protocol' field |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
159 |
MeshL2RoutingProtocol::RouteReplyCallback routeReply |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
160 |
) |
4793 | 161 |
{ |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
162 |
HwmpTag tag; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
163 |
if (sourceIface == GetMeshPoint ()->GetIfIndex()) |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
164 |
// packet from level 3 |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
165 |
{ |
4918 | 166 |
NS_ASSERT (!packet->PeekPacketTag(tag)); |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
167 |
//Filling TAG: |
4918 | 168 |
if(destination == Mac48Address::GetBroadcast ()) |
169 |
{ |
|
170 |
tag.SetSeqno (m_dataSeqno++); |
|
171 |
tag.SetAddress (Mac48Address::GetBroadcast()); |
|
172 |
tag.SetTtl (m_maxTtl+1); |
|
173 |
if (m_dataSeqno == 0xffffffff) |
|
174 |
m_dataSeqno = 0; |
|
175 |
NS_LOG_UNCOND("add a tag"<<packet->GetUid()); |
|
176 |
packet->AddPacketTag(tag); |
|
177 |
} |
|
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
178 |
} |
4918 | 179 |
else |
180 |
{ |
|
181 |
NS_ASSERT (packet->PeekPacketTag(tag)); |
|
182 |
if (tag.GetTtl () == 0) |
|
183 |
return false; |
|
184 |
tag.DecrementTtl (); |
|
185 |
} |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
186 |
if (destination == Mac48Address::GetBroadcast ()) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
187 |
routeReply (true, packet, source, destination, protocolType, HwmpRtable::INTERFACE_ANY); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
188 |
else |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
189 |
return ForwardUnicast(sourceIface, source, destination, packet, protocolType, routeReply); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
190 |
return true; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
191 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
192 |
bool |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
193 |
HwmpProtocol::ForwardUnicast(uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
194 |
Ptr<Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
195 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
196 |
NS_ASSERT(destination != Mac48Address::GetBroadcast ()); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
197 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive(destination); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
198 |
if(result.retransmitter == Mac48Address::GetBroadcast ()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
199 |
result = m_rtable->LookupProactive (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
200 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
201 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
202 |
//reply immediately: |
4918 | 203 |
//packet->RemoveAllTags (); |
4906 | 204 |
//Add a proper HWMP-tag: |
205 |
HwmpTag tag; |
|
4918 | 206 |
NS_ASSERT(!packet->RemovePacketTag(tag)); |
4906 | 207 |
tag.SetAddress (result.retransmitter); |
208 |
//seqno and metric is not used; |
|
4918 | 209 |
packet->AddPacketTag(tag); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
210 |
routeReply (true, packet, source, destination, protocolType, result.ifIndex); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
211 |
return true; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
212 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
213 |
if (sourceIface != GetMeshPoint ()->GetIfIndex()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
214 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
215 |
//Start path error procedure: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
216 |
NS_LOG_DEBUG ("Must Send PERR"); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
217 |
result = m_rtable->LookupReactiveExpired (destination); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
218 |
//1. Lookup expired reactive path. If exists - start path error |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
219 |
// procedure towards a next hop of this path |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
220 |
//2. If there was no reactive path, we lookup expired proactive |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
221 |
// path. If exist - start path error procedure towards path to |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
222 |
// root |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
223 |
//3. If and only if we are a root station - we queue packet |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
224 |
if((result.retransmitter == Mac48Address::GetBroadcast ()) && (!m_isRoot)) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
225 |
result = m_rtable->LookupProactiveExpired (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
226 |
if((result.retransmitter == Mac48Address::GetBroadcast ()) && (!m_isRoot)) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
227 |
return false; |
4923 | 228 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (result.retransmitter); |
229 |
MakePathError (destinations); |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
230 |
if(!m_isRoot) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
231 |
return false; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
232 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
233 |
//Request a destination: |
4895 | 234 |
if(ShouldSendPreq(destination)) |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
235 |
for(HwmpPluginMap::iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4895 | 236 |
i->second->RequestDestination(destination); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
237 |
QueuedPacket pkt; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
238 |
HwmpTag tag; |
4918 | 239 |
packet->RemovePacketTag (tag); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
240 |
tag.SetAddress(Mac48Address::GetBroadcast ()); |
4918 | 241 |
packet->AddPacketTag (tag); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
242 |
pkt.pkt = packet; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
243 |
pkt.dst = destination; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
244 |
pkt.src = source; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
245 |
pkt.protocol = protocolType; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
246 |
pkt.reply = routeReply; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
247 |
pkt.inInterface = sourceIface; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
248 |
QueuePacket (pkt); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
249 |
return true; |
4793 | 250 |
} |
4918 | 251 |
bool |
252 |
HwmpProtocol::HandleIncomingFrame (Ptr<Packet> packet, Mac48Address src, Mac48Address dst, uint16_t protocol) |
|
253 |
{ |
|
254 |
//Handle only incoming frames: |
|
255 |
NS_ASSERT(dst == m_address); |
|
256 |
HwmpTag tag; |
|
257 |
NS_ASSERT(packet->RemovePacketTag(tag)); |
|
258 |
return true; |
|
259 |
} |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
260 |
void |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
261 |
HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
262 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
263 |
preq.IncrementMetric (1); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
264 |
//acceptance cretirea: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
265 |
std::map<Mac48Address, uint32_t>::iterator i = m_lastHwmpSeqno.find (preq.GetOriginatorAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
266 |
if (i == m_lastHwmpSeqno.end ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
267 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
268 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
269 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
270 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
271 |
else |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
272 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
273 |
if (i->second > preq.GetOriginatorSeqNumber ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
274 |
return; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
275 |
if (i->second == preq.GetOriginatorSeqNumber ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
276 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
277 |
//find metric |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
278 |
std::map<Mac48Address, uint32_t>::iterator j = |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
279 |
m_lastHwmpMetric.find (preq.GetOriginatorAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
280 |
NS_ASSERT (j != m_lastHwmpSeqno.end()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
281 |
if (j->second <= preq.GetMetric ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
282 |
return; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
283 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
284 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
285 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
286 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
287 |
//check if can answer: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
288 |
std::vector<Ptr<DestinationAddressUnit> > destinations = preq.GetDestinationList (); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
289 |
for (std::vector<Ptr<DestinationAddressUnit> >::iterator i = destinations.begin (); i != destinations.end(); i++) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
290 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
291 |
if ((*i)->GetDestinationAddress () == Mac48Address::GetBroadcast()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
292 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
293 |
//only proactive PREQ contains destination |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
294 |
//address as broadcast! Proactive preq MUST |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
295 |
//have destination count equal to 1 and |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
296 |
//per destination flags DO and RF |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
297 |
NS_ASSERT (preq.GetDestCount() == 1); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
298 |
NS_ASSERT (((*i)->IsDo()) && ((*i)->IsRf())); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
299 |
m_rtable->AddProactivePath ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
300 |
preq.GetMetric (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
301 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
302 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
303 |
interface, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
304 |
MicroSeconds (preq.GetLifetime () * 1024), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
305 |
preq.GetOriginatorSeqNumber () |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
306 |
); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
307 |
ProactivePathResolved (); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
308 |
if (!preq.IsNeedNotPrep ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
309 |
SendPrep ( |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
310 |
m_address, |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
311 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
312 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
313 |
preq.GetMetric (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
314 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
315 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
316 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
317 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
318 |
); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
319 |
break; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
320 |
} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
321 |
if ((*i)->GetDestinationAddress () == m_address) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
322 |
{ |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
323 |
NS_LOG_UNCOND("PREQ has reached destination:"<<m_address); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
324 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
325 |
SendPrep ( |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
326 |
m_address, |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
327 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
328 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
329 |
(uint32_t)0, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
330 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
331 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
332 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
333 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
334 |
); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
335 |
continue; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
336 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
337 |
//check if can answer: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
338 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive ((*i)->GetDestinationAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
339 |
if ((! ((*i)->IsDo())) && (result.retransmitter != Mac48Address::GetBroadcast())) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
340 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
341 |
//have a valid information and acn answer |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
342 |
if ((*i)->IsRf ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
343 |
(*i)->SetFlags (true, false); //DO = 1, RF = 0 (as it was) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
344 |
else |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
345 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
346 |
//send a PREP and delete destination |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
347 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
348 |
SendPrep ( |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
349 |
(*i)->GetDestinationAddress (), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
350 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
351 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
352 |
result.metric, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
353 |
preq.GetOriginatorSeqNumber (), |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
354 |
result.seqnum +1, |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
355 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
356 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
357 |
); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
358 |
continue; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
359 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
360 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
361 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
362 |
m_rtable->AddReactivePath ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
363 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
364 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
365 |
interface, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
366 |
preq.GetMetric (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
367 |
MicroSeconds (preq.GetLifetime () *1024), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
368 |
preq.GetOriginatorSeqNumber () |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
369 |
); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
370 |
ReactivePathResolved (preq.GetOriginatorAddress ()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
371 |
//m_routingInfoCallback (newInfo); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
372 |
//chack if must retransmit: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
373 |
if (preq.GetDestCount () == 0) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
374 |
return; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
375 |
//Forward PREQ to all interfaces: |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
376 |
NS_LOG_UNCOND("I am "<<m_address<<"retransmitting PREQ:"<<preq); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
377 |
for(HwmpPluginMap::iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
378 |
i->second->SendPreq (preq); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
379 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
380 |
void |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
381 |
HwmpProtocol::ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
382 |
{ |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
383 |
prep.IncrementMetric (1); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
384 |
//acceptance cretirea: |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
385 |
NS_LOG_UNCOND("I am "<<m_address<<", received prep"); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
386 |
std::map<Mac48Address, uint32_t>::iterator i = m_lastHwmpSeqno.find (prep.GetOriginatorAddress()); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
387 |
if (i == m_lastHwmpSeqno.end ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
388 |
{ |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
389 |
m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber(); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
390 |
} |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
391 |
else |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
392 |
if (i->second > prep.GetOriginatorSeqNumber ()) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
393 |
return; |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
394 |
//update routing info |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
395 |
//Now add a path to destination and add precursor to source |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
396 |
m_rtable->AddPrecursor (prep.GetDestinationAddress (), interface, from); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
397 |
m_rtable->AddReactivePath ( |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
398 |
prep.GetOriginatorAddress (), |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
399 |
from, |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
400 |
interface, |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
401 |
prep.GetMetric (), |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
402 |
MicroSeconds(prep.GetLifetime () * 1024), |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
403 |
prep.GetOriginatorSeqNumber ()); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
404 |
if(prep.GetDestinationAddress() == m_address) |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
405 |
NS_LOG_UNCOND("Destination resolved:"<<prep.GetOriginatorAddress ()); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
406 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive(prep.GetDestinationAddress()); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
407 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
408 |
//try to look for default route |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
409 |
result = m_rtable->LookupProactive (); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
410 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
411 |
{ |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
412 |
NS_LOG_UNCOND("I am "<<m_address<<", can not forward prep"); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
413 |
return; |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
414 |
} |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
415 |
m_rtable->AddPrecursor (prep.GetOriginatorAddress (), interface, result.retransmitter); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
416 |
//Forward PREP |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
417 |
HwmpPluginMap::iterator prep_sender = m_interfaces.find (result.ifIndex); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
418 |
NS_ASSERT(prep_sender != m_interfaces.end ()); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
419 |
prep_sender->second->SendPrep(prep, result.retransmitter); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
420 |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
421 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
422 |
void |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
423 |
HwmpProtocol::ReceivePerr (IePerr perr, Mac48Address from, uint32_t interface) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
424 |
{ |
4923 | 425 |
//Acceptance cretirea: |
426 |
NS_LOG_UNCOND("I am "<<m_address<<", received PERR from "<<from); |
|
427 |
std::vector<IePerr::FailedDestination> destinations = perr.GetAddressUnitVector (); |
|
428 |
HwmpRtable::LookupResult result; |
|
429 |
for(unsigned int i = 0; i < destinations.size (); i ++) |
|
430 |
{ |
|
431 |
result = m_rtable->LookupReactive (destinations[i].destination); |
|
432 |
NS_LOG_UNCOND("Destination = "<<destinations[i].destination<<", RA = "<<result.retransmitter); |
|
433 |
if ( |
|
434 |
(result.retransmitter != from) || |
|
435 |
(result.ifIndex != interface) || |
|
436 |
(result.seqnum > destinations[i].seqnum) |
|
437 |
) |
|
438 |
{ |
|
439 |
perr.DeleteAddressUnit(destinations[i].destination); |
|
440 |
continue; |
|
441 |
} |
|
442 |
m_rtable->DeleteReactivePath(destinations[i].destination); |
|
443 |
} |
|
444 |
if(perr.GetNumOfDest () == 0) |
|
445 |
return; |
|
446 |
MakePathError (destinations); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
447 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
448 |
void |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
449 |
HwmpProtocol::SendPrep ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
450 |
Mac48Address src, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
451 |
Mac48Address dst, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
452 |
Mac48Address retransmitter, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
453 |
uint32_t initMetric, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
454 |
uint32_t originatorDsn, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
455 |
uint32_t destinationSN, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
456 |
uint32_t lifetime, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
457 |
uint32_t interface) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
458 |
{ |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
459 |
NS_LOG_UNCOND("sending prep to "<<dst<<" through "<<retransmitter); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
460 |
IePrep prep; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
461 |
prep.SetHopcount (0); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
462 |
prep.SetTtl (m_maxTtl); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
463 |
prep.SetDestinationAddress (dst); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
464 |
prep.SetDestinationSeqNumber (destinationSN); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
465 |
prep.SetLifetime (lifetime); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
466 |
prep.SetMetric (0); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
467 |
prep.SetOriginatorAddress (src); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
468 |
prep.SetOriginatorSeqNumber (originatorDsn); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
469 |
HwmpPluginMap::iterator prep_sender = m_interfaces.find (interface); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
470 |
NS_ASSERT(prep_sender != m_interfaces.end ()); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
471 |
prep_sender->second->SendPrep(prep, retransmitter); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
472 |
//m_prepCallback (prep, retransmitter); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
473 |
|
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
474 |
} |
4793 | 475 |
bool |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
476 |
HwmpProtocol::Install (Ptr<MeshPointDevice> mp) |
4793 | 477 |
{ |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
478 |
m_mp = mp; |
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
479 |
std::vector<Ptr<NetDevice> > interfaces = mp->GetInterfaces (); |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
480 |
for (std::vector<Ptr<NetDevice> >::iterator i = interfaces.begin (); i != interfaces.end(); i++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
481 |
{ |
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
|
482 |
// Checking for compatible net device |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
483 |
const WifiNetDevice * wifiNetDev = dynamic_cast<const WifiNetDevice *> (PeekPointer (*i)); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
484 |
if (wifiNetDev == NULL) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
485 |
return false; |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
486 |
MeshWifiInterfaceMac * mac = dynamic_cast<MeshWifiInterfaceMac *> (PeekPointer (wifiNetDev->GetMac ())); |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
487 |
if (mac == NULL) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
488 |
return false; |
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
|
489 |
// Installing plugins: |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
490 |
Ptr<HwmpMacPlugin> hwmpMac = Create<HwmpMacPlugin> (wifiNetDev->GetIfIndex (), this); |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
491 |
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
|
492 |
mac->InstallPlugin (hwmpMac); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
493 |
} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
494 |
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
|
495 |
// Mesh point aggregates all installed protocols |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
496 |
mp->AggregateObject (this); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
497 |
//Address tmp_addr = mp->GetAddress (); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
498 |
//Mac48Address * address = dynamic_cast<Mac48Address *> (&tmp_addr); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
499 |
//if (address == NULL) |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
500 |
// return false; |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
501 |
m_address = Mac48Address::ConvertFrom (mp->GetAddress ());//* address; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
502 |
return true; |
4793 | 503 |
} |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
504 |
void |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
505 |
HwmpProtocol::PeerLinkStatus(Mac48Address peerAddress, uint32_t interface, bool status) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
506 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
507 |
if(status) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
508 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
509 |
// m_rtable->AddReactivePath(peerAddress, peerAddress, interface, 1, Seconds (0), 0); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
510 |
} |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
511 |
else |
4923 | 512 |
{ |
513 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (peerAddress); |
|
514 |
MakePathError (destinations); |
|
515 |
} |
|
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
516 |
} |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
517 |
void |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
518 |
HwmpProtocol::SetNeighboursCallback(Callback<std::vector<Mac48Address>, uint32_t> cb) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
519 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
520 |
m_neighboursCallback = cb; |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
521 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
522 |
bool |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
523 |
HwmpProtocol::DropDataFrame(uint32_t seqno, Mac48Address source) |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
524 |
{ |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
525 |
std::map<Mac48Address, uint32_t,std::less<Mac48Address> >::iterator i = m_lastDataSeqno.find (source); |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
526 |
if (i == m_lastDataSeqno.end ()) |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
527 |
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
|
528 |
else |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
529 |
{ |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
530 |
if (i->second >= seqno) |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
531 |
return true; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
532 |
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
|
533 |
} |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
534 |
return false; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
535 |
} |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
536 |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
537 |
#if 0 |
4793 | 538 |
void |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
539 |
HwmpProtocol::ObtainRoutingInformation ( |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
540 |
HwmpProtocolState::INFO info |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
541 |
) |
4793 | 542 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
543 |
switch (info.type) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
544 |
{ |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
545 |
case HwmpProtocolState::INFO_PREP: |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
546 |
if (info.me != info.source) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
547 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
548 |
m_rtable->AddPrecursor (info.source, info.outPort, info.nextHop); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
549 |
m_rtable->AddPrecursor (info.destination, info.outPort, info.prevHop); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
550 |
NS_LOG_DEBUG ("path to "<<info.source<<" precursor is "<<info.nextHop); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
551 |
NS_LOG_DEBUG ("path to "<<info.destination<<" precursor is "<<info.prevHop); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
552 |
} |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
553 |
case HwmpProtocolState::INFO_PREQ: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
554 |
m_rtable->AddReactivePath ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
555 |
info.destination, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
556 |
info.nextHop, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
557 |
info.outPort, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
558 |
info.metric, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
559 |
info.lifetime, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
560 |
info.dsn); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
561 |
SendAllPossiblePackets (info.destination); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
562 |
break; |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
563 |
case HwmpProtocolState::INFO_PERR: |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
564 |
//delete first subentry |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
565 |
case HwmpProtocolState::INFO_PROACTIVE: |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
566 |
//add information to the root MP. |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
567 |
m_rtable->AddProactivePath ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
568 |
info.metric, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
569 |
info.destination, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
570 |
info.nextHop, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
571 |
info.outPort, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
572 |
info.lifetime, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
573 |
info.dsn); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
574 |
//Set mode as PROACTIVE: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
575 |
SetProactive (info.outPort); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
576 |
break; |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
577 |
case HwmpProtocolState::INFO_NEW_PEER: |
4793 | 578 |
#if 0 |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
579 |
m_rtable->AddReactivePath ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
580 |
info.destination, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
581 |
info.nextHop, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
582 |
info.outPort, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
583 |
info.metric, |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
584 |
Seconds (0), |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
585 |
0); |
4793 | 586 |
#endif |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
587 |
break; |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
588 |
case HwmpProtocolState::INFO_FAILED_PEER: |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
589 |
/** |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
590 |
* Conditions for generating PERR |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
591 |
*/ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
592 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
593 |
NS_LOG_DEBUG ("Failed peer"<<info.destination); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
594 |
std::vector<HwmpRtable::FailedDestination> failedDestinations = |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
595 |
m_rtable->GetUnreachableDestinations (info.destination, info.outPort); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
596 |
/** |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
597 |
* Entry about peer does not contain seqnum |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
598 |
*/ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
599 |
HwmpRtable::FailedDestination peer; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
600 |
peer.destination = info.destination; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
601 |
peer.seqnum = 0; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
602 |
failedDestinations.push_back (peer); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
603 |
MakePathError (failedDestinations, info.outPort); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
604 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
605 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
606 |
default: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
607 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
608 |
} |
4793 | 609 |
} |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
610 |
#endif |
4793 | 611 |
void |
4923 | 612 |
HwmpProtocol::MakePathError (std::vector<IePerr::FailedDestination> destinations) |
4793 | 613 |
{ |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
614 |
NS_LOG_UNCOND ("START PERR, I am "<<m_address); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
615 |
//TODO: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
616 |
//make a perr IE and send |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
617 |
//HwmpRtable increments a sequence number as written in 11B.9.7.2 |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
618 |
NS_LOG_UNCOND("Number of unreachable destinations:"<<destinations.size ()); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
619 |
for(std::vector<IePerr::FailedDestination>::iterator i = destinations.begin (); i != destinations.end (); i ++) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
620 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
621 |
HwmpRtable::LookupResult result = m_rtable->LookupReactiveExpired (i->destination); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
622 |
NS_LOG_UNCOND("Address::"<<i->destination<<", next hop is "<<result.retransmitter); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
623 |
} |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
624 |
std::vector<std::pair<uint32_t, Mac48Address> > receivers = GetPerrReceivers (destinations); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
625 |
NS_LOG_UNCOND("Number of perr receivers:"<<receivers.size ()); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
626 |
if(receivers.size () == 0) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
627 |
return; |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
628 |
for(std::vector<std::pair<uint32_t, Mac48Address> >::iterator i = receivers.begin (); i != receivers.end (); i ++) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
629 |
NS_LOG_UNCOND("Address:"<<i->second<<", interface:"<<i->first); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
630 |
//form a path error and send it to proper ports |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
631 |
IePerr perr; |
4923 | 632 |
for(unsigned int i = 0; i < destinations.size (); i ++) |
633 |
{ |
|
634 |
perr.AddAddressUnit(destinations[i]); |
|
635 |
m_rtable->DeleteReactivePath(destinations[i].destination); |
|
636 |
} |
|
637 |
for(HwmpPluginMap::iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
|
638 |
{ |
|
639 |
std::vector<Mac48Address> receivers_for_interface; |
|
640 |
for(unsigned int j = 0; j < receivers.size(); j ++) |
|
641 |
if(i->first == receivers[j].first) |
|
642 |
receivers_for_interface.push_back(receivers[j].second); |
|
643 |
i->second->SendOnePerr (perr, receivers_for_interface); |
|
644 |
} |
|
645 |
||
4793 | 646 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
647 |
std::vector<std::pair<uint32_t, Mac48Address> > |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
648 |
HwmpProtocol::GetPerrReceivers (std::vector<IePerr::FailedDestination> failedDest) |
4793 | 649 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4919
diff
changeset
|
650 |
HwmpRtable::PrecursorList retval; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
651 |
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
|
652 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4919
diff
changeset
|
653 |
HwmpRtable::PrecursorList precursors = m_rtable->GetPrecursors(failedDest[i].destination); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
654 |
m_rtable->DeleteReactivePath (failedDest[i].destination); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
655 |
m_rtable->DeleteProactivePath(failedDest[i].destination); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
656 |
for (unsigned int j = 0; j < precursors.size (); j ++) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
657 |
retval.push_back(precursors[j]); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
658 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
659 |
//Check if we have dublicates in retval and precursors: |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
660 |
unsigned int size = retval.size(); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
661 |
for (unsigned int i = 0; i < size; i ++) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
662 |
for (unsigned int j = i; j < size; j ++) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
663 |
if(retval[i].second == retval[j].second) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
664 |
{ |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
665 |
//erase and check size |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
666 |
NS_LOG_UNCOND("deleting dublicate"); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
667 |
retval.erase(retval.begin() + j); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
668 |
size --; |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
669 |
} |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
670 |
return retval; |
4793 | 671 |
} |
4895 | 672 |
std::vector<Mac48Address> |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
673 |
HwmpProtocol::GetPreqReceivers (uint32_t interface) |
4895 | 674 |
{ |
675 |
std::vector<Mac48Address> retval; |
|
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
676 |
if(!m_neighboursCallback.IsNull ()) retval = m_neighboursCallback (interface); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
677 |
if (retval.size() >= m_unicastPreqThreshold) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
678 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
679 |
retval.clear (); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
680 |
retval.push_back (Mac48Address::GetBroadcast ()); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
681 |
} |
4895 | 682 |
return retval; |
683 |
} |
|
4793 | 684 |
bool |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
685 |
HwmpProtocol::QueuePacket (QueuedPacket packet) |
4793 | 686 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
687 |
if (m_rqueue.size () > m_maxQueueSize) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
688 |
return false; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
689 |
m_rqueue.push_back (packet); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
690 |
return true; |
4793 | 691 |
} |
692 |
||
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
693 |
MeshL2RoutingProtocol::QueuedPacket |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
694 |
HwmpProtocol::DequeueFirstPacketByDst (Mac48Address dst) |
4793 | 695 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
696 |
QueuedPacket retval; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
697 |
retval.pkt = NULL; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
698 |
for(std::vector<QueuedPacket>::iterator i = m_rqueue.begin (); i != m_rqueue.end (); i++) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
699 |
if((*i).dst == dst) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
700 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
701 |
retval = (*i); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
702 |
m_rqueue.erase (i); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
703 |
break; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
704 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
705 |
return retval; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
706 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
707 |
MeshL2RoutingProtocol::QueuedPacket |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
708 |
HwmpProtocol::DequeueFirstPacket () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
709 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
710 |
QueuedPacket retval; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
711 |
retval.pkt = NULL; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
712 |
if(m_rqueue.size () != 0) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
713 |
retval = m_rqueue[0]; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
714 |
m_rqueue.erase (m_rqueue.begin ()); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
715 |
return retval; |
4793 | 716 |
} |
717 |
void |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
718 |
HwmpProtocol::ReactivePathResolved (Mac48Address dst) |
4793 | 719 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
720 |
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
|
721 |
NS_ASSERT(result.retransmitter != Mac48Address::GetBroadcast ()); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
722 |
//Send all packets stored for this destination |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
723 |
QueuedPacket packet; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
724 |
while (1) |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
725 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
726 |
packet = DequeueFirstPacketByDst (dst); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
727 |
if (packet.pkt == NULL) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
728 |
return; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
729 |
//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
|
730 |
HwmpTag tag; |
4918 | 731 |
NS_ASSERT (packet.pkt->PeekPacketTag(tag)); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
732 |
tag.SetAddress (result.retransmitter); |
4918 | 733 |
packet.pkt->AddPacketTag (tag); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
734 |
packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
735 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
736 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
737 |
void |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
738 |
HwmpProtocol::ProactivePathResolved () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
739 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
740 |
//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
|
741 |
HwmpRtable::LookupResult result = m_rtable->LookupProactive (); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
742 |
NS_ASSERT(result.retransmitter != Mac48Address::GetBroadcast ()); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
743 |
QueuedPacket packet; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
744 |
while (1) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
745 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
746 |
packet = DequeueFirstPacket (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
747 |
if (packet.pkt == NULL) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
748 |
return; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
749 |
//set RA tag for retransmitter: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
750 |
HwmpTag tag; |
4918 | 751 |
NS_ASSERT (packet.pkt->PeekPacketTag(tag)); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
752 |
tag.SetAddress (result.retransmitter); |
4918 | 753 |
packet.pkt->AddPacketTag (tag); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
754 |
packet.reply (true, packet.pkt, packet.src, packet.dst, packet.protocol, result.ifIndex); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
755 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
756 |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
757 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
758 |
|
4793 | 759 |
bool |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
760 |
HwmpProtocol::ShouldSendPreq (Mac48Address dst) |
4793 | 761 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
762 |
std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.find (dst); |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
763 |
if (i == m_preqTimeouts.end ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
764 |
{ |
4895 | 765 |
NS_LOG_UNCOND("Timeout is:" <<2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
766 |
m_preqTimeouts[dst] = Simulator::Schedule ( |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
767 |
MilliSeconds (2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
768 |
&HwmpProtocol::RetryPathDiscovery, this, dst, 0); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
769 |
return true; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
770 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
771 |
return false; |
4793 | 772 |
} |
773 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
774 |
HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) |
4793 | 775 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
776 |
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
|
777 |
if(result.retransmitter == Mac48Address::GetBroadcast ()) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
778 |
result = m_rtable->LookupProactive (); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
779 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
780 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
781 |
std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.find (dst); |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
782 |
NS_ASSERT (i != m_preqTimeouts.end()); |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
783 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
784 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
785 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
786 |
numOfRetry++; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
787 |
if (numOfRetry > m_dot11MeshHWMPmaxPREQretries) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
788 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
789 |
QueuedPacket packet; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
790 |
//purge queue and delete entry from retryDatabase |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
791 |
while (1) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
792 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
793 |
packet = DequeueFirstPacketByDst (dst); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
794 |
if (packet.pkt == NULL) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
795 |
break; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
796 |
packet.reply (false, packet.pkt, packet.src, packet.dst, packet.protocol, HwmpRtable::MAX_METRIC); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
797 |
} |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
798 |
std::map<Mac48Address, EventId>::iterator i = m_preqTimeouts.find (dst); |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
799 |
NS_ASSERT (i != m_preqTimeouts.end()); |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
800 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
801 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
802 |
} |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
803 |
for(HwmpPluginMap::iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
804 |
{ |
4895 | 805 |
i->second->RequestDestination(dst); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
806 |
i->second->RequestDestination(Mac48Address("00:00:00:00:00:10")); |
4923 | 807 |
i->second->RequestDestination(Mac48Address("00:00:00:00:00:24")); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
808 |
} |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
809 |
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
|
810 |
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
|
811 |
&HwmpProtocol::RetryPathDiscovery, this, dst, numOfRetry); |
4793 | 812 |
} |
4895 | 813 |
//Proactive PREQ routines: |
814 |
void |
|
815 |
HwmpProtocol::SetRoot () |
|
816 |
{ |
|
817 |
SendProactivePreq (); |
|
818 |
m_isRoot = true; |
|
819 |
} |
|
820 |
void |
|
821 |
HwmpProtocol::UnsetRoot () |
|
822 |
{ |
|
823 |
m_proactivePreqTimer.Cancel (); |
|
824 |
} |
|
825 |
void |
|
826 |
HwmpProtocol::SendProactivePreq () |
|
827 |
{ |
|
828 |
NS_LOG_DEBUG ("Sending proactive PREQ"); |
|
829 |
IePreq preq; |
|
830 |
//By default: must answer |
|
831 |
preq.SetHopcount (0); |
|
832 |
preq.SetTTL (m_maxTtl); |
|
833 |
if (m_preqId == 0xffffffff) |
|
834 |
m_preqId = 0; |
|
835 |
preq.SetLifetime (m_dot11MeshHWMPpathToRootInterval.GetMicroSeconds () /1024); |
|
836 |
//\attention: do not forget to set originator address, sequence |
|
837 |
//number and preq ID in HWMP-MAC plugin |
|
838 |
preq.AddDestinationAddressElement (true, true, Mac48Address::GetBroadcast (), 0); |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
839 |
for(HwmpPluginMap::iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
840 |
i->second->SendPreq(preq); |
4895 | 841 |
m_proactivePreqTimer = Simulator::Schedule (m_dot11MeshHWMPactiveRootTimeout, &HwmpProtocol::SendProactivePreq, this); |
842 |
} |
|
843 |
bool |
|
844 |
HwmpProtocol::GetDoFlag () |
|
845 |
{ |
|
846 |
return m_doFlag; |
|
847 |
} |
|
848 |
bool |
|
849 |
HwmpProtocol::GetRfFlag () |
|
850 |
{ |
|
851 |
return m_rfFlag; |
|
852 |
} |
|
853 |
Time |
|
854 |
HwmpProtocol::GetPreqMinInterval () |
|
855 |
{ |
|
856 |
return m_dot11MeshHWMPpreqMinInterval; |
|
857 |
} |
|
858 |
Time |
|
859 |
HwmpProtocol::GetPerrMinInterval () |
|
860 |
{ |
|
861 |
return m_dot11MeshHWMPperrMinInterval; |
|
862 |
} |
|
863 |
uint8_t |
|
864 |
HwmpProtocol::GetMaxTtl () |
|
865 |
{ |
|
866 |
return m_maxTtl; |
|
867 |
} |
|
868 |
uint32_t |
|
869 |
HwmpProtocol::GetNextPreqId () |
|
870 |
{ |
|
871 |
m_preqId ++; |
|
872 |
if(m_preqId == 0xffffffff) |
|
873 |
m_preqId = 0; |
|
874 |
return m_preqId; |
|
875 |
} |
|
876 |
uint32_t |
|
877 |
HwmpProtocol::GetNextHwmpSeqno () |
|
878 |
{ |
|
879 |
m_hwmpSeqno ++; |
|
880 |
if(m_hwmpSeqno == 0xffffffff) |
|
881 |
m_hwmpSeqno = 0; |
|
882 |
return m_hwmpSeqno; |
|
883 |
} |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
884 |
uint32_t |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
885 |
HwmpProtocol::GetActivePathLifetime () |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
886 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
887 |
return m_dot11MeshHWMPactivePathTimeout.GetMicroSeconds () / 1024; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
888 |
} |
4923 | 889 |
uint8_t |
890 |
HwmpProtocol::GetUnicastPerrThreshold() |
|
891 |
{ |
|
892 |
return m_unicastPerrThreshold; |
|
893 |
} |
|
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
894 |
Mac48Address |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
895 |
HwmpProtocol::GetAddress () |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
896 |
{ |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
897 |
return m_address; |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
898 |
} |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
899 |
} //namespace dot11s |
4793 | 900 |
} //namespace ns3 |