author | Kirill Andreev <andreev@iitp.ru> |
Mon, 01 Jun 2009 13:11:30 +0400 | |
changeset 5038 | 0b8f9da17a56 |
parent 5035 | 8ce48024f179 |
child 5039 | 65524e2ec376 |
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" |
4964 | 33 |
#include "ns3/random-variable.h" |
4895 | 34 |
#include "ie-dot11s-preq.h" |
35 |
#include "ie-dot11s-prep.h" |
|
36 |
#include "ie-dot11s-perr.h" |
|
4793 | 37 |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
38 |
NS_LOG_COMPONENT_DEFINE ("HwmpProtocol"); |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
39 |
|
4793 | 40 |
namespace ns3 { |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
41 |
namespace dot11s { |
4793 | 42 |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
43 |
NS_OBJECT_ENSURE_REGISTERED (HwmpProtocol); |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
44 |
TypeId |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
45 |
HwmpProtocol::GetTypeId () |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
46 |
{ |
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
|
47 |
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
|
48 |
.SetParent<MeshL2RoutingProtocol> () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
49 |
.AddConstructor<HwmpProtocol> () |
4983 | 50 |
.AddAttribute ("RandomStart", "Random delay at first proactive PREQ", |
51 |
TimeValue (Seconds (0.1)), |
|
52 |
MakeTimeAccessor (&HwmpProtocol::m_randomStart), |
|
53 |
MakeTimeChecker () |
|
54 |
) |
|
55 |
.AddAttribute ("maxQueueSize", |
|
56 |
"Maximum number of packets we can store when resolving route", |
|
57 |
UintegerValue (255), |
|
58 |
MakeUintegerAccessor (&HwmpProtocol::m_maxQueueSize), |
|
59 |
MakeUintegerChecker<uint16_t> (1) |
|
60 |
) |
|
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
61 |
.AddAttribute ("dot11MeshHWMPmaxPREQretries", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
62 |
"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
|
63 |
UintegerValue (3), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
64 |
MakeUintegerAccessor (&HwmpProtocol::m_dot11MeshHWMPmaxPREQretries), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
65 |
MakeUintegerChecker<uint8_t> (1) |
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 ("dot11MeshHWMPnetDiameterTraversalTime", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
68 |
"Time we suppose the packet to go from one edge of the network to another", |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
69 |
TimeValue (MicroSeconds (1024*100)), |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
70 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPnetDiameterTraversalTime), |
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 |
) |
4895 | 73 |
.AddAttribute ("dot11MeshHWMPpreqMinInterval", |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
74 |
"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
|
75 |
TimeValue (MicroSeconds (1024*100)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
76 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPpreqMinInterval), |
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 ("dot11MeshHWMPperrMinInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
80 |
"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
|
81 |
TimeValue (MicroSeconds (1024*100)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
82 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPperrMinInterval), |
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 ("dot11MeshHWMPactiveRootTimeout", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
86 |
"Lifetime of poractive routing information", |
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_dot11MeshHWMPactiveRootTimeout), |
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 ("dot11MeshHWMPactivePathTimeout", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
92 |
"Lifetime of reactive 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_dot11MeshHWMPactivePathTimeout), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
95 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
96 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
97 |
.AddAttribute ("dot11MeshHWMPpathToRootInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
98 |
"Interval between two successive proactive PREQs", |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
99 |
TimeValue (MicroSeconds (1024*2000)), |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
100 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPpathToRootInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
101 |
MakeTimeChecker () |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
102 |
) |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
103 |
.AddAttribute ("dot11MeshHWMPrannInterval", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
104 |
"Lifetime of poractive routing information", |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
105 |
TimeValue (MicroSeconds (1024*5000)), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
106 |
MakeTimeAccessor (&HwmpProtocol::m_dot11MeshHWMPrannInterval), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
107 |
MakeTimeChecker () |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
108 |
) |
4983 | 109 |
.AddAttribute ("maxTtl", |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
110 |
"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
|
111 |
UintegerValue (32), |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
112 |
MakeUintegerAccessor (&HwmpProtocol::m_maxTtl), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
113 |
MakeUintegerChecker<uint8_t> (2) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
114 |
) |
4983 | 115 |
.AddAttribute ("unicastPerrThreshold", |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
116 |
"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
|
117 |
UintegerValue (32), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
118 |
MakeUintegerAccessor (&HwmpProtocol::m_unicastPerrThreshold), |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
119 |
MakeUintegerChecker<uint8_t> (1) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
120 |
) |
4983 | 121 |
.AddAttribute ("unicastPreqThreshold", |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
122 |
"Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts", |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
123 |
UintegerValue (1), |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
124 |
MakeUintegerAccessor (&HwmpProtocol::m_unicastPreqThreshold), |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
125 |
MakeUintegerChecker<uint8_t> (1) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
126 |
) |
4983 | 127 |
.AddAttribute ("unicastDataThreshold", |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
128 |
"Maximum number ofbroadcast receivers, when we send a broadcast as a chain of unicasts", |
4947 | 129 |
UintegerValue (1), |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
130 |
MakeUintegerAccessor (&HwmpProtocol::m_unicastDataThreshold), |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
131 |
MakeUintegerChecker<uint8_t> (1) |
4943
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
132 |
) |
4983 | 133 |
.AddAttribute ("doFlag", |
4943
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
134 |
"Destination only HWMP flag", |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
135 |
BooleanValue (false), |
4943
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
136 |
MakeUintegerAccessor (&HwmpProtocol::m_doFlag), |
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
137 |
MakeUintegerChecker<bool> () |
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
138 |
) |
4983 | 139 |
.AddAttribute ("rfFlag", |
4943
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
140 |
"Reply and forward flag", |
4989
5f5b321b92d1
Ack timeout patch was merged. HWMP: DO=1 by default, if packet is unresolved -
Kirill Andreev <andreev@iitp.ru>
parents:
4984
diff
changeset
|
141 |
BooleanValue (true), |
4943
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
142 |
MakeUintegerAccessor (&HwmpProtocol::m_rfFlag), |
ef084a06119d
Bugfixes. HWMP on 2-interface network works!
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
143 |
MakeUintegerChecker<bool> () |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
144 |
); |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
145 |
return tid; |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
146 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
147 |
HwmpProtocol::HwmpProtocol (): |
4895 | 148 |
m_dataSeqno (1), |
149 |
m_hwmpSeqno (1), |
|
150 |
m_preqId (0), |
|
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
151 |
m_rtable (CreateObject<HwmpRtable> ()), |
4983 | 152 |
m_randomStart(Seconds (0.1)), |
153 |
m_maxQueueSize (255), |
|
154 |
m_dot11MeshHWMPmaxPREQretries (3), |
|
155 |
m_dot11MeshHWMPnetDiameterTraversalTime (MicroSeconds (1024*100)), |
|
156 |
m_dot11MeshHWMPpreqMinInterval (MicroSeconds (1024*100)), |
|
157 |
m_dot11MeshHWMPperrMinInterval (MicroSeconds (1024*100)), |
|
158 |
m_dot11MeshHWMPactiveRootTimeout (MicroSeconds (1024*5000)), |
|
159 |
m_dot11MeshHWMPactivePathTimeout (MicroSeconds (1024*5000)), |
|
160 |
m_dot11MeshHWMPpathToRootInterval (MicroSeconds (1024*2000)), |
|
161 |
m_dot11MeshHWMPrannInterval (MicroSeconds (1024*5000)), |
|
162 |
m_isRoot (false), |
|
163 |
m_maxTtl (32), |
|
164 |
m_unicastPerrThreshold (32), |
|
165 |
m_unicastPreqThreshold (1), |
|
166 |
m_unicastDataThreshold (1), |
|
167 |
m_doFlag (false), |
|
168 |
m_rfFlag (false) |
|
4793 | 169 |
{ |
4983 | 170 |
if(m_isRoot) |
171 |
SetRoot (); |
|
4793 | 172 |
} |
173 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
174 |
HwmpProtocol::~HwmpProtocol () |
4793 | 175 |
{ |
176 |
} |
|
177 |
||
178 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
179 |
HwmpProtocol::DoDispose () |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
180 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
181 |
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
|
182 |
i->second.Cancel (); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
183 |
m_preqTimeouts.clear (); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
184 |
m_lastDataSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
185 |
m_lastHwmpSeqno.clear (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
186 |
m_rqueue.clear (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
187 |
m_rtable = 0; |
4895 | 188 |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
189 |
//TODO: clear plugins |
4793 | 190 |
} |
191 |
||
192 |
bool |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
193 |
HwmpProtocol::RequestRoute ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
194 |
uint32_t sourceIface, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
195 |
const Mac48Address source, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
196 |
const Mac48Address destination, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
197 |
Ptr<Packet> packet, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
198 |
uint16_t protocolType, //ethrnet 'Protocol' field |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
199 |
MeshL2RoutingProtocol::RouteReplyCallback routeReply |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
200 |
) |
4793 | 201 |
{ |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
202 |
HwmpTag tag; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
203 |
if (sourceIface == GetMeshPoint ()->GetIfIndex()) |
4817
1257e4b82e17
L2RoutingProtocol refactored to MeshL2RoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4813
diff
changeset
|
204 |
// 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
|
205 |
{ |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
206 |
if(packet->PeekPacketTag(tag)) |
4953
0226369989a3
Added {} in 'if' where ASSERT exists
Kirill Andreev <andreev@iitp.ru>
parents:
4950
diff
changeset
|
207 |
{ |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
208 |
NS_ASSERT (false); |
4953
0226369989a3
Added {} in 'if' where ASSERT exists
Kirill Andreev <andreev@iitp.ru>
parents:
4950
diff
changeset
|
209 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
210 |
//Filling TAG: |
4918 | 211 |
if(destination == Mac48Address::GetBroadcast ()) |
212 |
tag.SetSeqno (m_dataSeqno++); |
|
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
213 |
tag.SetTtl (m_maxTtl+1); |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
214 |
} |
4918 | 215 |
else |
216 |
{ |
|
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
217 |
if(!packet->RemovePacketTag(tag)) |
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
218 |
{ |
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
219 |
NS_ASSERT(false); |
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
220 |
return false; |
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
221 |
} |
4918 | 222 |
if (tag.GetTtl () == 0) |
223 |
return false; |
|
224 |
tag.DecrementTtl (); |
|
225 |
} |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
226 |
if (destination == Mac48Address::GetBroadcast ()) |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4926
diff
changeset
|
227 |
{ |
5038 | 228 |
m_stats.txBroadcast ++; |
229 |
m_stats.txBytes += packet->GetSize (); |
|
4950
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
230 |
//channel IDs where we have already sent broadcast: |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
231 |
std::vector<uint16_t> channels; |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
232 |
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
233 |
{ |
4950
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
234 |
bool should_send = true; |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
235 |
for(std::vector<uint16_t>::const_iterator chan = channels.begin(); chan != channels.end(); chan ++) |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
236 |
if(*chan == plugin->second->GetChannelId ()) |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
237 |
should_send = false; |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
238 |
if(!should_send) |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
239 |
continue; |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
240 |
channels.push_back(plugin->second->GetChannelId ()); |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
241 |
std::vector<Mac48Address> receivers = GetBroadcastReceivers (plugin->first); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
242 |
for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end(); i ++) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
243 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
244 |
Ptr<Packet> packet_copy = packet->Copy(); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
245 |
tag.SetAddress (*i); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
246 |
packet_copy->AddPacketTag (tag); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
247 |
routeReply (true, packet_copy, source, destination, protocolType, plugin->first); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
248 |
} |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
249 |
} |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4926
diff
changeset
|
250 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
251 |
else |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
252 |
return ForwardUnicast(sourceIface, source, destination, packet, protocolType, routeReply, tag.GetTtl ()); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
253 |
return true; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
254 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
255 |
bool |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
256 |
HwmpProtocol::ForwardUnicast(uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4947
diff
changeset
|
257 |
Ptr<Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
258 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
259 |
NS_ASSERT(destination != Mac48Address::GetBroadcast ()); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
260 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive(destination); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
261 |
NS_LOG_DEBUG("Requested src = "<<source<<", dst = "<<destination<<", I am "<<GetAddress ()<<", RA = "<<result.retransmitter); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
262 |
if(result.retransmitter == Mac48Address::GetBroadcast ()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
263 |
result = m_rtable->LookupProactive (); |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
264 |
HwmpTag tag; |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
265 |
tag.SetAddress (result.retransmitter); |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
266 |
tag.SetTtl (ttl); |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
267 |
//seqno and metric is not used; |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
268 |
packet->AddPacketTag(tag); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
269 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
270 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
271 |
//reply immediately: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
272 |
routeReply (true, packet, source, destination, protocolType, result.ifIndex); |
5038 | 273 |
m_stats.txUnicast ++; |
274 |
m_stats.txBytes += packet->GetSize (); |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
275 |
return true; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
276 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
277 |
if (sourceIface != GetMeshPoint ()->GetIfIndex()) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
278 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
279 |
//Start path error procedure: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
280 |
NS_LOG_DEBUG ("Must Send PERR"); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
281 |
result = m_rtable->LookupReactiveExpired (destination); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
282 |
//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
|
283 |
// 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
|
284 |
//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
|
285 |
// 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
|
286 |
// root |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
287 |
if(result.retransmitter == Mac48Address::GetBroadcast ()) |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
288 |
result = m_rtable->LookupProactiveExpired (); |
4995 | 289 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
290 |
{ |
|
291 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (result.retransmitter); |
|
292 |
MakePathError (destinations); |
|
293 |
} |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
294 |
m_stats.totalDropped ++; |
4995 | 295 |
return false; |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
296 |
} |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
297 |
//Request a destination: |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
298 |
result = m_rtable->LookupReactiveExpired (destination); |
4895 | 299 |
if(ShouldSendPreq(destination)) |
4947 | 300 |
{ |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
301 |
uint32_t originator_seqno = GetNextHwmpSeqno (); |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
302 |
uint32_t dst_seqno = 0; |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
303 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
304 |
dst_seqno = result.seqnum; |
4945 | 305 |
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
306 |
i->second->RequestDestination(destination, originator_seqno, dst_seqno); |
4947 | 307 |
} |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
308 |
QueuedPacket pkt; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
309 |
pkt.pkt = packet; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
310 |
pkt.dst = destination; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
311 |
pkt.src = source; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
312 |
pkt.protocol = protocolType; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
313 |
pkt.reply = routeReply; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
314 |
pkt.inInterface = sourceIface; |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
315 |
if(QueuePacket (pkt)) |
5014 | 316 |
{ |
317 |
m_stats.totalQueued ++; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
318 |
return true; |
5014 | 319 |
} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
320 |
else |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
321 |
{ |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
322 |
m_stats.totalDropped ++; |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
323 |
return false; |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
324 |
} |
4793 | 325 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
326 |
void |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
327 |
HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
328 |
{ |
4946
f97e16db1d79
Added airtime link metric. packet error rate is not done yet
Kirill Andreev <andreev@iitp.ru>
parents:
4945
diff
changeset
|
329 |
preq.IncrementMetric (metric); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
330 |
//acceptance cretirea: |
4945 | 331 |
std::map<Mac48Address, uint32_t>::const_iterator i = m_lastHwmpSeqno.find (preq.GetOriginatorAddress()); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
332 |
if (i == m_lastHwmpSeqno.end ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
333 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
334 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
335 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric(); |
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 |
else |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
338 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
339 |
if (i->second > preq.GetOriginatorSeqNumber ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
340 |
return; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
341 |
if (i->second == preq.GetOriginatorSeqNumber ()) |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
342 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
343 |
//find metric |
4945 | 344 |
std::map<Mac48Address, uint32_t>::const_iterator j = m_lastHwmpMetric.find (preq.GetOriginatorAddress()); |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
345 |
NS_ASSERT (j != m_lastHwmpSeqno.end()); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
346 |
if (j->second <= preq.GetMetric ()) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
347 |
return; |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
348 |
} |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
349 |
m_lastHwmpSeqno[preq.GetOriginatorAddress ()] = preq.GetOriginatorSeqNumber(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
350 |
m_lastHwmpMetric[preq.GetOriginatorAddress ()] = preq.GetMetric(); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
351 |
} |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
352 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<"Accepted preq from address"<<from<<", preq:"<<preq); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
353 |
std::vector<Ptr<DestinationAddressUnit> > destinations = preq.GetDestinationList (); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
354 |
//Add reactive path to originator: |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
355 |
if ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
356 |
((m_rtable->LookupReactive(preq.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
357 |
((m_rtable->LookupReactive(preq.GetOriginatorAddress ())).metric > preq.GetMetric ()) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
358 |
) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
359 |
{ |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
360 |
m_rtable->AddReactivePath ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
361 |
preq.GetOriginatorAddress (), |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
362 |
from, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
363 |
interface, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
364 |
preq.GetMetric (), |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
365 |
MicroSeconds (preq.GetLifetime () *1024), |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
366 |
preq.GetOriginatorSeqNumber () |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
367 |
); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
368 |
ReactivePathResolved (preq.GetOriginatorAddress ()); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
369 |
} |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
370 |
//Add reactive path for precursor: |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
371 |
if ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
372 |
((m_rtable->LookupReactive(fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
373 |
((m_rtable->LookupReactive(fromMp)).metric > preq.GetMetric ()) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
374 |
) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
375 |
{ |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
376 |
m_rtable->AddReactivePath ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
377 |
fromMp, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
378 |
from, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
379 |
interface, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
380 |
metric, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
381 |
MicroSeconds (preq.GetLifetime () *1024), |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
382 |
preq.GetOriginatorSeqNumber () |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
383 |
); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
384 |
ReactivePathResolved (fromMp); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
385 |
} |
4945 | 386 |
for (std::vector<Ptr<DestinationAddressUnit> >::const_iterator i = destinations.begin (); i != destinations.end(); i++) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
387 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
388 |
if ((*i)->GetDestinationAddress () == Mac48Address::GetBroadcast()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
389 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
390 |
//only proactive PREQ contains destination |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
391 |
//address as broadcast! Proactive preq MUST |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
392 |
//have destination count equal to 1 and |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
393 |
//per destination flags DO and RF |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
394 |
NS_ASSERT (preq.GetDestCount() == 1); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
395 |
NS_ASSERT (((*i)->IsDo()) && ((*i)->IsRf())); |
4964 | 396 |
//Add proactive path only if it is the better then existed |
397 |
//before |
|
398 |
if( |
|
399 |
((m_rtable->LookupProactive ()).retransmitter == Mac48Address::GetBroadcast ()) || |
|
400 |
((m_rtable->LookupProactive ()).metric > preq.GetMetric ()) |
|
401 |
) |
|
402 |
m_rtable->AddProactivePath ( |
|
403 |
preq.GetMetric (), |
|
404 |
preq.GetOriginatorAddress (), |
|
405 |
from, |
|
406 |
interface, |
|
407 |
MicroSeconds (preq.GetLifetime () * 1024), |
|
408 |
preq.GetOriginatorSeqNumber () |
|
409 |
); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
410 |
ProactivePathResolved (); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
411 |
if (!preq.IsNeedNotPrep ()) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
412 |
SendPrep ( |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
413 |
GetAddress (), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
414 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
415 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
416 |
preq.GetMetric (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
417 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
418 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
419 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
420 |
interface |
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 |
break; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
423 |
} |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
424 |
if ((*i)->GetDestinationAddress () == GetAddress ()) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
425 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
426 |
SendPrep ( |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
427 |
GetAddress (), |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
428 |
preq.GetOriginatorAddress (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
429 |
from, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
430 |
(uint32_t)0, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
431 |
preq.GetOriginatorSeqNumber (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
432 |
GetNextHwmpSeqno (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
433 |
preq.GetLifetime (), |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
434 |
interface |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
435 |
); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
436 |
NS_ASSERT(m_rtable->LookupReactive (preq.GetOriginatorAddress ()).retransmitter != Mac48Address::GetBroadcast ()); |
4978
b73c15d25e81
Intermediate reply bugfix
Kirill Andreev <andreev@iitp.ru>
parents:
4972
diff
changeset
|
437 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress()); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
438 |
continue; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
439 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
440 |
//check if can answer: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
441 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive ((*i)->GetDestinationAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
442 |
if ((! ((*i)->IsDo())) && (result.retransmitter != Mac48Address::GetBroadcast())) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
443 |
{ |
4978
b73c15d25e81
Intermediate reply bugfix
Kirill Andreev <andreev@iitp.ru>
parents:
4972
diff
changeset
|
444 |
//have a valid information and can answer |
4983 | 445 |
//!NB: If there is information from peer - set lifetime as |
446 |
//we have got from PREQ, and set the rest lifetime of the |
|
447 |
//route if the information is correct |
|
4998 | 448 |
uint32_t lifetime = result.lifetime.GetMicroSeconds () / 1024; |
5001 | 449 |
if(lifetime > 0) |
450 |
SendPrep ( |
|
451 |
(*i)->GetDestinationAddress (), |
|
452 |
preq.GetOriginatorAddress (), |
|
453 |
from, |
|
454 |
result.metric, |
|
455 |
preq.GetOriginatorSeqNumber (), |
|
456 |
result.seqnum +1, |
|
457 |
lifetime, |
|
458 |
interface |
|
459 |
); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
460 |
if ((*i)->IsRf ()) |
4978
b73c15d25e81
Intermediate reply bugfix
Kirill Andreev <andreev@iitp.ru>
parents:
4972
diff
changeset
|
461 |
(*i)->SetFlags (true, false, (*i)->IsUsn ()); //DO = 1, RF = 0 |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
462 |
else |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
463 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
464 |
preq.DelDestinationAddressElement ((*i)->GetDestinationAddress()); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
465 |
continue; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
466 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
467 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
468 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
469 |
//chack if must retransmit: |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
470 |
if (preq.GetDestCount () == 0) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
471 |
return; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
472 |
//Forward PREQ to all interfaces: |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
473 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<"retransmitting PREQ:"<<preq); |
4945 | 474 |
for(HwmpPluginMap::const_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
|
475 |
i->second->SendPreq (preq); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
476 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
477 |
void |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
478 |
HwmpProtocol::ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
479 |
{ |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
480 |
prep.IncrementMetric (metric); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
481 |
//acceptance cretirea: |
4945 | 482 |
std::map<Mac48Address, uint32_t>::const_iterator i = m_lastHwmpSeqno.find (prep.GetOriginatorAddress()); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
483 |
if (i == m_lastHwmpSeqno.end ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
484 |
{ |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
485 |
m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber(); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
486 |
} |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
487 |
else |
4947 | 488 |
{ |
4999
467519eba260
Fixed asimmetrical routes
Kirill Andreev <andreev@iitp.ru>
parents:
4998
diff
changeset
|
489 |
if (i->second > prep.GetOriginatorSeqNumber ()) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
490 |
return; |
4947 | 491 |
else |
492 |
m_lastHwmpSeqno[prep.GetOriginatorAddress ()] = prep.GetOriginatorSeqNumber(); |
|
493 |
} |
|
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
494 |
//update routing info |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
495 |
//Now add a path to destination and add precursor to source |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
496 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<", received prep from "<<prep.GetOriginatorAddress ()<<", receiver was:"<<from); |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
497 |
HwmpRtable::LookupResult result = m_rtable->LookupReactive(prep.GetDestinationAddress()); |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
498 |
//Add a reactive path only if it is better than existing: |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
499 |
if ( |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
500 |
((m_rtable->LookupReactive(prep.GetOriginatorAddress ())).retransmitter == Mac48Address::GetBroadcast ()) || |
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
501 |
((m_rtable->LookupReactive(prep.GetOriginatorAddress ())).metric > prep.GetMetric ()) |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
502 |
) |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
503 |
{ |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
504 |
m_rtable->AddReactivePath ( |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
505 |
prep.GetOriginatorAddress (), |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
506 |
from, |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
507 |
interface, |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
508 |
prep.GetMetric (), |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
509 |
MicroSeconds(prep.GetLifetime () * 1024), |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
510 |
prep.GetOriginatorSeqNumber ()); |
4998 | 511 |
m_rtable->AddPrecursor (prep.GetDestinationAddress (), interface, from); |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
512 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
513 |
m_rtable->AddPrecursor (prep.GetOriginatorAddress (), interface, result.retransmitter); |
4961
62ff08884f5e
Fixed bug pith routing information collected from PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4959
diff
changeset
|
514 |
ReactivePathResolved (prep.GetOriginatorAddress ()); |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
515 |
} |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
516 |
if ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
517 |
((m_rtable->LookupReactive(fromMp)).retransmitter == Mac48Address::GetBroadcast ()) || |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
518 |
((m_rtable->LookupReactive(fromMp)).metric > prep.GetMetric ()) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
519 |
) |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
520 |
{ |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
521 |
m_rtable->AddReactivePath ( |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
522 |
fromMp, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
523 |
from, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
524 |
interface, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
525 |
metric, |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
526 |
MicroSeconds(prep.GetLifetime () * 1024), |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
527 |
prep.GetOriginatorSeqNumber ()); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
528 |
ReactivePathResolved (fromMp); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
529 |
} |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
530 |
if(prep.GetDestinationAddress () == GetAddress ()) |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
531 |
{ |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
532 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<", resolved "<<prep.GetOriginatorAddress ()); |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
533 |
return; |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
534 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
535 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
536 |
//try to look for default route |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
537 |
result = m_rtable->LookupProactive (); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
538 |
if (result.retransmitter == Mac48Address::GetBroadcast ()) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
539 |
return; |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
540 |
//Forward PREP |
4945 | 541 |
HwmpPluginMap::const_iterator prep_sender = m_interfaces.find (result.ifIndex); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
542 |
NS_ASSERT(prep_sender != m_interfaces.end ()); |
4998 | 543 |
prep_sender->second->SendPrep (prep, result.retransmitter); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
544 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
545 |
void |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
546 |
HwmpProtocol::ReceivePerr (IePerr perr, Mac48Address from, uint32_t interface, Mac48Address fromMp) |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
547 |
{ |
4923 | 548 |
//Acceptance cretirea: |
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
549 |
NS_LOG_DEBUG("I am "<<GetAddress ()<<", received PERR from "<<from); |
4923 | 550 |
std::vector<IePerr::FailedDestination> destinations = perr.GetAddressUnitVector (); |
551 |
HwmpRtable::LookupResult result; |
|
552 |
for(unsigned int i = 0; i < destinations.size (); i ++) |
|
553 |
{ |
|
554 |
result = m_rtable->LookupReactive (destinations[i].destination); |
|
555 |
if ( |
|
556 |
(result.retransmitter != from) || |
|
557 |
(result.ifIndex != interface) || |
|
558 |
(result.seqnum > destinations[i].seqnum) |
|
559 |
) |
|
560 |
{ |
|
561 |
perr.DeleteAddressUnit(destinations[i].destination); |
|
562 |
continue; |
|
563 |
} |
|
564 |
} |
|
565 |
if(perr.GetNumOfDest () == 0) |
|
566 |
return; |
|
567 |
MakePathError (destinations); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
568 |
} |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
569 |
void |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
570 |
HwmpProtocol::SendPrep ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
571 |
Mac48Address src, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
572 |
Mac48Address dst, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
573 |
Mac48Address retransmitter, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
574 |
uint32_t initMetric, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
575 |
uint32_t originatorDsn, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
576 |
uint32_t destinationSN, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
577 |
uint32_t lifetime, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
578 |
uint32_t interface) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
579 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
580 |
IePrep prep; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
581 |
prep.SetHopcount (0); |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
582 |
prep.SetTtl (m_maxTtl); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
583 |
prep.SetDestinationAddress (dst); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
584 |
prep.SetDestinationSeqNumber (destinationSN); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
585 |
prep.SetLifetime (lifetime); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
586 |
prep.SetMetric (0); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
587 |
prep.SetOriginatorAddress (src); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
588 |
prep.SetOriginatorSeqNumber (originatorDsn); |
4945 | 589 |
HwmpPluginMap::const_iterator prep_sender = m_interfaces.find (interface); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
590 |
NS_ASSERT(prep_sender != m_interfaces.end ()); |
4998 | 591 |
prep_sender->second->SendPrep (prep, retransmitter); |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
592 |
//m_prepCallback (prep, retransmitter); |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
593 |
|
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
594 |
} |
4793 | 595 |
bool |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
596 |
HwmpProtocol::Install (Ptr<MeshPointDevice> mp) |
4793 | 597 |
{ |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
598 |
m_mp = mp; |
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
599 |
std::vector<Ptr<NetDevice> > interfaces = mp->GetInterfaces (); |
4945 | 600 |
for (std::vector<Ptr<NetDevice> >::const_iterator i = interfaces.begin (); i != interfaces.end(); i++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
601 |
{ |
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
|
602 |
// Checking for compatible net device |
5012 | 603 |
Ptr<WifiNetDevice> wifiNetDev = (*i)->GetObject<WifiNetDevice> (); |
604 |
if (wifiNetDev == 0) |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
605 |
return false; |
5012 | 606 |
Ptr<MeshWifiInterfaceMac> mac = wifiNetDev->GetMac ()->GetObject<MeshWifiInterfaceMac> (); |
607 |
if (mac == 0) |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
608 |
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
|
609 |
// 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
|
610 |
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
|
611 |
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
|
612 |
mac->InstallPlugin (hwmpMac); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
613 |
} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
614 |
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
|
615 |
// Mesh point aggregates all installed protocols |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
616 |
mp->AggregateObject (this); |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
617 |
m_address = Mac48Address::ConvertFrom (mp->GetAddress ());//* address; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
618 |
return true; |
4793 | 619 |
} |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
620 |
void |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4926
diff
changeset
|
621 |
HwmpProtocol::PeerLinkStatus(Mac48Address meshPointAddress, Mac48Address peerAddress, uint32_t interface, bool status) |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
622 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
623 |
if(status) |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
624 |
return; |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
625 |
std::vector<IePerr::FailedDestination> destinations = m_rtable->GetUnreachableDestinations (peerAddress); |
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
626 |
MakePathError (destinations); |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
627 |
} |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
628 |
void |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
629 |
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
|
630 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
631 |
m_neighboursCallback = cb; |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
632 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
633 |
bool |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
634 |
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
|
635 |
{ |
5035
8ce48024f179
Fixed dublicates in broadcasts
Kirill Andreev <andreev@iitp.ru>
parents:
5015
diff
changeset
|
636 |
if(source == GetAddress ()) |
8ce48024f179
Fixed dublicates in broadcasts
Kirill Andreev <andreev@iitp.ru>
parents:
5015
diff
changeset
|
637 |
return true; |
4945 | 638 |
std::map<Mac48Address, uint32_t,std::less<Mac48Address> >::const_iterator i = m_lastDataSeqno.find (source); |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
639 |
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
|
640 |
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
|
641 |
else |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
642 |
{ |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
643 |
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
|
644 |
return true; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
645 |
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
|
646 |
} |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
647 |
return false; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
648 |
} |
4793 | 649 |
void |
4923 | 650 |
HwmpProtocol::MakePathError (std::vector<IePerr::FailedDestination> destinations) |
4793 | 651 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
652 |
//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
|
653 |
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
|
654 |
if(receivers.size () == 0) |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
655 |
return; |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
656 |
IePerr perr; |
4923 | 657 |
for(unsigned int i = 0; i < destinations.size (); i ++) |
658 |
{ |
|
659 |
perr.AddAddressUnit(destinations[i]); |
|
660 |
m_rtable->DeleteReactivePath(destinations[i].destination); |
|
661 |
} |
|
4945 | 662 |
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4923 | 663 |
{ |
664 |
std::vector<Mac48Address> receivers_for_interface; |
|
665 |
for(unsigned int j = 0; j < receivers.size(); j ++) |
|
666 |
if(i->first == receivers[j].first) |
|
667 |
receivers_for_interface.push_back(receivers[j].second); |
|
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
668 |
i->second->SendPerr (perr, receivers_for_interface); |
4923 | 669 |
} |
4793 | 670 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
671 |
std::vector<std::pair<uint32_t, Mac48Address> > |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
672 |
HwmpProtocol::GetPerrReceivers (std::vector<IePerr::FailedDestination> failedDest) |
4793 | 673 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4919
diff
changeset
|
674 |
HwmpRtable::PrecursorList retval; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
675 |
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
|
676 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4919
diff
changeset
|
677 |
HwmpRtable::PrecursorList precursors = m_rtable->GetPrecursors(failedDest[i].destination); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
678 |
m_rtable->DeleteReactivePath (failedDest[i].destination); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
679 |
m_rtable->DeleteProactivePath(failedDest[i].destination); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
680 |
for (unsigned int j = 0; j < precursors.size (); j ++) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
681 |
retval.push_back(precursors[j]); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
682 |
} |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
683 |
//Check if we have dublicates in retval and precursors: |
4925
765deb024525
Removed commented code, removed unneded debg messages
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
684 |
for (unsigned int i = 0; i < retval.size(); i ++) |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4995
diff
changeset
|
685 |
for (unsigned int j = i+1; j < retval.size(); j ++) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
686 |
if(retval[i].second == retval[j].second) |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
687 |
retval.erase(retval.begin() + j); |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
688 |
return retval; |
4793 | 689 |
} |
4895 | 690 |
std::vector<Mac48Address> |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
691 |
HwmpProtocol::GetPreqReceivers (uint32_t interface) |
4895 | 692 |
{ |
693 |
std::vector<Mac48Address> retval; |
|
4945 | 694 |
if(!m_neighboursCallback.IsNull ()) |
695 |
retval = m_neighboursCallback (interface); |
|
696 |
if ((retval.size() >= m_unicastPreqThreshold) || (retval.size () == 0)) |
|
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
697 |
{ |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
698 |
retval.clear (); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
699 |
retval.push_back (Mac48Address::GetBroadcast ()); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
700 |
} |
4895 | 701 |
return retval; |
702 |
} |
|
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
703 |
std::vector<Mac48Address> |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
704 |
HwmpProtocol::GetBroadcastReceivers (uint32_t interface) |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
705 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
706 |
std::vector<Mac48Address> retval; |
4945 | 707 |
if(!m_neighboursCallback.IsNull ()) |
708 |
retval = m_neighboursCallback (interface); |
|
709 |
if ((retval.size() >= m_unicastDataThreshold) || (retval.size () == 0)) |
|
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
710 |
{ |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
711 |
retval.clear (); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
712 |
retval.push_back (Mac48Address::GetBroadcast ()); |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
713 |
} |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
714 |
return retval; |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
715 |
} |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
716 |
|
4793 | 717 |
bool |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
718 |
HwmpProtocol::QueuePacket (QueuedPacket packet) |
4793 | 719 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
720 |
if (m_rqueue.size () > m_maxQueueSize) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
721 |
return false; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
722 |
m_rqueue.push_back (packet); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
723 |
return true; |
4793 | 724 |
} |
725 |
||
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
726 |
HwmpProtocol::QueuedPacket |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
727 |
HwmpProtocol::DequeueFirstPacketByDst (Mac48Address dst) |
4793 | 728 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
729 |
QueuedPacket retval; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
730 |
retval.pkt = NULL; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
731 |
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
|
732 |
if((*i).dst == dst) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
733 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
734 |
retval = (*i); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
735 |
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
|
736 |
break; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
737 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
738 |
return retval; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
739 |
} |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
740 |
|
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
741 |
HwmpProtocol::QueuedPacket |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
742 |
HwmpProtocol::DequeueFirstPacket () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
743 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
744 |
QueuedPacket retval; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
745 |
retval.pkt = NULL; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
746 |
if(m_rqueue.size () != 0) |
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
747 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
748 |
retval = m_rqueue[0]; |
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
749 |
m_rqueue.erase (m_rqueue.begin ()); |
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
750 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
751 |
return retval; |
4793 | 752 |
} |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4989
diff
changeset
|
753 |
|
4793 | 754 |
void |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
755 |
HwmpProtocol::ReactivePathResolved (Mac48Address dst) |
4793 | 756 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
757 |
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
|
758 |
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
|
759 |
//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
|
760 |
QueuedPacket packet; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
761 |
while (1) |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
762 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
763 |
packet = DequeueFirstPacketByDst (dst); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
764 |
if (packet.pkt == NULL) |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
765 |
return; |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
766 |
//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
|
767 |
HwmpTag tag; |
4947 | 768 |
packet.pkt->RemovePacketTag(tag); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
769 |
tag.SetAddress (result.retransmitter); |
4918 | 770 |
packet.pkt->AddPacketTag (tag); |
5038 | 771 |
m_stats.txUnicast ++; |
772 |
m_stats.txBytes += packet.pkt->GetSize (); |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
773 |
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
|
774 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
775 |
} |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
776 |
void |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
777 |
HwmpProtocol::ProactivePathResolved () |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
778 |
{ |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
779 |
//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
|
780 |
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
|
781 |
NS_ASSERT(result.retransmitter != Mac48Address::GetBroadcast ()); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
782 |
QueuedPacket packet; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
783 |
while (1) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
784 |
{ |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
785 |
packet = DequeueFirstPacket (); |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
786 |
if (packet.pkt == NULL) |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
787 |
return; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
788 |
//set RA tag for retransmitter: |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
789 |
HwmpTag tag; |
4918 | 790 |
NS_ASSERT (packet.pkt->PeekPacketTag(tag)); |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
791 |
tag.SetAddress (result.retransmitter); |
4918 | 792 |
packet.pkt->AddPacketTag (tag); |
5038 | 793 |
m_stats.txUnicast ++; |
794 |
m_stats.txBytes += packet.pkt->GetSize (); |
|
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
795 |
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
|
796 |
} |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
797 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
798 |
|
4793 | 799 |
bool |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
800 |
HwmpProtocol::ShouldSendPreq (Mac48Address dst) |
4793 | 801 |
{ |
4945 | 802 |
std::map<Mac48Address, EventId>::const_iterator i = m_preqTimeouts.find (dst); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
803 |
if (i == m_preqTimeouts.end ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
804 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
805 |
m_preqTimeouts[dst] = Simulator::Schedule ( |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
806 |
MilliSeconds (2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())), |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
807 |
&HwmpProtocol::RetryPathDiscovery, this, dst, 0); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
808 |
return true; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
809 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
810 |
return false; |
4793 | 811 |
} |
812 |
void |
|
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
813 |
HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) |
4793 | 814 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
815 |
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
|
816 |
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
|
817 |
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
|
818 |
if (result.retransmitter != Mac48Address::GetBroadcast ()) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
819 |
{ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
820 |
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
|
821 |
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
|
822 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
823 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
824 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
825 |
numOfRetry++; |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
826 |
if (numOfRetry > m_dot11MeshHWMPmaxPREQretries) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
827 |
{ |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
828 |
QueuedPacket packet; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
829 |
//purge queue and delete entry from retryDatabase |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
830 |
while (1) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
831 |
{ |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
832 |
packet = DequeueFirstPacketByDst (dst); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
833 |
if (packet.pkt == NULL) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
834 |
break; |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
835 |
m_stats.totalDropped ++; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4837
diff
changeset
|
836 |
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
|
837 |
} |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
838 |
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
|
839 |
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
|
840 |
m_preqTimeouts.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
841 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
842 |
} |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
843 |
uint32_t originator_seqno = GetNextHwmpSeqno (); |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
844 |
uint32_t dst_seqno = 0; |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
845 |
if(result.retransmitter != Mac48Address::GetBroadcast ()) |
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
846 |
dst_seqno = result.seqnum; |
4945 | 847 |
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) |
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
848 |
i->second->RequestDestination(dst, originator_seqno, dst_seqno); |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
849 |
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
|
850 |
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
|
851 |
&HwmpProtocol::RetryPathDiscovery, this, dst, numOfRetry); |
4793 | 852 |
} |
4895 | 853 |
//Proactive PREQ routines: |
854 |
void |
|
855 |
HwmpProtocol::SetRoot () |
|
856 |
{ |
|
4964 | 857 |
UniformVariable coefficient (0.0, m_randomStart.GetSeconds()); |
858 |
Time randomStart = Seconds (coefficient.GetValue()); |
|
859 |
m_proactivePreqTimer = Simulator::Schedule (randomStart, &HwmpProtocol::SendProactivePreq, this); |
|
860 |
NS_LOG_UNCOND("ROOT IS: "<<m_address); |
|
4895 | 861 |
SendProactivePreq (); |
862 |
m_isRoot = true; |
|
863 |
} |
|
864 |
void |
|
865 |
HwmpProtocol::UnsetRoot () |
|
866 |
{ |
|
867 |
m_proactivePreqTimer.Cancel (); |
|
868 |
} |
|
869 |
void |
|
870 |
HwmpProtocol::SendProactivePreq () |
|
871 |
{ |
|
872 |
IePreq preq; |
|
873 |
//By default: must answer |
|
874 |
preq.SetHopcount (0); |
|
875 |
preq.SetTTL (m_maxTtl); |
|
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
876 |
preq.SetLifetime (m_dot11MeshHWMPactiveRootTimeout.GetMicroSeconds () /1024); |
4895 | 877 |
//\attention: do not forget to set originator address, sequence |
878 |
//number and preq ID in HWMP-MAC plugin |
|
879 |
preq.AddDestinationAddressElement (true, true, Mac48Address::GetBroadcast (), 0); |
|
4962
00ee1735c339
Bugfixes. Changed traversal time, because 4x4 network does not work
Kirill Andreev <andreev@iitp.ru>
parents:
4961
diff
changeset
|
880 |
preq.SetOriginatorAddress(GetAddress ()); |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
881 |
preq.SetPreqID (GetNextPreqId ()); |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
882 |
preq.SetOriginatorSeqNumber (GetNextHwmpSeqno ()); |
4945 | 883 |
for(HwmpPluginMap::const_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
|
884 |
i->second->SendPreq(preq); |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4962
diff
changeset
|
885 |
m_proactivePreqTimer = Simulator::Schedule (m_dot11MeshHWMPpathToRootInterval, &HwmpProtocol::SendProactivePreq, this); |
4895 | 886 |
} |
887 |
bool |
|
888 |
HwmpProtocol::GetDoFlag () |
|
889 |
{ |
|
890 |
return m_doFlag; |
|
891 |
} |
|
892 |
bool |
|
893 |
HwmpProtocol::GetRfFlag () |
|
894 |
{ |
|
895 |
return m_rfFlag; |
|
896 |
} |
|
897 |
Time |
|
898 |
HwmpProtocol::GetPreqMinInterval () |
|
899 |
{ |
|
900 |
return m_dot11MeshHWMPpreqMinInterval; |
|
901 |
} |
|
902 |
Time |
|
903 |
HwmpProtocol::GetPerrMinInterval () |
|
904 |
{ |
|
905 |
return m_dot11MeshHWMPperrMinInterval; |
|
906 |
} |
|
907 |
uint8_t |
|
908 |
HwmpProtocol::GetMaxTtl () |
|
909 |
{ |
|
910 |
return m_maxTtl; |
|
911 |
} |
|
912 |
uint32_t |
|
913 |
HwmpProtocol::GetNextPreqId () |
|
914 |
{ |
|
915 |
m_preqId ++; |
|
916 |
return m_preqId; |
|
917 |
} |
|
918 |
uint32_t |
|
919 |
HwmpProtocol::GetNextHwmpSeqno () |
|
920 |
{ |
|
921 |
m_hwmpSeqno ++; |
|
922 |
if(m_hwmpSeqno == 0xffffffff) |
|
4955
b83a62acbcf2
Added proper flags to HWMP PREQ, routing information is updated in accordance
Kirill Andreev <andreev@iitp.ru>
parents:
4953
diff
changeset
|
923 |
m_hwmpSeqno = 1; |
4895 | 924 |
return m_hwmpSeqno; |
925 |
} |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
926 |
uint32_t |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
927 |
HwmpProtocol::GetActivePathLifetime () |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
928 |
{ |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
929 |
return m_dot11MeshHWMPactivePathTimeout.GetMicroSeconds () / 1024; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
930 |
} |
4923 | 931 |
uint8_t |
932 |
HwmpProtocol::GetUnicastPerrThreshold() |
|
933 |
{ |
|
934 |
return m_unicastPerrThreshold; |
|
935 |
} |
|
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
936 |
Mac48Address |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
937 |
HwmpProtocol::GetAddress () |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
938 |
{ |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
939 |
return m_address; |
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
940 |
} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
941 |
//Statistics: |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
942 |
void HwmpProtocol::Statistics::Print (std::ostream & os) const |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
943 |
{ |
5015 | 944 |
os << "<Statistics " |
5038 | 945 |
"txUnicast=\"" << txUnicast << "\" " |
946 |
"txBroadcast=\"" << txBroadcast << "\" " |
|
947 |
"txBytes=\"" << txBytes / 1024 << "K\" " |
|
5015 | 948 |
"totalQueued=\"" << totalQueued << "\" " |
949 |
"totalDropped=\"" << totalDropped << "\"/>\n"; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
950 |
} |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
951 |
void |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
952 |
HwmpProtocol::Report (std::ostream & os) const |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
953 |
{ |
5015 | 954 |
os << "<Hwmp " |
955 |
"address=\"" << m_address << "\"\n" |
|
956 |
"maxQueueSize=\"" << m_maxQueueSize << "\"\n" |
|
957 |
"dot11MeshHWMPmaxPREQretries=\"" << (uint16_t)m_dot11MeshHWMPmaxPREQretries << "\"\n" |
|
958 |
"dot11MeshHWMPnetDiameterTraversalTime=\"" << m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds () << "ms\"\n" |
|
959 |
"dot11MeshHWMPpreqMinInterval=\"" << m_dot11MeshHWMPpreqMinInterval.GetMilliSeconds () << "ms\"\n" |
|
960 |
"dot11MeshHWMPperrMinInterval=\"" << m_dot11MeshHWMPperrMinInterval.GetMilliSeconds () << "ms\"\n" |
|
961 |
"dot11MeshHWMPactiveRootTimeout=\"" << m_dot11MeshHWMPactiveRootTimeout.GetMilliSeconds () << "ms\"\n" |
|
962 |
"dot11MeshHWMPactivePathTimeout=\"" << m_dot11MeshHWMPactivePathTimeout.GetMilliSeconds () << "ms\"\n" |
|
963 |
"dot11MeshHWMPpathToRootInterval=\"" << m_dot11MeshHWMPpathToRootInterval.GetMilliSeconds () << "ms\"\n" |
|
964 |
"dot11MeshHWMPrannInterval=\"" << m_dot11MeshHWMPrannInterval.GetMilliSeconds () << "ms\"\n" |
|
965 |
"isRoot=\"" << m_isRoot << "\"\n" |
|
966 |
"maxTtl=\"" << (uint16_t)m_maxTtl << "\"\n" |
|
967 |
"unicastPerrThreshold=\"" << (uint16_t)m_unicastPerrThreshold << "\"\n" |
|
968 |
"unicastPreqThreshold=\"" << (uint16_t)m_unicastPreqThreshold << "\"\n" |
|
969 |
"unicastDataThreshold=\"" << (uint16_t)m_unicastDataThreshold << "\"\n" |
|
970 |
"doFlag=\"" << m_doFlag << "\"\n" |
|
971 |
"rfFlag=\"" << m_rfFlag << "\">\n"; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
972 |
m_stats.Print (os); |
5012 | 973 |
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
974 |
{ |
|
975 |
plugin->second->Report(os); |
|
976 |
} |
|
977 |
os << "</Hwmp>\n"; |
|
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
5001
diff
changeset
|
978 |
} |
5013 | 979 |
void |
980 |
HwmpProtocol::ResetStats () |
|
981 |
{ |
|
982 |
m_stats = Statistics::Statistics (); |
|
5015 | 983 |
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) |
984 |
plugin->second->ResetStats (); |
|
5013 | 985 |
} |
986 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
987 |
} //namespace dot11s |
4793 | 988 |
} //namespace ns3 |