author | Kirill Andreev <andreev@iitp.ru> |
Wed, 22 Jul 2009 15:56:55 +0400 | |
changeset 5130 | b5062e8e0da1 |
parent 5129 | 5688b8da4526 |
child 5132 | aee541a30256 |
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 |
* Author: Kirill Andreev <andreev@iitp.ru> |
|
19 |
*/ |
|
20 |
||
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
21 |
#include "ns3/mesh-wifi-interface-mac.h" |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
22 |
#include "ns3/packet.h" |
4793 | 23 |
#include "ns3/simulator.h" |
24 |
#include "ns3/nstime.h" |
|
25 |
#include "ns3/log.h" |
|
4956
aba7cae978ac
MeshWifiMacHeader moved to Dot11sMacHeader. test to it is written
Kirill Andreev <andreev@iitp.ru>
parents:
4955
diff
changeset
|
26 |
#include "dot11s-mac-header.h" |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
27 |
#include "hwmp-protocol.h" |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
28 |
#include "hwmp-protocol-mac.h" |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
29 |
#include "hwmp-tag.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 "ie-dot11s-preq.h" |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
31 |
#include "ie-dot11s-prep.h" |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
32 |
#include "ie-dot11s-rann.h" |
4813
e4e2c44d27cd
All mesh related filed moved to devices/mesh. Let the refactoring begins!
Pavel Boyko <boyko@iitp.ru>
parents:
4812
diff
changeset
|
33 |
|
5129 | 34 |
namespace ns3 |
35 |
{ |
|
36 |
namespace dot11s |
|
37 |
{ |
|
4793 | 38 |
|
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
39 |
NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac"); |
5129 | 40 |
HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr<HwmpProtocol> protocol) : |
41 |
m_ifIndex (ifIndex), m_protocol (protocol) |
|
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
42 |
{ |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
43 |
} |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
44 |
HwmpProtocolMac::~HwmpProtocolMac () |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
45 |
{ |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
46 |
} |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
47 |
void |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
48 |
HwmpProtocolMac::SetParent (Ptr<MeshWifiInterfaceMac> parent) |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
49 |
{ |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
50 |
m_parent = parent; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
51 |
} |
5063 | 52 |
|
53 |
bool |
|
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
54 |
HwmpProtocolMac::ReceiveData (Ptr<Packet> packet, const WifiMacHeader & header) |
5063 | 55 |
{ |
5129 | 56 |
NS_ASSERT (header.IsData ()); |
5063 | 57 |
|
58 |
MeshHeader meshHdr; |
|
59 |
HwmpTag tag; |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
60 |
if (packet->PeekPacketTag (tag)) |
5129 | 61 |
{ |
62 |
NS_FATAL_ERROR ("HWMP tag is not supposed to be received by network"); |
|
63 |
} |
|
64 |
||
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
65 |
packet->RemoveHeader (meshHdr); |
5129 | 66 |
m_stats.rxData++; |
5063 | 67 |
m_stats.rxDataBytes += packet->GetSize (); |
5129 | 68 |
|
5063 | 69 |
//TODO: address extension |
70 |
Mac48Address destination; |
|
71 |
Mac48Address source; |
|
72 |
switch (meshHdr.GetAddressExt ()) |
|
5129 | 73 |
{ |
74 |
case 0: |
|
75 |
source = header.GetAddr4 (); |
|
76 |
destination = header.GetAddr3 (); |
|
77 |
break; |
|
78 |
default: |
|
79 |
NS_FATAL_ERROR ( |
|
80 |
"6-address scheme is not yet supported and 4-address extension is not supposed to be used for data frames."); |
|
81 |
}; |
|
5063 | 82 |
tag.SetSeqno (meshHdr.GetMeshSeqno ()); |
83 |
tag.SetTtl (meshHdr.GetMeshTtl ()); |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
84 |
packet->AddPacketTag (tag); |
5129 | 85 |
|
86 |
if ((destination == Mac48Address::GetBroadcast ()) && (m_protocol->DropDataFrame (meshHdr.GetMeshSeqno (), |
|
87 |
source))) |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
88 |
{ |
5063 | 89 |
return false; |
5129 | 90 |
} |
5063 | 91 |
return true; |
92 |
} |
|
93 |
||
94 |
bool |
|
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
95 |
HwmpProtocolMac::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header) |
5063 | 96 |
{ |
5129 | 97 |
m_stats.rxMgt++; |
5063 | 98 |
m_stats.rxMgtBytes += packet->GetSize (); |
99 |
WifiMeshActionHeader actionHdr; |
|
100 |
packet->RemoveHeader (actionHdr); |
|
101 |
WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
102 |
if (actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PATH_SELECTION) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
103 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
104 |
return true; |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
105 |
} |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
106 |
IeRann rann; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
107 |
IePreq preq; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
108 |
IePrep prep; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
109 |
IePerr perr; |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
110 |
while (packet->RemoveHeader (rann)) |
5129 | 111 |
{ |
112 |
NS_LOG_WARN ("RANN is not supported!"); |
|
113 |
} |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
114 |
while (packet->RemoveHeader (preq)) |
5129 | 115 |
{ |
116 |
m_stats.rxPreq++; |
|
117 |
if (preq.GetOriginatorAddress () == m_protocol->GetAddress ()) |
|
118 |
{ |
|
119 |
continue; |
|
120 |
} |
|
121 |
if (preq.GetTtl () == 0) |
|
122 |
{ |
|
123 |
continue; |
|
124 |
} |
|
125 |
preq.DecrementTtl (); |
|
126 |
m_protocol->ReceivePreq (preq, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (), |
|
127 |
m_parent->GetLinkMetric (header.GetAddr2 ())); |
|
128 |
} |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
129 |
while (packet->RemoveHeader (prep)) |
5129 | 130 |
{ |
131 |
m_stats.rxPrep++; |
|
132 |
if (prep.GetTtl () == 0) |
|
133 |
{ |
|
134 |
continue; |
|
135 |
} |
|
136 |
prep.DecrementTtl (); |
|
137 |
m_protocol->ReceivePrep (prep, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (), |
|
138 |
m_parent->GetLinkMetric (header.GetAddr2 ())); |
|
139 |
} |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
140 |
std::vector<IePerr::FailedDestination> failedDestinations; |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
141 |
while (packet->RemoveHeader (perr)) |
5129 | 142 |
{ |
143 |
m_stats.rxPerr++; |
|
144 |
std::vector<IePerr::FailedDestination> destinations = perr.GetAddressUnitVector (); |
|
145 |
for (std::vector<IePerr::FailedDestination>::const_iterator i = destinations.begin (); i |
|
146 |
!= destinations.end (); i++) |
|
5130 | 147 |
{ |
148 |
failedDestinations.push_back (*i); |
|
149 |
} |
|
5129 | 150 |
} |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
151 |
if (failedDestinations.size () > 0) |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
152 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
153 |
m_protocol->ReceivePerr (failedDestinations, header.GetAddr2 (), m_ifIndex, header.GetAddr3 ()); |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
154 |
} |
5129 | 155 |
NS_ASSERT (packet->GetSize () == 0); |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
156 |
return false; |
5063 | 157 |
} |
158 |
||
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
159 |
bool |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
160 |
HwmpProtocolMac::Receive (Ptr<Packet> packet, const WifiMacHeader & header) |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
161 |
{ |
5063 | 162 |
if (header.IsData ()) |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
163 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
164 |
return ReceiveData (packet, header); |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
165 |
} |
5129 | 166 |
else |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
167 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
168 |
if (header.IsAction ()) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
169 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
170 |
return ReceiveAction (packet, header); |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
171 |
} |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
172 |
else |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
173 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
174 |
return true; // don't care |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
175 |
} |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
176 |
} |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
177 |
} |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
178 |
bool |
5129 | 179 |
HwmpProtocolMac::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, |
180 |
Mac48Address to) |
|
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
181 |
{ |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
182 |
if (!header.IsData ()) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
183 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
184 |
return true; |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
185 |
} |
4889
279b07de3327
Fixrd bugs with address extensions, broadcast frames can go through L2Routing
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
186 |
HwmpTag tag; |
5129 | 187 |
bool tagExists = packet->RemovePacketTag (tag); |
5008
9650fb0087d2
Revert commit [c259eaefdd7f]. Make compiler happy.
Andrey Mazo <mazo@iitp.ru>
parents:
5002
diff
changeset
|
188 |
if (!tagExists) |
5129 | 189 |
{ |
190 |
NS_FATAL_ERROR ("HWMP tag must exist at this point"); |
|
191 |
} |
|
192 |
m_stats.txData++; |
|
5038 | 193 |
m_stats.txDataBytes += packet->GetSize (); |
4994
2c25f9c66604
Dot11sMacHeader renamed to MeshHeader to correspond standard
Pavel Boyko <boyko@iitp.ru>
parents:
4991
diff
changeset
|
194 |
MeshHeader meshHdr; |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
195 |
meshHdr.SetMeshSeqno (tag.GetSeqno ()); |
5129 | 196 |
meshHdr.SetMeshTtl (tag.GetTtl ()); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
197 |
packet->AddHeader (meshHdr); |
5129 | 198 |
header.SetAddr1 (tag.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
|
199 |
return true; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4886
diff
changeset
|
200 |
} |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
201 |
WifiMeshActionHeader |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
202 |
HwmpProtocolMac::GetWifiMeshActionHeader () |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
203 |
{ |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
204 |
WifiMeshActionHeader actionHdr; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
205 |
WifiMeshActionHeader::ActionValue action; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
206 |
action.pathSelection = WifiMeshActionHeader::PATH_SELECTION; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
207 |
actionHdr.SetAction (WifiMeshActionHeader::MESH_PATH_SELECTION, action); |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
208 |
return actionHdr; |
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
209 |
} |
4793 | 210 |
void |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
211 |
HwmpProtocolMac::SendPreq (IePreq preq) |
4793 | 212 |
{ |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
213 |
NS_LOG_FUNCTION_NOARGS (); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
214 |
std::vector<IePreq> preq_vector; |
5129 | 215 |
preq_vector.push_back (preq); |
216 |
SendPreq (preq_vector); |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
217 |
} |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
218 |
void |
5129 | 219 |
HwmpProtocolMac::SendPreq (std::vector<IePreq> preq) |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
220 |
{ |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
221 |
Ptr<Packet> packet = Create<Packet> (); |
5129 | 222 |
for (std::vector<IePreq>::const_iterator i = preq.begin (); i != preq.end (); i++) |
223 |
{ |
|
224 |
packet->AddHeader (*i); |
|
225 |
} |
|
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
226 |
packet->AddHeader (GetWifiMeshActionHeader ()); |
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
227 |
//create 802.11 header: |
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
228 |
WifiMacHeader hdr; |
4968
ff5a2162d492
MulthopAction -> Action management frames in 802.11s according to std
Pavel Boyko <boyko@iitp.ru>
parents:
4965
diff
changeset
|
229 |
hdr.SetAction (); |
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
230 |
hdr.SetDsNotFrom (); |
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
231 |
hdr.SetDsNotTo (); |
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
232 |
hdr.SetAddr2 (m_parent->GetAddress ()); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4984
diff
changeset
|
233 |
hdr.SetAddr3 (m_protocol->GetAddress ()); |
4926
a9382a693fa1
PREQ queue bugfix, tested proactive mode, removed unnseded debug messages
Kirill Andreev <andreev@iitp.ru>
parents:
4925
diff
changeset
|
234 |
//Send Management frame |
5129 | 235 |
std::vector<Mac48Address> receivers = m_protocol->GetPreqReceivers (m_ifIndex); |
236 |
for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end (); i++) |
|
237 |
{ |
|
238 |
hdr.SetAddr1 (*i); |
|
239 |
m_stats.txPreq++; |
|
240 |
m_stats.txMgt++; |
|
241 |
m_stats.txMgtBytes += packet->GetSize (); |
|
242 |
m_parent->SendManagementFrame (packet, hdr); |
|
243 |
} |
|
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
244 |
} |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
245 |
void |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
246 |
HwmpProtocolMac::RequestDestination (Mac48Address dst, uint32_t originator_seqno, uint32_t dst_seqno) |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
247 |
{ |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
248 |
NS_LOG_FUNCTION_NOARGS (); |
5129 | 249 |
for (std::vector<IePreq>::iterator i = m_myPreq.begin (); i != m_myPreq.end (); i++) |
250 |
{ |
|
251 |
if (i->IsFull ()) |
|
252 |
{ |
|
253 |
continue; |
|
254 |
} |
|
255 |
NS_ASSERT (i->GetDestCount () > 0); |
|
256 |
i->AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno); |
|
257 |
} |
|
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
258 |
IePreq preq; |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
259 |
preq.SetHopcount (0); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
260 |
preq.SetTTL (m_protocol->GetMaxTtl ()); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
261 |
preq.SetPreqID (m_protocol->GetNextPreqId ()); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
262 |
preq.SetOriginatorAddress (m_protocol->GetAddress ()); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
263 |
preq.SetOriginatorSeqNumber (originator_seqno); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
264 |
preq.SetLifetime (m_protocol->GetActivePathLifetime ()); |
5129 | 265 |
preq.AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno); |
266 |
m_myPreq.push_back (preq); |
|
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
267 |
SendMyPreq (); |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
268 |
} |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
269 |
void |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
270 |
HwmpProtocolMac::SendMyPreq () |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
271 |
{ |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
272 |
NS_LOG_FUNCTION_NOARGS (); |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
273 |
if (m_preqTimer.IsRunning ()) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
274 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
275 |
return; |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
276 |
} |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
277 |
if (m_myPreq.size () == 0) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
278 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
279 |
return; |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
280 |
} |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
281 |
//reschedule sending PREQ |
5129 | 282 |
NS_ASSERT (!m_preqTimer.IsRunning ()); |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
283 |
m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpProtocolMac::SendMyPreq, this); |
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
284 |
SendPreq (m_myPreq); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
285 |
m_myPreq.clear (); |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4896
diff
changeset
|
286 |
} |
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4896
diff
changeset
|
287 |
void |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
288 |
HwmpProtocolMac::SendPrep (IePrep prep, Mac48Address receiver) |
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4896
diff
changeset
|
289 |
{ |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
290 |
NS_LOG_FUNCTION_NOARGS (); |
4895 | 291 |
//Create packet |
5129 | 292 |
Ptr<Packet> packet = Create<Packet> (); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
293 |
packet->AddHeader (prep); |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
294 |
packet->AddHeader (GetWifiMeshActionHeader ()); |
4895 | 295 |
//create 802.11 header: |
296 |
WifiMacHeader hdr; |
|
4968
ff5a2162d492
MulthopAction -> Action management frames in 802.11s according to std
Pavel Boyko <boyko@iitp.ru>
parents:
4965
diff
changeset
|
297 |
hdr.SetAction (); |
4895 | 298 |
hdr.SetDsNotFrom (); |
299 |
hdr.SetDsNotTo (); |
|
4900
0c34a34208f2
restructured precursors in rtable
Kirill Andreev <andreev@iitp.ru>
parents:
4896
diff
changeset
|
300 |
hdr.SetAddr1 (receiver); |
4895 | 301 |
hdr.SetAddr2 (m_parent->GetAddress ()); |
4996
33f418524356
Fixed routing information with neighbours, fixed address3 in management
Kirill Andreev <andreev@iitp.ru>
parents:
4984
diff
changeset
|
302 |
hdr.SetAddr3 (m_protocol->GetAddress ()); |
4895 | 303 |
//Send Management frame |
5129 | 304 |
m_stats.txPrep++; |
305 |
m_stats.txMgt++; |
|
5038 | 306 |
m_stats.txMgtBytes += packet->GetSize (); |
5129 | 307 |
m_parent->SendManagementFrame (packet, hdr); |
4793 | 308 |
} |
309 |
void |
|
5129 | 310 |
HwmpProtocolMac::ForwardPerr (std::vector<IePerr::FailedDestination> failedDestinations, std::vector< |
311 |
Mac48Address> receivers) |
|
4793 | 312 |
{ |
5107
ec4196c70800
Fixed PREQ propagation, added comments to PREQ information element
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
313 |
NS_LOG_FUNCTION_NOARGS (); |
5129 | 314 |
Ptr<Packet> packet = Create<Packet> (); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
315 |
IePerr perr; |
5129 | 316 |
for (std::vector<IePerr::FailedDestination>::const_iterator i = failedDestinations.begin (); i |
317 |
!= failedDestinations.end (); i++) |
|
318 |
{ |
|
319 |
if (!perr.IsFull ()) |
|
320 |
{ |
|
321 |
perr.AddAddressUnit (*i); |
|
322 |
} |
|
323 |
else |
|
324 |
{ |
|
325 |
packet->AddHeader (perr); |
|
326 |
perr.ResetPerr (); |
|
327 |
} |
|
328 |
} |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
329 |
if (perr.GetNumOfDest () > 0) |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
330 |
{ |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
331 |
packet->AddHeader (perr); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
332 |
} |
5112
762835be2902
Action values are made in accordance with Draft3.0
Kirill Andreev <andreev@iitp.ru>
parents:
5111
diff
changeset
|
333 |
packet->AddHeader (GetWifiMeshActionHeader ()); |
5111 | 334 |
//create 802.11 header: |
335 |
WifiMacHeader hdr; |
|
336 |
hdr.SetAction (); |
|
337 |
hdr.SetDsNotFrom (); |
|
338 |
hdr.SetDsNotTo (); |
|
339 |
hdr.SetAddr2 (m_parent->GetAddress ()); |
|
340 |
hdr.SetAddr3 (m_protocol->GetAddress ()); |
|
5129 | 341 |
if (receivers.size () >= m_protocol->GetUnicastPerrThreshold ()) |
342 |
{ |
|
343 |
receivers.clear (); |
|
344 |
receivers.push_back (Mac48Address::GetBroadcast ()); |
|
345 |
} |
|
5111 | 346 |
//Send Management frame |
5129 | 347 |
for (std::vector<Mac48Address>::const_iterator i = m_myPerr.receivers.begin (); i |
348 |
!= m_myPerr.receivers.end (); i++) |
|
349 |
{ |
|
350 |
hdr.SetAddr1 (*i); |
|
351 |
m_stats.txPerr++; |
|
352 |
m_stats.txMgt++; |
|
353 |
m_stats.txMgtBytes += packet->GetSize (); |
|
354 |
m_parent->SendManagementFrame (packet, hdr); |
|
355 |
} |
|
5111 | 356 |
} |
357 |
void |
|
5129 | 358 |
HwmpProtocolMac::InitiatePerr (std::vector<IePerr::FailedDestination> failedDestinations, std::vector< |
359 |
Mac48Address> receivers) |
|
5111 | 360 |
{ |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
361 |
//All duplicates in PERR are checked here, and there is no reason to |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
362 |
//check it at any athoer place |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
363 |
{ |
5129 | 364 |
std::vector<Mac48Address>::const_iterator end = receivers.end (); |
365 |
for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != end; i++) |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
366 |
{ |
5129 | 367 |
bool should_add = true; |
368 |
for (std::vector<Mac48Address>::const_iterator j = m_myPerr.receivers.begin (); j |
|
369 |
!= m_myPerr.receivers.end (); j++) |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
370 |
{ |
5129 | 371 |
if ((*i) == (*j)) |
372 |
{ |
|
373 |
should_add = false; |
|
374 |
} |
|
375 |
} |
|
376 |
if (should_add) |
|
377 |
{ |
|
378 |
m_myPerr.receivers.push_back (*i); |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
379 |
} |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
380 |
} |
5129 | 381 |
} |
382 |
{ |
|
383 |
std::vector<IePerr::FailedDestination>::const_iterator end = failedDestinations.end (); |
|
384 |
for (std::vector<IePerr::FailedDestination>::const_iterator i = failedDestinations.begin (); i != end; i++) |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
385 |
{ |
5129 | 386 |
bool should_add = true; |
387 |
for (std::vector<IePerr::FailedDestination>::const_iterator j = m_myPerr.destinations.begin (); j |
|
388 |
!= m_myPerr.destinations.end (); j++) |
|
389 |
{ |
|
390 |
if (((*i).destination == (*j).destination) && ((*j).seqnum > (*i).seqnum)) |
|
391 |
{ |
|
392 |
should_add = false; |
|
393 |
} |
|
394 |
} |
|
395 |
if (should_add) |
|
396 |
{ |
|
397 |
m_myPerr.destinations.push_back (*i); |
|
398 |
} |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
399 |
} |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
400 |
} |
5111 | 401 |
SendMyPerr (); |
402 |
} |
|
403 |
void |
|
5129 | 404 |
HwmpProtocolMac::SendMyPerr () |
5111 | 405 |
{ |
406 |
NS_LOG_FUNCTION_NOARGS (); |
|
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
407 |
if (m_perrTimer.IsRunning ()) |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
408 |
{ |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
409 |
return; |
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
410 |
} |
5111 | 411 |
m_perrTimer = Simulator::Schedule (m_protocol->GetPerrMinInterval (), &HwmpProtocolMac::SendMyPerr, this); |
5113
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
412 |
ForwardPerr (m_myPerr.destinations, m_myPerr.receivers); |
a912d4372406
PREQ, PREP overflow is handled correctly
Kirill Andreev <andreev@iitp.ru>
parents:
5112
diff
changeset
|
413 |
m_myPerr.destinations.clear (); |
5111 | 414 |
m_myPerr.receivers.clear (); |
4793 | 415 |
} |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
416 |
uint32_t |
5129 | 417 |
HwmpProtocolMac::GetLinkMetric (Mac48Address peerAddress) const |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
418 |
{ |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5113
diff
changeset
|
419 |
return m_parent->GetLinkMetric (peerAddress); |
4944
779b641cff5a
Unicast chain instead of broadcast data frame added. Metric
Kirill Andreev <andreev@iitp.ru>
parents:
4943
diff
changeset
|
420 |
} |
4950
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4949
diff
changeset
|
421 |
uint16_t |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
422 |
HwmpProtocolMac::GetChannelId () const |
4950
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4949
diff
changeset
|
423 |
{ |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4949
diff
changeset
|
424 |
return m_parent->GetFrequencyChannel (); |
1163cfb03b9b
Broadcast is not forwarded twice into the same channel
Kirill Andreev <andreev@iitp.ru>
parents:
4949
diff
changeset
|
425 |
} |
5126
8e06088a785d
Statistics removed from headers
Kirill Andreev <andreev@iitp.ru>
parents:
5125
diff
changeset
|
426 |
HwmpProtocolMac::Statistics::Statistics () : |
5129 | 427 |
txPreq (0), rxPreq (0), txPrep (0), rxPrep (0), txPerr (0), rxPerr (0), txMgt (0), txMgtBytes (0), |
428 |
rxMgt (0), rxMgtBytes (0), txData (0), txDataBytes (0), rxData (0), rxDataBytes (0) |
|
429 |
{ |
|
430 |
} |
|
5012 | 431 |
void |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
432 |
HwmpProtocolMac::Statistics::Print (std::ostream & os) const |
5012 | 433 |
{ |
5015 | 434 |
os << "<Statistics " |
5038 | 435 |
"txPreq= \"" << txPreq << "\"\n" |
436 |
"txPrep=\"" << txPrep << "\"\n" |
|
437 |
"txPerr=\"" << txPerr << "\"\n" |
|
438 |
"rxPreq=\"" << rxPreq << "\"\n" |
|
439 |
"rxPrep=\"" << rxPrep << "\"\n" |
|
440 |
"rxPerr=\"" << rxPerr << "\"\n" |
|
441 |
"txMgt=\"" << txMgt << "\"\n" |
|
5129 | 442 |
"txMgtBytes=\"" << txMgtBytes << "\"\n" |
5038 | 443 |
"rxMgt=\"" << rxMgt << "\"\n" |
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5086
diff
changeset
|
444 |
"rxMgtBytes=\"" << rxMgtBytes << "\"\n" |
5038 | 445 |
"txData=\"" << txData << "\"\n" |
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5086
diff
changeset
|
446 |
"txDataBytes=\"" << txDataBytes << "\"\n" |
5038 | 447 |
"rxData=\"" << rxData << "\"\n" |
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5086
diff
changeset
|
448 |
"rxDataBytes=\"" << rxDataBytes << "\"/>\n"; |
5012 | 449 |
} |
450 |
void |
|
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
451 |
HwmpProtocolMac::Report (std::ostream & os) const |
5012 | 452 |
{ |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
453 |
os << "<HwmpProtocolMac\n" |
5129 | 454 |
"address =\"" << m_parent->GetAddress () << "\">\n"; |
455 |
m_stats.Print (os); |
|
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
456 |
os << "</HwmpProtocolMac>\n"; |
5012 | 457 |
} |
5013 | 458 |
void |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5083
diff
changeset
|
459 |
HwmpProtocolMac::ResetStats () |
5013 | 460 |
{ |
461 |
m_stats = Statistics::Statistics (); |
|
462 |
} |
|
463 |
||
4886
bdbf21835837
HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents:
4884
diff
changeset
|
464 |
} //namespace dot11s |
4793 | 465 |
}//namespace ns3 |