A Discrete-Event Network Simulator
API
hwmp-protocol-mac.cc
Go to the documentation of this file.
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
6  * it under the terms of the GNU General Public License version 2 as
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 
21 #include "ns3/mesh-wifi-interface-mac.h"
22 #include "ns3/packet.h"
23 #include "ns3/simulator.h"
24 #include "ns3/nstime.h"
25 #include "ns3/log.h"
26 #include "dot11s-mac-header.h"
27 #include "hwmp-protocol-mac.h"
28 #include "hwmp-tag.h"
29 #include "ie-dot11s-preq.h"
30 #include "ie-dot11s-prep.h"
31 #include "ie-dot11s-rann.h"
32 #include "ie-dot11s-perr.h"
33 
34 namespace ns3 {
35 
36 NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac");
37 
38 namespace dot11s {
39 
41  m_ifIndex (ifIndex), m_protocol (protocol)
42 {
43  NS_LOG_FUNCTION (this << ifIndex << protocol);
44 }
46 {
47 }
48 void
50 {
51  NS_LOG_FUNCTION (this << parent);
52  m_parent = parent;
53 }
54 
55 bool
57 {
58  NS_LOG_FUNCTION (this << packet << header);
59  NS_ASSERT (header.IsData ());
60 
61  MeshHeader meshHdr;
62  HwmpTag tag;
63  if (packet->PeekPacketTag (tag))
64  {
65  NS_FATAL_ERROR ("HWMP tag is not supposed to be received by network");
66  }
67 
68  packet->RemoveHeader (meshHdr);
69  m_stats.rxData++;
70  m_stats.rxDataBytes += packet->GetSize ();
71 
73  Mac48Address destination;
74  Mac48Address source;
75  switch (meshHdr.GetAddressExt ())
76  {
77  case 0:
78  source = header.GetAddr4 ();
79  destination = header.GetAddr3 ();
80  break;
81  default:
83  "6-address scheme is not yet supported and 4-address extension is not supposed to be used for data frames.");
84  }
85  tag.SetSeqno (meshHdr.GetMeshSeqno ());
86  tag.SetTtl (meshHdr.GetMeshTtl ());
87  packet->AddPacketTag (tag);
88 
89  if ((destination == Mac48Address::GetBroadcast ()) && (m_protocol->DropDataFrame (meshHdr.GetMeshSeqno (),
90  source)))
91  {
92  return false;
93  }
94  return true;
95 }
96 
97 bool
99 {
100  NS_LOG_FUNCTION (this << packet << header);
101  m_stats.rxMgt++;
102  m_stats.rxMgtBytes += packet->GetSize ();
103  WifiActionHeader actionHdr;
104  packet->RemoveHeader (actionHdr);
105  if (actionHdr.GetCategory () != WifiActionHeader::MESH)
106  {
107  return true;
108  }
110  // To determine header size here, we can rely on the knowledge that
111  // this is the last header to remove.
112  packet->RemoveHeader (elements, packet->GetSize ());
113  std::vector<HwmpProtocol::FailedDestination> failedDestinations;
114  for (MeshInformationElementVector::Iterator i = elements.Begin (); i != elements.End (); i++)
115  {
116  if ((*i)->ElementId () == IE_RANN)
117  {
118  NS_LOG_WARN ("RANN is not supported!");
119  }
120  if ((*i)->ElementId () == IE_PREQ)
121  {
122  Ptr<IePreq> preq = DynamicCast<IePreq> (*i);
123  NS_ASSERT (preq != 0);
124  m_stats.rxPreq++;
125  if (preq->GetOriginatorAddress () == m_protocol->GetAddress ())
126  {
127  continue;
128  }
129  if (preq->GetTtl () == 0)
130  {
131  continue;
132  }
133  preq->DecrementTtl ();
134  m_protocol->ReceivePreq (*preq, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (),
135  m_parent->GetLinkMetric (header.GetAddr2 ()));
136  }
137  if ((*i)->ElementId () == IE_PREP)
138  {
139  Ptr<IePrep> prep = DynamicCast<IePrep> (*i);
140  NS_ASSERT (prep != 0);
141  m_stats.rxPrep++;
142  if (prep->GetTtl () == 0)
143  {
144  continue;
145  }
146  prep->DecrementTtl ();
147  m_protocol->ReceivePrep (*prep, header.GetAddr2 (), m_ifIndex, header.GetAddr3 (),
148  m_parent->GetLinkMetric (header.GetAddr2 ()));
149  }
150  if ((*i)->ElementId () == IE_PERR)
151  {
152  Ptr<IePerr> perr = DynamicCast<IePerr> (*i);
153  NS_ASSERT (perr != 0);
154  m_stats.rxPerr++;
155  std::vector<HwmpProtocol::FailedDestination> destinations = perr->GetAddressUnitVector ();
156  for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = destinations.begin (); i
157  != destinations.end (); i++)
158  {
159  failedDestinations.push_back (*i);
160  }
161  }
162  }
163  if (failedDestinations.size () > 0)
164  {
165  m_protocol->ReceivePerr (failedDestinations, header.GetAddr2 (), m_ifIndex, header.GetAddr3 ());
166  }
167  NS_ASSERT (packet->GetSize () == 0);
168  return false;
169 }
170 
171 bool
173 {
174  NS_LOG_FUNCTION (this << packet << header);
175  if (header.IsData ())
176  {
177  return ReceiveData (packet, header);
178  }
179  else
180  {
181  if (header.IsAction ())
182  {
183  return ReceiveAction (packet, header);
184  }
185  else
186  {
187  return true; // don't care
188  }
189  }
190 }
191 bool
193  Mac48Address to)
194 {
195  NS_LOG_FUNCTION (this << packet << header << from << to);
196  if (!header.IsData ())
197  {
198  return true;
199  }
200  HwmpTag tag;
201  bool tagExists = packet->RemovePacketTag (tag);
202  if (!tagExists)
203  {
204  NS_FATAL_ERROR ("HWMP tag must exist at this point");
205  }
206  m_stats.txData++;
207  m_stats.txDataBytes += packet->GetSize ();
208  MeshHeader meshHdr;
209  meshHdr.SetMeshSeqno (tag.GetSeqno ());
210  meshHdr.SetMeshTtl (tag.GetTtl ());
211  packet->AddHeader (meshHdr);
212  header.SetAddr1 (tag.GetAddress ());
213  header.SetQosMeshControlPresent ();
214  return true;
215 }
218 {
219  WifiActionHeader actionHdr;
222  actionHdr.SetAction (WifiActionHeader::MESH, action);
223  return actionHdr;
224 }
225 void
227 {
228  NS_LOG_FUNCTION (this);
229  std::vector<IePreq> preq_vector;
230  preq_vector.push_back (preq);
231  SendPreq (preq_vector);
232 }
233 void
234 HwmpProtocolMac::SendPreq (std::vector<IePreq> preq)
235 {
236  NS_LOG_FUNCTION (this);
237  Ptr<Packet> packet = Create<Packet> ();
239  for (std::vector<IePreq>::iterator i = preq.begin (); i != preq.end (); i++)
240  {
241  elements.AddInformationElement (Ptr<IePreq> (&(*i)));
242  }
243  packet->AddHeader (elements);
244  packet->AddHeader (GetWifiActionHeader ());
245  //create 802.11 header:
246  WifiMacHeader hdr;
248  hdr.SetDsNotFrom ();
249  hdr.SetDsNotTo ();
250  hdr.SetAddr2 (m_parent->GetAddress ());
251  hdr.SetAddr3 (m_protocol->GetAddress ());
252  //Send Management frame
253  std::vector<Mac48Address> receivers = m_protocol->GetPreqReceivers (m_ifIndex);
254  for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end (); i++)
255  {
256  hdr.SetAddr1 (*i);
257  m_stats.txPreq++;
258  m_stats.txMgt++;
259  m_stats.txMgtBytes += packet->GetSize ();
260  m_parent->SendManagementFrame (packet, hdr);
261  }
262 }
263 void
264 HwmpProtocolMac::RequestDestination (Mac48Address dst, uint32_t originator_seqno, uint32_t dst_seqno)
265 {
266  NS_LOG_FUNCTION (this << dst << originator_seqno << dst_seqno);
267  for (std::vector<IePreq>::iterator i = m_myPreq.begin (); i != m_myPreq.end (); i++)
268  {
269  if (i->IsFull ())
270  {
271  continue;
272  }
273  NS_ASSERT (i->GetDestCount () > 0);
274  i->AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno);
275  }
276  IePreq preq;
277  preq.SetHopcount (0);
278  preq.SetTTL (m_protocol->GetMaxTtl ());
279  preq.SetPreqID (m_protocol->GetNextPreqId ());
280  preq.SetOriginatorAddress (m_protocol->GetAddress ());
281  preq.SetOriginatorSeqNumber (originator_seqno);
282  preq.SetLifetime (m_protocol->GetActivePathLifetime ());
283  preq.AddDestinationAddressElement (m_protocol->GetDoFlag (), m_protocol->GetRfFlag (), dst, dst_seqno);
284  m_myPreq.push_back (preq);
285  SendMyPreq ();
286 }
287 void
289 {
290  NS_LOG_FUNCTION (this);
291  if (m_preqTimer.IsRunning ())
292  {
293  return;
294  }
295  if (m_myPreq.size () == 0)
296  {
297  return;
298  }
299  //reschedule sending PREQ
301  m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpProtocolMac::SendMyPreq, this);
302  SendPreq (m_myPreq);
303  m_myPreq.clear ();
304 }
305 void
307 {
308  NS_LOG_FUNCTION (this << receiver);
309  //Create packet
310  Ptr<Packet> packet = Create<Packet> ();
312  elements.AddInformationElement (Ptr<IePrep> (&prep));
313  packet->AddHeader (elements);
314  packet->AddHeader (GetWifiActionHeader ());
315  //create 802.11 header:
316  WifiMacHeader hdr;
318  hdr.SetDsNotFrom ();
319  hdr.SetDsNotTo ();
320  hdr.SetAddr1 (receiver);
321  hdr.SetAddr2 (m_parent->GetAddress ());
322  hdr.SetAddr3 (m_protocol->GetAddress ());
323  //Send Management frame
324  m_stats.txPrep++;
325  m_stats.txMgt++;
326  m_stats.txMgtBytes += packet->GetSize ();
327  m_parent->SendManagementFrame (packet, hdr);
328 }
329 void
330 HwmpProtocolMac::ForwardPerr (std::vector<HwmpProtocol::FailedDestination> failedDestinations, std::vector<
331  Mac48Address> receivers)
332 {
333  NS_LOG_FUNCTION (this);
334  Ptr<Packet> packet = Create<Packet> ();
335  Ptr<IePerr> perr = Create <IePerr> ();
337  for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = failedDestinations.begin (); i
338  != failedDestinations.end (); i++)
339  {
340  if (!perr->IsFull ())
341  {
342  perr->AddAddressUnit (*i);
343  }
344  else
345  {
346  elements.AddInformationElement (perr);
347  perr->ResetPerr ();
348  }
349  }
350  if (perr->GetNumOfDest () > 0)
351  {
352  elements.AddInformationElement (perr);
353  }
354  packet->AddHeader (elements);
355  packet->AddHeader (GetWifiActionHeader ());
356  //create 802.11 header:
357  WifiMacHeader hdr;
359  hdr.SetDsNotFrom ();
360  hdr.SetDsNotTo ();
361  hdr.SetAddr2 (m_parent->GetAddress ());
362  hdr.SetAddr3 (m_protocol->GetAddress ());
363  if (receivers.size () >= m_protocol->GetUnicastPerrThreshold ())
364  {
365  receivers.clear ();
366  receivers.push_back (Mac48Address::GetBroadcast ());
367  }
368  //Send Management frame
369  for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end (); i++)
370  {
371  //
372  // 64-bit Intel valgrind complains about hdr.SetAddr1 (*i). It likes this
373  // just fine.
374  //
375  Mac48Address address = *i;
376  hdr.SetAddr1 (address);
377  m_stats.txPerr++;
378  m_stats.txMgt++;
379  m_stats.txMgtBytes += packet->GetSize ();
380  m_parent->SendManagementFrame (packet, hdr);
381  }
382 }
383 void
384 HwmpProtocolMac::InitiatePerr (std::vector<HwmpProtocol::FailedDestination> failedDestinations, std::vector<
385  Mac48Address> receivers)
386 {
387  NS_LOG_FUNCTION (this);
388  //All duplicates in PERR are checked here, and there is no reason to
389  //check it at any other place
390  {
391  std::vector<Mac48Address>::const_iterator end = receivers.end ();
392  for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != end; i++)
393  {
394  bool should_add = true;
395  for (std::vector<Mac48Address>::const_iterator j = m_myPerr.receivers.begin (); j
396  != m_myPerr.receivers.end (); j++)
397  {
398  if ((*i) == (*j))
399  {
400  should_add = false;
401  }
402  }
403  if (should_add)
404  {
405  m_myPerr.receivers.push_back (*i);
406  NS_LOG_DEBUG ("Initiate PERR: Adding receiver: " << (*i));
407  }
408  }
409  }
410  {
411  std::vector<HwmpProtocol::FailedDestination>::const_iterator end = failedDestinations.end ();
412  for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = failedDestinations.begin (); i != end; i++)
413  {
414  bool should_add = true;
415  for (std::vector<HwmpProtocol::FailedDestination>::const_iterator j = m_myPerr.destinations.begin (); j
416  != m_myPerr.destinations.end (); j++)
417  {
418  if (((*i).destination == (*j).destination) && ((*j).seqnum > (*i).seqnum))
419  {
420  should_add = false;
421  }
422  }
423  if (should_add)
424  {
425  m_myPerr.destinations.push_back (*i);
426  NS_LOG_DEBUG ("Initiate PERR: Adding failed destination: " << (*i).destination);
427  }
428  }
429  }
430  SendMyPerr ();
431 }
432 void
434 {
435  NS_LOG_FUNCTION (this);
436  if (m_perrTimer.IsRunning ())
437  {
438  return;
439  }
440  m_perrTimer = Simulator::Schedule (m_protocol->GetPerrMinInterval (), &HwmpProtocolMac::SendMyPerr, this);
442  m_myPerr.destinations.clear ();
443  m_myPerr.receivers.clear ();
444 }
445 uint32_t
447 {
448  return m_parent->GetLinkMetric (peerAddress);
449 }
450 uint16_t
452 {
453  return m_parent->GetFrequencyChannel ();
454 }
456  txPreq (0), rxPreq (0), txPrep (0), rxPrep (0), txPerr (0), rxPerr (0), txMgt (0), txMgtBytes (0),
457  rxMgt (0), rxMgtBytes (0), txData (0), txDataBytes (0), rxData (0), rxDataBytes (0)
458 {
459 }
460 void
461 HwmpProtocolMac::Statistics::Print (std::ostream & os) const
462 {
463  os << "<Statistics "
464  "txPreq= \"" << txPreq << "\"" << std::endl <<
465  "txPrep=\"" << txPrep << "\"" << std::endl <<
466  "txPerr=\"" << txPerr << "\"" << std::endl <<
467  "rxPreq=\"" << rxPreq << "\"" << std::endl <<
468  "rxPrep=\"" << rxPrep << "\"" << std::endl <<
469  "rxPerr=\"" << rxPerr << "\"" << std::endl <<
470  "txMgt=\"" << txMgt << "\"" << std::endl <<
471  "txMgtBytes=\"" << txMgtBytes << "\"" << std::endl <<
472  "rxMgt=\"" << rxMgt << "\"" << std::endl <<
473  "rxMgtBytes=\"" << rxMgtBytes << "\"" << std::endl <<
474  "txData=\"" << txData << "\"" << std::endl <<
475  "txDataBytes=\"" << txDataBytes << "\"" << std::endl <<
476  "rxData=\"" << rxData << "\"" << std::endl <<
477  "rxDataBytes=\"" << rxDataBytes << "\"/>" << std::endl;
478 }
479 void
480 HwmpProtocolMac::Report (std::ostream & os) const
481 {
482  os << "<HwmpProtocolMac" << std::endl <<
483  "address =\"" << m_parent->GetAddress () << "\">" << std::endl;
484  m_stats.Print (os);
485  os << "</HwmpProtocolMac>" << std::endl;
486 }
487 void
489 {
490  NS_LOG_FUNCTION (this);
491  m_stats = Statistics ();
492 }
493 
494 int64_t
496 {
497  return m_protocol->AssignStreams (stream);
498 }
499 
500 
501 } // namespace dot11s
502 } // namespace ns3
ns3::dot11s::MeshHeader::GetMeshSeqno
uint32_t GetMeshSeqno() const
Get the four-byte mesh sequence number.
Definition: dot11s-mac-header.cc:89
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::dot11s::HwmpProtocolMac::GetChannelId
uint16_t GetChannelId() const
Get the channel ID.
Definition: hwmp-protocol-mac.cc:451
ns3::dot11s::HwmpProtocolMac::m_ifIndex
uint32_t m_ifIndex
IF index.
Definition: hwmp-protocol-mac.h:133
ns3::dot11s::IePreq::AddDestinationAddressElement
void AddDestinationAddressElement(bool doFlag, bool rfFlag, Mac48Address dest_address, uint32_t dest_seq_number)
Add a destination address unit: flags, destination and sequence number.
Definition: ie-dot11s-preq.cc:339
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
ns3::dot11s::HwmpProtocolMac::SendMyPreq
void SendMyPreq()
Sends one PREQ when PreqMinInterval after last PREQ expires (if any PREQ exists in rhe queue)
Definition: hwmp-protocol-mac.cc:288
ns3::dot11s::HwmpProtocolMac::ReceiveData
bool ReceiveData(Ptr< Packet > packet, const WifiMacHeader &header)
Receive data frame.
Definition: hwmp-protocol-mac.cc:56
ns3::dot11s::HwmpProtocolMac::m_perrTimer
EventId m_perrTimer
PERR.
Definition: hwmp-protocol-mac.h:144
ns3::dot11s::HwmpProtocolMac::GetLinkMetric
uint32_t GetLinkMetric(Mac48Address peerAddress) const
Definition: hwmp-protocol-mac.cc:446
ns3::dot11s::HwmpProtocolMac::~HwmpProtocolMac
~HwmpProtocolMac()
Definition: hwmp-protocol-mac.cc:45
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
IE_RANN
#define IE_RANN
Definition: wifi-information-element.h:160
ns3::Packet::GetSize
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::WifiActionHeader::ActionValue::meshAction
MeshActionValue meshAction
mesh action
Definition: mgt-headers.h:957
ns3::WifiActionHeader::PATH_SELECTION
@ PATH_SELECTION
Definition: mgt-headers.h:928
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::dot11s::HwmpTag::GetSeqno
uint32_t GetSeqno()
Get the sequence number.
Definition: hwmp-tag.cc:81
ns3::WifiActionHeader::MESH
@ MESH
Definition: mgt-headers.h:899
ns3::dot11s::HwmpProtocolMac::SetParent
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Each plugin must be installed on an interface to work.
Definition: hwmp-protocol-mac.cc:49
ns3::dot11s::HwmpProtocolMac::UpdateOutcomingFrame
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Update frame before it will be forwarded down.
Definition: hwmp-protocol-mac.cc:192
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::dot11s::HwmpProtocolMac::ReceiveAction
bool ReceiveAction(Ptr< Packet > packet, const WifiMacHeader &header)
Receive action management frame.
Definition: hwmp-protocol-mac.cc:98
hwmp-tag.h
ns3::dot11s::HwmpProtocolMac::Statistics::rxMgt
uint16_t rxMgt
receive management
Definition: hwmp-protocol-mac.h:169
ns3::WifiInformationElementVector::Begin
Iterator Begin()
Returns Begin of the vector.
Definition: wifi-information-element-vector.cc:135
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::dot11s::IePreq::SetTTL
void SetTTL(uint8_t ttl)
Set remaining number of hops allowed for this element.
Definition: ie-dot11s-preq.cc:117
ns3::WifiActionHeader::ActionValue
typedef for union of different ActionValues
Definition: mgt-headers.h:956
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiMacHeader::GetAddr3
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Definition: wifi-mac-header.cc:436
ns3::dot11s::HwmpProtocolMac::SendMyPerr
void SendMyPerr()
Send PERR function.
Definition: hwmp-protocol-mac.cc:433
ns3::dot11s::HwmpTag::SetSeqno
void SetSeqno(uint32_t seqno)
Set sequence number.
Definition: hwmp-tag.cc:75
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::Packet::PeekPacketTag
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
Definition: packet.cc:978
ns3::Simulator::Schedule
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:556
ns3::dot11s::MeshHeader
Mesh Control field, see Section 8.2.4.7.3 IEEE 802.11-2012.
Definition: dot11s-mac-header.h:38
ns3::dot11s::HwmpProtocolMac::Statistics::rxPreq
uint16_t rxPreq
receive PREQ
Definition: hwmp-protocol-mac.h:162
ie-dot11s-perr.h
ns3::dot11s::HwmpProtocolMac::Statistics::txMgt
uint16_t txMgt
transmit management
Definition: hwmp-protocol-mac.h:167
ns3::dot11s::HwmpProtocolMac::InitiatePerr
void InitiatePerr(std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
initiate my own path error
Definition: hwmp-protocol-mac.cc:384
ns3::dot11s::HwmpProtocolMac::Statistics::rxPrep
uint16_t rxPrep
receive PREP
Definition: hwmp-protocol-mac.h:164
ns3::dot11s::HwmpProtocolMac::Statistics::Print
void Print(std::ostream &os) const
Print function.
Definition: hwmp-protocol-mac.cc:461
ns3::dot11s::HwmpProtocolMac::ForwardPerr
void ForwardPerr(std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
Forward a path error.
Definition: hwmp-protocol-mac.cc:330
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::dot11s::MeshHeader::GetAddressExt
uint8_t GetAddressExt() const
Get Address Extension Mode.
Definition: dot11s-mac-header.cc:110
ns3::dot11s::HwmpTag::SetTtl
void SetTtl(uint8_t ttl)
Set the TTL value.
Definition: hwmp-tag.cc:51
ie-dot11s-rann.h
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::WifiActionHeader
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:885
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
ns3::dot11s::IePreq::SetOriginatorAddress
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address value.
Definition: ie-dot11s-preq.cc:132
ns3::EventId::IsRunning
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:71
ns3::dot11s::HwmpProtocolMac::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: hwmp-protocol-mac.cc:495
ns3::WifiInformationElementVector::AddInformationElement
bool AddInformationElement(Ptr< WifiInformationElement > element)
add an IE, if maxSize has exceeded, returns false
Definition: wifi-information-element-vector.cc:147
ns3::dot11s::HwmpProtocolMac::Statistics::rxMgtBytes
uint32_t rxMgtBytes
receive management bytes
Definition: hwmp-protocol-mac.h:170
ns3::dot11s::IePreq
See 7.3.2.96 of 802.11s draft 2.07.
Definition: ie-dot11s-preq.h:103
ns3::dot11s::HwmpProtocolMac::RequestDestination
void RequestDestination(Mac48Address dest, uint32_t originator_seqno, uint32_t dst_seqno)
Request a destination.
Definition: hwmp-protocol-mac.cc:264
ns3::dot11s::HwmpProtocolMac::ResetStats
void ResetStats()
Reset statistics.
Definition: hwmp-protocol-mac.cc:488
ns3::dot11s::HwmpProtocolMac::SendPreq
void SendPreq(IePreq preq)
Send PREQ function.
Definition: hwmp-protocol-mac.cc:226
ns3::dot11s::HwmpTag::GetTtl
uint8_t GetTtl()
Get the TTL value.
Definition: hwmp-tag.cc:57
ns3::dot11s::HwmpProtocolMac::m_myPerr
MyPerr m_myPerr
PERR.
Definition: hwmp-protocol-mac.h:150
ns3::dot11s::IePreq::SetLifetime
void SetLifetime(uint32_t lifetime)
Set lifetime in TUs for the forwarding information to be considered valid.
Definition: ie-dot11s-preq.cc:142
ns3::Packet::RemoveHeader
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
IE_PREQ
#define IE_PREQ
Definition: wifi-information-element.h:164
first.address
address
Definition: first.py:44
ns3::dot11s::MeshHeader::GetMeshTtl
uint8_t GetMeshTtl() const
Get mesh TTL function subfield value.
Definition: dot11s-mac-header.cc:99
ns3::dot11s::HwmpProtocolMac::m_protocol
Ptr< HwmpProtocol > m_protocol
protocol
Definition: hwmp-protocol-mac.h:134
ns3::dot11s::HwmpProtocolMac::MyPerr::destinations
std::vector< HwmpProtocol::FailedDestination > destinations
destinations
Definition: hwmp-protocol-mac.h:147
ns3::WifiMacHeader::SetQosMeshControlPresent
void SetQosMeshControlPresent()
Set the Mesh Control Present flag for the QoS header.
Definition: wifi-mac-header.cc:408
hwmp-protocol-mac.h
ns3::dot11s::HwmpProtocolMac::Statistics
Statistics structure.
Definition: hwmp-protocol-mac.h:160
ns3::dot11s::HwmpTag::GetAddress
Mac48Address GetAddress()
Get address from tag.
Definition: hwmp-tag.cc:45
ns3::dot11s::HwmpProtocolMac::MyPerr::receivers
std::vector< Mac48Address > receivers
receivers
Definition: hwmp-protocol-mac.h:148
ns3::dot11s::HwmpProtocolMac::Statistics::rxData
uint16_t rxData
receive data
Definition: hwmp-protocol-mac.h:173
ns3::WIFI_MAC_MGT_ACTION
@ WIFI_MAC_MGT_ACTION
Definition: wifi-mac-header.h:58
ns3::Packet::AddPacketTag
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:956
ns3::dot11s::HwmpProtocolMac::SendPrep
void SendPrep(IePrep prep, Mac48Address receiver)
Send PREP function.
Definition: hwmp-protocol-mac.cc:306
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
ns3::dot11s::HwmpProtocolMac::Receive
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Process received frame.
Definition: hwmp-protocol-mac.cc:172
ns3::WifiInformationElementVector::End
Iterator End()
Returns End of the vector.
Definition: wifi-information-element-vector.cc:141
ns3::dot11s::MeshHeader::SetMeshTtl
void SetMeshTtl(uint8_t TTL)
Set mesh TTL subfield corresponding to the remaining number of hops the MSDU/MMPDU is forwarded.
Definition: dot11s-mac-header.cc:94
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
IE_PERR
#define IE_PERR
Definition: wifi-information-element.h:166
ns3::WifiActionHeader::GetCategory
CategoryValue GetCategory()
Return the category value.
Definition: mgt-headers.cc:1226
ns3::WifiActionHeader::SetAction
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
Definition: mgt-headers.cc:1192
ns3::dot11s::HwmpProtocolMac::m_parent
Ptr< MeshWifiInterfaceMac > m_parent
parent
Definition: hwmp-protocol-mac.h:132
ns3::dot11s::IePreq::SetPreqID
void SetPreqID(uint32_t id)
Set path discovery id field.
Definition: ie-dot11s-preq.cc:122
ns3::dot11s::HwmpProtocolMac::Statistics::txData
uint16_t txData
transmit data
Definition: hwmp-protocol-mac.h:171
IE_PREP
#define IE_PREP
Definition: wifi-information-element.h:165
ns3::Packet::RemovePacketTag
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:963
ns3::dot11s::HwmpProtocolMac::m_preqTimer
EventId m_preqTimer
Timer for PREQs.
Definition: hwmp-protocol-mac.h:138
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::dot11s::HwmpProtocolMac::m_myPreq
std::vector< IePreq > m_myPreq
container of PREQs
Definition: hwmp-protocol-mac.h:139
ns3::dot11s::IePreq::SetOriginatorSeqNumber
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number.
Definition: ie-dot11s-preq.cc:137
ns3::dot11s::IePrep
See 7.3.2.97 of 802.11s draft 2.07.
Definition: ie-dot11s-prep.h:34
ns3::dot11s::HwmpProtocolMac::Statistics::txPrep
uint16_t txPrep
transmit PREP
Definition: hwmp-protocol-mac.h:163
ns3::dot11s::HwmpProtocolMac::Statistics::txMgtBytes
uint32_t txMgtBytes
transmit management bytes
Definition: hwmp-protocol-mac.h:168
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::dot11s::MeshHeader::SetMeshSeqno
void SetMeshSeqno(uint32_t seqno)
Set four-byte mesh sequence number.
Definition: dot11s-mac-header.cc:84
ns3::dot11s::IePreq::SetHopcount
void SetHopcount(uint8_t hopcount)
Set number of hops from originator to mesh STA transmitting this element.
Definition: ie-dot11s-preq.cc:112
ns3::dot11s::HwmpTag
Hwmp tag implements interaction between HWMP protocol and MeshWifiMac.
Definition: hwmp-tag.h:49
dot11s-mac-header.h
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::dot11s::HwmpProtocolMac::Statistics::Statistics
Statistics()
Definition: hwmp-protocol-mac.cc:455
ns3::WifiInformationElementVector::Iterator
std::vector< Ptr< WifiInformationElement > >::iterator Iterator
As soon as this is a vector, we define an Iterator.
Definition: wifi-information-element-vector.h:83
ns3::MeshInformationElementVector
Introspection did not find any typical Config paths.
Definition: mesh-information-element-vector.h:32
ns3::dot11s::HwmpProtocolMac::Statistics::txDataBytes
uint32_t txDataBytes
transmit data bytes
Definition: hwmp-protocol-mac.h:172
ns3::dot11s::HwmpProtocolMac::GetWifiActionHeader
static WifiActionHeader GetWifiActionHeader()
Definition: hwmp-protocol-mac.cc:217
ns3::dot11s::HwmpProtocolMac::Report
void Report(std::ostream &os) const
Report statistics.
Definition: hwmp-protocol-mac.cc:480
ns3::dot11s::HwmpProtocolMac::HwmpProtocolMac
HwmpProtocolMac(uint32_t ifIndex, Ptr< HwmpProtocol > protocol)
Constructor.
Definition: hwmp-protocol-mac.cc:40
ns3::dot11s::HwmpProtocolMac::Statistics::txPerr
uint16_t txPerr
transmit PERR
Definition: hwmp-protocol-mac.h:165
ns3::dot11s::HwmpProtocolMac::Statistics::rxDataBytes
uint32_t rxDataBytes
receive data bytes
Definition: hwmp-protocol-mac.h:174
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::WifiMacHeader::GetAddr4
Mac48Address GetAddr4(void) const
Return the address in the Address 4 field.
Definition: wifi-mac-header.cc:442
ie-dot11s-prep.h
ns3::dot11s::HwmpProtocolMac::m_stats
Statistics m_stats
statistics
Definition: hwmp-protocol-mac.h:183
ie-dot11s-preq.h
ns3::dot11s::HwmpProtocolMac::Statistics::txPreq
uint16_t txPreq
transmit PREQ
Definition: hwmp-protocol-mac.h:161
ns3::WifiMacHeader::IsAction
bool IsAction(void) const
Return true if the header is an Action header.
Definition: wifi-mac-header.cc:729
ns3::dot11s::HwmpProtocolMac::Statistics::rxPerr
uint16_t rxPerr
receive PERR
Definition: hwmp-protocol-mac.h:166