author | Kirill Andreev <andreev@iitp.ru> |
Thu, 06 Aug 2009 13:11:15 +0400 | |
changeset 5150 | 70e68391cf42 |
parent 5132 | aee541a30256 |
child 5156 | 5b499f25655a |
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:
4810
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 |
||
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
21 |
#ifndef HWMP_PROTOCOL_H |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
22 |
#define HWMP_PROTOCOL_H |
4841 | 23 |
|
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
24 |
#include "ns3/mesh-l2-routing-protocol.h" |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
25 |
#include "ns3/nstime.h" |
4895 | 26 |
#include "ns3/event-id.h" |
5057
95a72c98f08d
Added dot11s installator, fixed bug with adding tag in proactive mode of HWMP
Kirill Andreev <andreev@iitp.ru>
parents:
5039
diff
changeset
|
27 |
#include "ie-dot11s-perr.h" |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
28 |
#include <vector> |
4793 | 29 |
#include <map> |
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 |
|
5132
aee541a30256
Restored newline at namespace
Kirill Andreev <andreev@iitp.ru>
parents:
5130
diff
changeset
|
31 |
namespace ns3 { |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
32 |
class MeshPointDevice; |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
33 |
class Packet; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
34 |
class Mac48Address; |
5132
aee541a30256
Restored newline at namespace
Kirill Andreev <andreev@iitp.ru>
parents:
5130
diff
changeset
|
35 |
namespace dot11s { |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
36 |
class HwmpProtocolMac; |
4891
b8db474bce60
Added HWMP tag to mercurial :)
Kirill Andreev <andreev@iitp.ru>
parents:
4889
diff
changeset
|
37 |
class HwmpRtable; |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
38 |
class IePreq; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
39 |
class IePrep; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4810
diff
changeset
|
40 |
/** |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
41 |
* \ingroup dot11s |
5129 | 42 |
* |
43 |
* \brief Hybrid wireless mesh protocol -- a routing protocol of IEEE 802.11s draft. |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4810
diff
changeset
|
44 |
*/ |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
45 |
class HwmpProtocol : public MeshL2RoutingProtocol |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4810
diff
changeset
|
46 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4810
diff
changeset
|
47 |
public: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
48 |
static TypeId GetTypeId (); |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
49 |
HwmpProtocol (); |
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
50 |
~HwmpProtocol (); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
51 |
void DoDispose (); |
5129 | 52 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
53 |
/// Route request, inherited from MeshL2RoutingProtocol |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
54 |
bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, |
5070
c70964936d2e
added 'const' label to packet in MeshPointDevice::Forward and
Kirill Andreev <andreev@iitp.ru>
parents:
5057
diff
changeset
|
55 |
Ptr<const Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply); |
5083
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
56 |
/// Cleanup packet from all tags |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
57 |
bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, |
5b154b30a8a1
Restructured L2RoutingProtocol: added cleanup function, which deletes all tags
Kirill Andreev <andreev@iitp.ru>
parents:
5070
diff
changeset
|
58 |
const Mac48Address destination, Ptr<Packet> packet, uint16_t& protocolType); |
5129 | 59 |
/** |
60 |
* \brief Install HWMP on given mesh point. |
|
61 |
* |
|
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
|
62 |
* Installing protocol cause installing its interface MAC plugins. |
5129 | 63 |
* |
64 |
* Also MP aggregates all installed protocols, HWMP protocol can be accessed |
|
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
|
65 |
* via MeshPointDevice::GetObject<dot11s::HwmpProtocol>(); |
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
|
66 |
*/ |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
67 |
bool Install (Ptr<MeshPointDevice>); |
5130 | 68 |
void PeerLinkStatus (Mac48Address meshPontAddress, 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
|
69 |
///\brief This callback is used to obtain active neighbours on a |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
70 |
//given interface |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
71 |
///\param interface is the interface ID |
5130 | 72 |
void SetNeighboursCallback (Callback<std::vector<Mac48Address>, uint32_t> cb); |
4963
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
73 |
///\name Proactive PREQ mechanism: |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
74 |
///\{ |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
75 |
void SetRoot (); |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
76 |
void UnsetRoot (); |
869399fad0b6
Fixed proactive mode. 1 root works
Kirill Andreev <andreev@iitp.ru>
parents:
4948
diff
changeset
|
77 |
///\} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
78 |
///\brief Statistics: |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
79 |
void Report (std::ostream &) const; |
5013 | 80 |
void ResetStats (); |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
81 |
private: |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
82 |
friend class HwmpProtocolMac; |
5129 | 83 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
84 |
/// Like RequestRoute, but for unicast packets |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
85 |
bool ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, |
4948
f47497fde31a
Fixed bug with uninitialized TAG
Kirill Andreev <andreev@iitp.ru>
parents:
4944
diff
changeset
|
86 |
Ptr<Packet> packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl); |
5129 | 87 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
88 |
///\name Interaction with HWMP MAC plugin |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
89 |
//\{ |
5130 | 90 |
void ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric); |
91 |
void ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric); |
|
92 |
void ReceivePerr (std::vector<IePerr::FailedDestination>, Mac48Address from, uint32_t interface, Mac48Address fromMp); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
93 |
void SendPrep ( |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
94 |
Mac48Address src, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
95 |
Mac48Address dst, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
96 |
Mac48Address retransmitter, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
97 |
uint32_t initMetric, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
98 |
uint32_t originatorDsn, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
99 |
uint32_t destinationSN, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
100 |
uint32_t lifetime, |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
101 |
uint32_t interface); |
5111 | 102 |
/** |
103 |
* \brief Structure of path error: IePerr and list of receivers: |
|
104 |
* interfaces and MAC address |
|
105 |
*/ |
|
106 |
struct PathError |
|
107 |
{ |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
108 |
std::vector<IePerr::FailedDestination> destinations; |
5111 | 109 |
/// interface-address |
110 |
std::vector<std::pair<uint32_t, Mac48Address> > receivers; |
|
111 |
}; |
|
112 |
/** |
|
113 |
* \brief forms a path error information element when list of destination fails on a given interface |
|
114 |
* \attention removes all entries from routing table! |
|
115 |
*/ |
|
116 |
PathError MakePathError (std::vector<IePerr::FailedDestination> destinations); |
|
117 |
///\brief Forwards a received path error |
|
118 |
void ForwardPathError (PathError perr); |
|
119 |
///\brief Pasess a selg-generated PERR to interface-plugin |
|
120 |
void InitiatePathError (PathError perr); |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
121 |
/// \return list of addresses where a PERR should be sent to |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
122 |
std::vector<std::pair<uint32_t, Mac48Address> > GetPerrReceivers (std::vector<IePerr::FailedDestination> failedDest); |
5129 | 123 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
124 |
/// \return list of addresses where a PERR should be sent to |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4898
diff
changeset
|
125 |
std::vector<Mac48Address> GetPreqReceivers (uint32_t interface); |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
126 |
/// \return list of addresses where a broadcast should be |
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
127 |
//retransmitted |
5129 | 128 |
std::vector<Mac48Address> GetBroadcastReceivers (uint32_t interface); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
129 |
/** |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
130 |
* \brief MAC-plugin asks wether the frame can be dropeed. Protocol automatically updates seqno. |
5129 | 131 |
* |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
132 |
* \return true if frame can be dropped |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
133 |
* \param uint32_t is the seqno |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
134 |
* \param Mac48Address is the mesh source addrress of the frame |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
135 |
*/ |
5130 | 136 |
bool DropDataFrame (uint32_t, Mac48Address); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
137 |
//\} |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
138 |
private: |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
139 |
/// Packet waiting its routing information |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
140 |
struct QueuedPacket { |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
141 |
Ptr<Packet> pkt; ///< the packet |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
142 |
Mac48Address src; ///< src address |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
143 |
Mac48Address dst; ///< dst address |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
144 |
uint16_t protocol; ///< protocol number |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
145 |
uint32_t inInterface; ///< incoming device interface ID. (if packet has come from upper layers, this is Mesh point ID) |
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
146 |
RouteReplyCallback reply; ///< how to reply |
5129 | 147 |
|
5150
70e68391cf42
Removed constructor from header
Kirill Andreev <andreev@iitp.ru>
parents:
5132
diff
changeset
|
148 |
QueuedPacket (); |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
149 |
}; |
5129 | 150 |
|
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
151 |
///\name Methods related to Queue/Dequeue procedures |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
152 |
//\{ |
4993
464ce7d8a940
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
Pavel Boyko <boyko@iitp.ru>
parents:
4964
diff
changeset
|
153 |
bool QueuePacket (QueuedPacket packet); |
4893
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
154 |
QueuedPacket DequeueFirstPacketByDst (Mac48Address dst); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
155 |
QueuedPacket DequeueFirstPacket (); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
156 |
void ReactivePathResolved (Mac48Address dst); |
d390c2dd2f14
Restructured rtable, queue size moved from protocol setter to attribute
Kirill Andreev <andreev@iitp.ru>
parents:
4892
diff
changeset
|
157 |
void ProactivePathResolved (); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
158 |
//\} |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
159 |
///\name Statistics: |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
160 |
///\{ |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
161 |
struct Statistics |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
162 |
{ |
5038 | 163 |
uint16_t txUnicast; |
164 |
uint16_t txBroadcast; |
|
165 |
uint32_t txBytes; |
|
5039
65524e2ec376
Added dropped TTL field to stats
Kirill Andreev <andreev@iitp.ru>
parents:
5038
diff
changeset
|
166 |
uint16_t droppedTtl; |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
167 |
uint16_t totalQueued; |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
168 |
uint16_t totalDropped; |
5108
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5087
diff
changeset
|
169 |
uint16_t initiatedPreq; |
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5087
diff
changeset
|
170 |
uint16_t initiatedPrep; |
c7e52ca238d3
HWMP-Statistics: added number of initiated PREQ, PREP, PERR
Kirill Andreev <andreev@iitp.ru>
parents:
5087
diff
changeset
|
171 |
uint16_t initiatedPerr; |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
172 |
|
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
173 |
void Print (std::ostream & os) const; |
5126
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
174 |
Statistics (); |
5010
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
175 |
}; |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
176 |
Statistics m_stats; |
bc885417e41e
Added statistcs structures
Kirill Andreev <andreev@iitp.ru>
parents:
4997
diff
changeset
|
177 |
///\} |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
178 |
///\name Methods responsible for path discovery retry procedure: |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
179 |
//\{ |
5129 | 180 |
/** |
181 |
* \brief checks when the last path discovery procedure was started for a given destination. |
|
182 |
* |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
183 |
* If the retry counter has not achieved the maximum level - preq should not be sent |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
184 |
*/ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
185 |
bool ShouldSendPreq (Mac48Address dst); |
5129 | 186 |
|
187 |
/** |
|
188 |
* \brief Generates PREQ retry when retry timeout has expired and route is still unresolved. |
|
189 |
* |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
190 |
* When PREQ retry has achieved the maximum level - retry mechanish should be cancelled |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
191 |
*/ |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
192 |
void RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
193 |
//\} |
5129 | 194 |
|
4895 | 195 |
///\name Proactive Preq routines: |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
196 |
//\{ |
4895 | 197 |
void SendProactivePreq (); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
198 |
//\} |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
199 |
///\return address of MeshPointDevice |
5129 | 200 |
Mac48Address GetAddress (); |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
201 |
private: |
5087 | 202 |
typedef std::map<uint32_t, Ptr<HwmpProtocolMac> > HwmpProtocolMacMap; |
203 |
HwmpProtocolMacMap m_interfaces; |
|
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
204 |
Mac48Address m_address; |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
205 |
uint32_t m_dataSeqno; |
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4888
diff
changeset
|
206 |
uint32_t m_hwmpSeqno; |
4895 | 207 |
uint32_t m_preqId; |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
208 |
///\name Sequence number filters |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
209 |
//\{ |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
210 |
/// Data sequence number database |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
211 |
std::map<Mac48Address, uint32_t> m_lastDataSeqno; |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
212 |
/// DSN databse |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
213 |
std::map<Mac48Address, uint32_t> m_lastHwmpSeqno; |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
214 |
/// Metric database |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
215 |
std::map<Mac48Address, uint32_t> m_lastHwmpMetric; |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
216 |
//\} |
5129 | 217 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
218 |
/// Routing table |
4891
b8db474bce60
Added HWMP tag to mercurial :)
Kirill Andreev <andreev@iitp.ru>
parents:
4889
diff
changeset
|
219 |
Ptr<HwmpRtable> m_rtable; |
5129 | 220 |
|
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
221 |
///\name Timers: |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
222 |
//\{ |
4895 | 223 |
std::map<Mac48Address, EventId> m_preqTimeouts; |
224 |
EventId m_proactivePreqTimer; |
|
4964 | 225 |
//Random start in Proactive PREQ propagation |
226 |
Time m_randomStart; |
|
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
227 |
//\} |
5129 | 228 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
229 |
/// Packet Queue |
5129 | 230 |
std::vector<QueuedPacket> m_rqueue; |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
231 |
private: |
4895 | 232 |
///\name HWMP-protocol parameters (attributes of GetTypeId) |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
233 |
//\{ |
4905
cd7eb4fd3829
PREP propagation ported!!!
Kirill Andreev <andreev@iitp.ru>
parents:
4901
diff
changeset
|
234 |
uint16_t m_maxQueueSize; |
4892
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
235 |
uint8_t m_dot11MeshHWMPmaxPREQretries; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
236 |
Time m_dot11MeshHWMPnetDiameterTraversalTime; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
237 |
Time m_dot11MeshHWMPpreqMinInterval; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
238 |
Time m_dot11MeshHWMPperrMinInterval; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
239 |
Time m_dot11MeshHWMPactiveRootTimeout; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
240 |
Time m_dot11MeshHWMPactivePathTimeout; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
241 |
Time m_dot11MeshHWMPpathToRootInterval; |
cdd13648776b
Removed dot11s-parameters and they are made as attributes
Kirill Andreev <andreev@iitp.ru>
parents:
4891
diff
changeset
|
242 |
Time m_dot11MeshHWMPrannInterval; |
4894
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
243 |
bool m_isRoot; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
244 |
uint8_t m_maxTtl; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
245 |
uint8_t m_unicastPerrThreshold; |
a6cf8696922a
HwmpProtocol: path error procedure reviewed, RequestRoute reviewed
Kirill Andreev <andreev@iitp.ru>
parents:
4893
diff
changeset
|
246 |
uint8_t m_unicastPreqThreshold; |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4941
diff
changeset
|
247 |
uint8_t m_unicastDataThreshold; |
4895 | 248 |
bool m_doFlag; |
249 |
bool m_rfFlag; |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
250 |
//\} |
5129 | 251 |
|
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
252 |
///\name Methods needed by HwmpMacLugin to access protocol parameters: |
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
253 |
//\{ |
4895 | 254 |
bool GetDoFlag (); |
255 |
bool GetRfFlag (); |
|
256 |
Time GetPreqMinInterval (); |
|
257 |
Time GetPerrMinInterval (); |
|
258 |
uint8_t GetMaxTtl (); |
|
259 |
uint32_t GetNextPreqId (); |
|
260 |
uint32_t GetNextHwmpSeqno (); |
|
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4895
diff
changeset
|
261 |
uint32_t GetActivePathLifetime (); |
4923 | 262 |
uint8_t GetUnicastPerrThreshold (); |
4901
626a970811a1
HWMP headers cleanup to create correct doxygen docs
Pavel Boyko <boyko@iitp.ru>
parents:
4900
diff
changeset
|
263 |
//\} |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4918
diff
changeset
|
264 |
Callback <std::vector<Mac48Address>, uint32_t> m_neighboursCallback; |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4810
diff
changeset
|
265 |
}; |
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4883
diff
changeset
|
266 |
} //namespace dot11s |
4793 | 267 |
} //namespace ns3 |
268 |
#endif |