A Discrete-Event Network Simulator
API
wave-net-device.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  * Junling Bu <linlinjavaer@gmail.com>
19  */
20 #include <algorithm>
21 #include "ns3/node.h"
22 #include "ns3/wifi-phy.h"
23 #include "ns3/llc-snap-header.h"
24 #include "ns3/channel.h"
25 #include "ns3/log.h"
26 #include "ns3/socket.h"
27 #include "ns3/object-map.h"
28 #include "ns3/object-vector.h"
29 #include "wave-net-device.h"
30 #include "higher-tx-tag.h"
31 
32 namespace ns3 {
33 
34 NS_LOG_COMPONENT_DEFINE ("WaveNetDevice");
35 
36 NS_OBJECT_ENSURE_REGISTERED (WaveNetDevice);
37 
38 TypeId
40 {
41  static TypeId tid = TypeId ("ns3::WaveNetDevice")
42  .SetParent<NetDevice> ()
43  .SetGroupName ("Wave")
44  .AddConstructor<WaveNetDevice> ()
45  .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit",
49  MakeUintegerChecker<uint16_t> (1,MAX_MSDU_SIZE - LLC_SNAP_HEADER_LENGTH))
50  .AddAttribute ("Channel", "The channel attached to this device",
51  PointerValue (),
53  MakePointerChecker<Channel> ())
54  .AddAttribute ("PhyEntities", "The PHY entities attached to this device.",
57  MakeObjectVectorChecker<WifiPhy> ())
58  .AddAttribute ("MacEntities", "The MAC layer attached to this device.",
59  ObjectMapValue (),
61  MakeObjectMapChecker<OcbWifiMac> ())
62  .AddAttribute ("ChannelScheduler", "The channel scheduler attached to this device.",
63  PointerValue (),
66  MakePointerChecker<ChannelScheduler> ())
67  .AddAttribute ("ChannelManager", "The channel manager attached to this device.",
68  PointerValue (),
71  MakePointerChecker<ChannelManager> ())
72  .AddAttribute ("ChannelCoordinator", "The channel coordinator attached to this device.",
73  PointerValue (),
76  MakePointerChecker<ChannelCoordinator> ())
77  .AddAttribute ("VsaManager", "The VSA manager attached to this device.",
78  PointerValue (),
81  MakePointerChecker<VsaManager> ())
82  ;
83  return tid;
84 }
85 
87  : m_txProfile (0)
88 {
89  NS_LOG_FUNCTION (this);
90 }
91 
93 {
94  NS_LOG_FUNCTION (this);
95 }
96 
97 void
99 {
100  NS_LOG_FUNCTION (this);
101  if (m_txProfile != 0)
102  {
103  delete m_txProfile;
104  m_txProfile = 0;
105  }
106  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
107  {
108  Ptr<WifiPhy> phy = (*i);
109  phy->Dispose ();
110  }
111  m_phyEntities.clear ();
112  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
113  {
114  Ptr<OcbWifiMac> mac = i->second;
115  Ptr<WifiRemoteStationManager> stationManager = mac->GetWifiRemoteStationManager ();
116  stationManager->Dispose ();
117  mac->Dispose ();
118  }
119  m_macEntities.clear ();
120  m_phyEntities.clear ();
122  m_channelManager->Dispose ();
123  m_channelScheduler->Dispose ();
124  m_vsaManager->Dispose ();
126  m_channelManager = 0;
127  m_channelScheduler = 0;
128  m_vsaManager = 0;
129  // chain up.
131 }
132 
133 void
135 {
136  NS_LOG_FUNCTION (this);
137  if (m_phyEntities.size () == 0)
138  {
139  NS_FATAL_ERROR ("there is no PHY entity in this WAVE device");
140  }
141  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
142  {
143  Ptr<WifiPhy> phy = (*i);
144  phy->Initialize ();
145  }
146  if (m_macEntities.size () == 0)
147  {
148  NS_FATAL_ERROR ("there is no MAC entity in this WAVE device");
149  }
150  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
151  {
152  Ptr<OcbWifiMac> mac = i->second;
153  mac->SetForwardUpCallback (MakeCallback (&WaveNetDevice::ForwardUp, this));
154  // Make each MAC entity in sleep mode.
155  mac->Suspend ();
156  mac->Initialize ();
157 
158  Ptr<WifiRemoteStationManager> stationManager = mac->GetWifiRemoteStationManager ();
159  // Currently PHY is not attached to MAC and will be dynamically attached and unattached to MAC latter,
160  // however WifiRemoteStationManager in the MAC shall know something in the PHY such as supported data rates.
161  // Since these information can be treated as same when same PHY devices are added, here we force
162  // all of WifiRemoteStationManagers in multiple MAC entities only associate with single PHY device even there may
163  // be multiple PHY entities. This approach may be strange but can work fine.
164  stationManager->SetupPhy (m_phyEntities[0]);
165  stationManager->Initialize ();
166  }
167  m_channelScheduler->SetWaveNetDevice (this);
168  m_vsaManager->SetWaveNetDevice (this);
169  m_channelScheduler->Initialize ();
171  m_channelManager->Initialize ();
172  m_vsaManager->Initialize ();
174 }
175 
176 void
177 WaveNetDevice::AddMac (uint32_t channelNumber, Ptr<OcbWifiMac> mac)
178 {
179  NS_LOG_FUNCTION (this << channelNumber << mac);
180  if (!ChannelManager::IsWaveChannel (channelNumber))
181  {
182  NS_FATAL_ERROR ("The channel " << channelNumber << " is not a valid WAVE channel number");
183  }
184  if (m_macEntities.find (channelNumber) != m_macEntities.end ())
185  {
186  NS_FATAL_ERROR ("The MAC entity for channel " << channelNumber << " already exists.");
187  }
188  m_macEntities.insert (std::make_pair (channelNumber, mac));
189 }
191 WaveNetDevice::GetMac (uint32_t channelNumber) const
192 {
193  NS_LOG_FUNCTION (this << channelNumber);
194  MacEntitiesI i = m_macEntities.find (channelNumber);
195  if (i == m_macEntities.end ())
196  {
197  NS_FATAL_ERROR ("there is no available MAC entity for channel " << channelNumber);
198  }
199  return i->second;
200 }
201 
202 std::map<uint32_t, Ptr<OcbWifiMac> >
204 {
205  NS_LOG_FUNCTION (this);
206  return m_macEntities;
207 }
208 
209 void
211 {
212  NS_LOG_FUNCTION (this << phy);
213  if (std::find (m_phyEntities.begin (), m_phyEntities.end (), phy) != m_phyEntities.end ())
214  {
215  NS_FATAL_ERROR ("This PHY entity is already inserted");
216  }
217  m_phyEntities.push_back (phy);
218 }
220 WaveNetDevice::GetPhy (uint32_t index) const
221 {
222  NS_LOG_FUNCTION (this << index);
223  return m_phyEntities.at (index);
224 }
225 
226 std::vector<Ptr<WifiPhy> >
228 {
229  NS_LOG_FUNCTION (this);
230  return m_phyEntities;
231 }
232 
233 bool
235 {
236  NS_LOG_FUNCTION (this << &vsaInfo);
237  if (!IsAvailableChannel ( vsaInfo.channelNumber))
238  {
239  return false;
240  }
241  if (!m_channelScheduler->IsChannelAccessAssigned (vsaInfo.channelNumber))
242  {
243  NS_LOG_DEBUG ("there is no channel access assigned for channel " << vsaInfo.channelNumber);
244  return false;
245  }
246  if (vsaInfo.vsc == 0)
247  {
248  NS_LOG_DEBUG ("vendor specific information shall not be null");
249  return false;
250  }
251  if (vsaInfo.oi.IsNull () && vsaInfo.managementId >= 16)
252  {
253  NS_LOG_DEBUG ("when organization identifier is not set, management ID "
254  "shall be in range from 0 to 15");
255  return false;
256  }
257 
258  m_vsaManager->SendVsa (vsaInfo);
259  return true;
260 }
261 
262 
263 bool
264 WaveNetDevice::StopVsa (uint32_t channelNumber)
265 {
266  NS_LOG_FUNCTION (this << channelNumber);
267  if (!IsAvailableChannel (channelNumber))
268  {
269  return false;
270  }
271  m_vsaManager->RemoveByChannel (channelNumber);
272  return true;
273 }
274 
275 void
277 {
278  NS_LOG_FUNCTION (this);
279  m_vsaManager->SetWaveVsaCallback (vsaCallback);
280 }
281 
282 bool
284 {
285  NS_LOG_FUNCTION (this << &schInfo);
286  if (!IsAvailableChannel (schInfo.channelNumber))
287  {
288  return false;
289  }
290  return m_channelScheduler->StartSch (schInfo);
291 }
292 
293 bool
294 WaveNetDevice::StopSch (uint32_t channelNumber)
295 {
296  NS_LOG_FUNCTION (this << channelNumber);
297  if (!IsAvailableChannel (channelNumber))
298  {
299  return false;
300  }
301  return m_channelScheduler->StopSch (channelNumber);
302 }
303 
304 bool
306 {
307  NS_LOG_FUNCTION (this << &txprofile);
308  if (m_txProfile != 0)
309  {
310  return false;
311  }
312  if (!IsAvailableChannel (txprofile.channelNumber))
313  {
314  return false;
315  }
316  if (txprofile.txPowerLevel > 8)
317  {
318  return false;
319  }
320  // IP-based packets is not allowed to send in the CCH.
321  if (txprofile.channelNumber == CCH)
322  {
323  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
324  return false;
325  }
326  if (txprofile.dataRate == WifiMode () || txprofile.txPowerLevel == 8)
327  {
328  // let MAC layer itself determine tx parameters.
329  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
330  }
331  else
332  {
333  // if current PHY devices do not support data rate of the tx profile
334  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
335  {
336  if (!((*i)->IsModeSupported (txprofile.dataRate)))
337  {
338  NS_LOG_DEBUG ("This data rate " << txprofile.dataRate.GetUniqueName () << " is not supported by current PHY device");
339  return false;
340  }
341  }
342  }
343 
344  m_txProfile = new TxProfile ();
345  *m_txProfile = txprofile;
346  return true;
347 }
348 
349 bool
350 WaveNetDevice::DeleteTxProfile (uint32_t channelNumber)
351 {
352  NS_LOG_FUNCTION (this << channelNumber);
353  if (!IsAvailableChannel (channelNumber))
354  {
355  return false;
356  }
357  if (m_txProfile == 0)
358  {
359  return false;
360  }
361  if (m_txProfile->channelNumber != channelNumber)
362  {
363  return false;
364  }
365 
366  delete m_txProfile;
367  m_txProfile = 0;
368  return true;
369 }
370 
371 bool
372 WaveNetDevice::SendX (Ptr<Packet> packet, const Address & dest, uint32_t protocol, const TxInfo & txInfo)
373 {
374  NS_LOG_FUNCTION (this << packet << dest << protocol << &txInfo);
375  if (!IsAvailableChannel (txInfo.channelNumber))
376  {
377  return false;
378  }
379  if (!m_channelScheduler->IsChannelAccessAssigned (txInfo.channelNumber))
380  {
381  NS_LOG_DEBUG ("there is no channel access assigned for channel " << txInfo.channelNumber);
382  return false;
383  }
384  if ((txInfo.channelNumber == CCH) && (protocol == IPv4_PROT_NUMBER || protocol == IPv6_PROT_NUMBER))
385  {
386  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
387  return false;
388  }
389  if ((txInfo.priority > 7) || txInfo.txPowerLevel > 8)
390  {
391  NS_LOG_DEBUG ("invalid transmit parameters.");
392  return false;
393  }
394 
395  if ((txInfo.dataRate == WifiMode ()) || (txInfo.txPowerLevel == 8))
396  {
397  // let MAC layer itself determine tx parameters.
398  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
399  }
400  else
401  {
402  // if current PHY devices do not support data rate of the tx profile
403  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
404  {
405  if ( !((*i)->IsModeSupported (txInfo.dataRate)))
406  {
407  return false;
408  }
409  }
410  WifiTxVector txVector;
411  txVector.SetChannelWidth (10);
412  txVector.SetTxPowerLevel (txInfo.txPowerLevel);
413  txVector.SetMode (txInfo.dataRate);
414  txVector.SetPreambleType (txInfo.preamble);
415  HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, false);
416  packet->AddPacketTag (tag);
417  }
418 
419  LlcSnapHeader llc;
420  llc.SetType (protocol);
421  packet->AddHeader (llc);
422 
423  // according to channel number and priority,
424  // route the packet to a proper queue.
425  SocketPriorityTag prio;
426  prio.SetPriority (txInfo.priority);
427  packet->ReplacePacketTag (prio);
429  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
430  mac->NotifyTx (packet);
431  mac->Enqueue (packet, realTo);
432  return true;
433 }
434 
435 void
437 {
438  NS_LOG_FUNCTION (this << newAddress);
439  Address oldAddress = GetAddress ();
440  if (newAddress == oldAddress)
441  {
442  return;
443  }
444  SetAddress (newAddress);
445  // Since MAC address is changed, the MAC layer including multiple MAC entities should be reset
446  // and internal MAC queues will be flushed.
447  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
448  {
449  i->second->Reset ();
450  }
451  m_addressChange (oldAddress, newAddress);
452 }
453 
454 void
455 WaveNetDevice::CancelTx (uint32_t channelNumber, enum AcIndex ac)
456 {
457  if (IsAvailableChannel (channelNumber))
458  {
459  return;
460  }
461  Ptr<OcbWifiMac> mac = GetMac (channelNumber);
462  mac->CancleTx (ac);
463 }
464 
465 void
467 {
468  m_channelManager = channelManager;
469 }
472 {
473  return m_channelManager;
474 }
475 void
477 {
478  m_channelScheduler = channelScheduler;
479 }
482 {
483  return m_channelScheduler;
484 }
485 void
487 {
488  m_channelCoordinator = channelCoordinator;
489 }
492 {
493  return m_channelCoordinator;
494 }
495 void
497 {
498  m_vsaManager = vsaManager;
499 }
502 {
503  return m_vsaManager;
504 }
505 
506 void
507 WaveNetDevice::SetIfIndex (const uint32_t index)
508 {
509  m_ifIndex = index;
510 }
511 uint32_t
513 {
514  return m_ifIndex;
515 }
518 {
519  NS_ASSERT (!m_phyEntities.empty ());
520  return GetPhy (0)->GetChannel ();
521 }
522 void
524 {
525  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
526  {
527  i->second->SetAddress (Mac48Address::ConvertFrom (address));
528  }
529 }
530 Address
532 {
533  return (GetMac (CCH))->GetAddress ();
534 }
535 bool
536 WaveNetDevice::SetMtu (const uint16_t mtu)
537 {
539  {
540  return false;
541  }
542  m_mtu = mtu;
543  return true;
544 }
545 uint16_t
547 {
548  return m_mtu;
549 }
550 bool
552 {
553  // Different from WifiNetDevice::IsLinkUp, a WaveNetDevice device
554  // is always link up so the m_linkup variable is true forever.
555  // Even the device is in channel switch state, packets can still be queued.
556  return true;
557 }
558 void
560 {
561  NS_LOG_WARN ("WaveNetDevice is linkup forever, so this callback will be never called");
562 }
563 bool
565 {
566  return true;
567 }
568 Address
570 {
571  return Mac48Address::GetBroadcast ();
572 }
573 bool
575 {
576  return true;
577 }
578 Address
580 {
581  return Mac48Address::GetMulticast (multicastGroup);
582 }
584 {
585  return Mac48Address::GetMulticast (addr);
586 }
587 bool
589 {
590  return false;
591 }
592 bool
594 {
595  return false;
596 }
597 
598 bool
599 WaveNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocol)
600 {
601  NS_LOG_FUNCTION (this << packet << dest << protocol);
602  if (m_txProfile == 0)
603  {
604  NS_LOG_DEBUG ("there is no tx profile registered for transmission");
605  return false;
606  }
607  if (!m_channelScheduler->IsChannelAccessAssigned (m_txProfile->channelNumber))
608  {
609  NS_LOG_DEBUG ("there is no channel access assigned for channel " << m_txProfile->channelNumber);
610  return false;
611  }
613  {
614  // let MAC layer itself determine tx parameters.
615  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
616  }
617  else
618  {
619  WifiTxVector txVector;
621  txVector.SetMode (m_txProfile->dataRate);
624  packet->AddPacketTag (tag);
625  }
626 
627  LlcSnapHeader llc;
628  llc.SetType (protocol);
629  packet->AddHeader (llc);
630 
631  // qos tag is already inserted into the packet by high layer or with default value 7 if high layer forget it.
633  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
634  mac->NotifyTx (packet);
635  mac->Enqueue (packet, realTo);
636  return true;
637 }
638 
639 bool
641 {
642  // Whether NeedsArp or not?
643  // For IP-based packets , yes; For WSMP packets, no;
644  // so return true always.
645  return true;
646 }
647 void
649 {
650  m_forwardUp = cb;
651 }
652 
653 bool
654 WaveNetDevice::IsAvailableChannel (uint32_t channelNumber) const
655 {
656  if (!ChannelManager::IsWaveChannel (channelNumber))
657  {
658  NS_LOG_DEBUG ("this is no a valid WAVE channel for channel " << channelNumber);
659  return false;
660  }
661  if (m_macEntities.find (channelNumber) == m_macEntities.end ())
662  {
663  NS_LOG_DEBUG ("this is no available WAVE entity for channel " << channelNumber);
664  return false;
665  }
666  return true;
667 }
668 
669 void
671 {
672  NS_LOG_FUNCTION (this << packet << from << to);
673  Ptr<Packet> copy = packet->Copy ();
674  LlcSnapHeader llc;
675  copy->RemoveHeader (llc);
676  enum NetDevice::PacketType type;
677  if (to.IsBroadcast ())
678  {
680  }
681  else if (to.IsGroup ())
682  {
684  }
685  else if (to == GetAddress ())
686  {
687  type = NetDevice::PACKET_HOST;
688  }
689  else
690  {
692  }
693 
694  if (type != NetDevice::PACKET_OTHERHOST)
695  {
696  // currently we cannot know from which MAC entity the packet is received,
697  // so we use the MAC entity for CCH as it receives this packet.
699  mac->NotifyRx (copy);
700  m_forwardUp (this, copy, llc.GetType (), from);
701  }
702 
703  if (!m_promiscRx.IsNull ())
704  {
705  // currently we cannot know from which MAC entity the packet is received,
706  // so we use the MAC entity for CCH as it receives this packet.
708  mac->NotifyPromiscRx (copy);
709  m_promiscRx (this, copy, llc.GetType (), from, to, type);
710  }
711 }
712 
713 bool
714 WaveNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocol)
715 {
716  NS_LOG_FUNCTION (this << packet << source << dest << protocol);
717  return false;
718 }
719 
720 void
722 {
723  m_promiscRx = cb;
724  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
725  {
726  i->second->SetPromisc ();
727  }
728 }
729 
730 bool
732 {
733  return (GetMac (CCH))->SupportsSendFrom ();
734 }
735 
736 } // namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::NetDevice::PACKET_BROADCAST
@ PACKET_BROADCAST
Packet addressed to all.
Definition: net-device.h:300
ns3::VsaInfo
Definition: vsa-manager.h:63
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::Packet::ReplacePacketTag
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
Definition: packet.cc:970
ns3::TxProfile::preamble
WifiPreamble preamble
preamble
Definition: wave-net-device.h:118
ns3::WaveNetDevice::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: wave-net-device.cc:39
ns3::WaveNetDevice::m_promiscRx
NetDevice::PromiscReceiveCallback m_promiscRx
promiscious receive callback
Definition: wave-net-device.h:403
ns3::WaveNetDevice::DoInitialize
virtual void DoInitialize(void)
Initialize() implementation.
Definition: wave-net-device.cc:134
ns3::Object::Dispose
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
ns3::WifiTxVector::SetTxPowerLevel
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Definition: wifi-tx-vector.cc:242
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
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::WaveNetDevice::DeleteTxProfile
bool DeleteTxProfile(uint32_t channelNumber)
Definition: wave-net-device.cc:350
ns3::TxInfo::priority
uint32_t priority
priority
Definition: wave-net-device.h:66
ns3::Mac48Address::GetMulticast
static Mac48Address GetMulticast(Ipv4Address address)
Definition: mac48-address.cc:191
ns3::WaveNetDevice
This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStati...
Definition: wave-net-device.h:161
ns3::WaveNetDevice::IsLinkUp
virtual bool IsLinkUp(void) const
Definition: wave-net-device.cc:551
ns3::WaveNetDevice::SetChannelScheduler
void SetChannelScheduler(Ptr< ChannelScheduler > channelScheduler)
Definition: wave-net-device.cc:476
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::MakeObjectVectorAccessor
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-vector.h:81
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::WaveNetDevice::ChangeAddress
void ChangeAddress(Address newAddress)
Definition: wave-net-device.cc:436
ns3::Callback
Callback template class.
Definition: callback.h:1279
ns3::WifiNetDevice::GetPhy
Ptr< WifiPhy > GetPhy(void) const
Definition: wifi-net-device.cc:207
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
CCH
#define CCH
Definition: channel-manager.h:52
ns3::WaveNetDevice::m_macEntities
MacEntities m_macEntities
MAC entities.
Definition: wave-net-device.h:383
ns3::WaveNetDevice::IsAvailableChannel
bool IsAvailableChannel(uint32_t channelNumber) const
Definition: wave-net-device.cc:654
ns3::Callback::IsNull
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1386
ns3::WifiPhy::GetChannel
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
ns3::ChannelManager::IsWaveChannel
static bool IsWaveChannel(uint32_t channelNumber)
Definition: channel-manager.cc:123
ns3::MakeObjectMapAccessor
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
ns3::WaveNetDevice::SetMtu
virtual bool SetMtu(const uint16_t mtu)
Definition: wave-net-device.cc:536
ns3::HigherLayerTxVectorTag
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
Definition: higher-tx-tag.h:48
ns3::WaveNetDevice::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: wave-net-device.cc:98
ns3::WaveNetDevice::GetMtu
virtual uint16_t GetMtu(void) const
Definition: wave-net-device.cc:546
ns3::WaveNetDevice::GetMacs
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Definition: wave-net-device.cc:203
ns3::WaveNetDevice::m_vsaManager
Ptr< VsaManager > m_vsaManager
the VSA manager
Definition: wave-net-device.h:393
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::TxInfo::channelNumber
uint32_t channelNumber
channel number
Definition: wave-net-device.h:65
ns3::WaveNetDevice::PhyEntitiesI
std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
PhyEntities iterator typedef.
Definition: wave-net-device.h:387
ns3::WaveNetDevice::GetChannelManager
Ptr< ChannelManager > GetChannelManager(void) const
Definition: wave-net-device.cc:471
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::NetDevice::PACKET_HOST
@ PACKET_HOST
Packet addressed oo us.
Definition: net-device.h:298
ns3::VsaInfo::vsc
Ptr< Packet > vsc
VSC.
Definition: vsa-manager.h:67
wave-net-device.h
ns3::WaveNetDevice::SetWaveVsaCallback
void SetWaveVsaCallback(WaveVsaCallback vsaCallback)
Definition: wave-net-device.cc:276
ns3::PointerValue
Hold objects of type Ptr<T>.
Definition: pointer.h:37
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiTxVector::SetMode
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
Definition: wifi-tx-vector.cc:226
ns3::WaveNetDevice::GetChannel
virtual Ptr< Channel > GetChannel(void) const
Definition: wave-net-device.cc:517
ns3::ObjectPtrContainerValue
Container for a set of ns3::Object pointers.
Definition: object-ptr-container.h:46
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WaveNetDevice::SetIfIndex
virtual void SetIfIndex(const uint32_t index)
Definition: wave-net-device.cc:507
ns3::SchInfo
Definition: channel-scheduler.h:66
third.mac
mac
Definition: third.py:99
ns3::WaveNetDevice::m_mtu
uint16_t m_mtu
MTU.
Definition: wave-net-device.h:405
ns3::LlcSnapHeader::SetType
void SetType(uint16_t type)
Set the Ethertype.
Definition: llc-snap-header.cc:38
ns3::WaveNetDevice::GetChannelCoordinator
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
Definition: wave-net-device.cc:491
ns3::WaveNetDevice::m_channelCoordinator
Ptr< ChannelCoordinator > m_channelCoordinator
the channel coordinator
Definition: wave-net-device.h:392
ns3::WaveNetDevice::RegisterTxProfile
bool RegisterTxProfile(const TxProfile &txprofile)
Definition: wave-net-device.cc:305
ns3::TxInfo::dataRate
WifiMode dataRate
data rate
Definition: wave-net-device.h:67
ns3::WaveNetDevice::MAX_MSDU_SIZE
static const uint16_t MAX_MSDU_SIZE
This value conforms to the 802.11 specification.
Definition: wave-net-device.h:355
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::WaveNetDevice::IPv4_PROT_NUMBER
static const uint16_t IPv4_PROT_NUMBER
IP v4 Protocol number.
Definition: wave-net-device.h:358
ns3::WaveNetDevice::AddPhy
void AddPhy(Ptr< WifiPhy > phy)
Definition: wave-net-device.cc:210
ns3::SocketPriorityTag::SetPriority
void SetPriority(uint8_t priority)
Set the tag's priority.
Definition: socket.cc:842
ns3::Ptr< WifiPhy >
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::WaveNetDevice::GetBroadcast
virtual Address GetBroadcast(void) const
Definition: wave-net-device.cc:569
ns3::VsaInfo::managementId
uint8_t managementId
management ID
Definition: vsa-manager.h:66
ns3::NetDevice::PACKET_OTHERHOST
@ PACKET_OTHERHOST
Packet addressed to someone else.
Definition: net-device.h:304
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::WaveNetDevice::GetPhys
std::vector< Ptr< WifiPhy > > GetPhys(void) const
Definition: wave-net-device.cc:227
ns3::WaveNetDevice::SetReceiveCallback
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Definition: wave-net-device.cc:648
ns3::TxInfo::txPowerLevel
uint32_t txPowerLevel
transmit power level
Definition: wave-net-device.h:69
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::Mac48Address::ConvertFrom
static Mac48Address ConvertFrom(const Address &address)
Definition: mac48-address.cc:126
ns3::WaveNetDevice::m_ifIndex
uint32_t m_ifIndex
IF index.
Definition: wave-net-device.h:404
ns3::TxProfile::channelNumber
uint32_t channelNumber
channel number
Definition: wave-net-device.h:114
ns3::WaveNetDevice::AddLinkChangeCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
Definition: wave-net-device.cc:559
ns3::WaveNetDevice::GetChannelScheduler
Ptr< ChannelScheduler > GetChannelScheduler(void) const
Definition: wave-net-device.cc:481
ns3::Mac48Address::IsBroadcast
bool IsBroadcast(void) const
Definition: mac48-address.cc:158
ns3::WaveNetDevice::ForwardUp
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
Definition: wave-net-device.cc:670
ns3::WaveNetDevice::IsPointToPoint
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Definition: wave-net-device.cc:588
ns3::WaveNetDevice::m_addressChange
TracedCallback< Address, Address > m_addressChange
Definition: wave-net-device.h:399
ns3::TxProfile::dataRate
WifiMode dataRate
data rate
Definition: wave-net-device.h:117
ns3::Packet::RemoveHeader
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
ns3::WifiNetDevice::DoDispose
void DoDispose(void) override
Destructor implementation.
Definition: wifi-net-device.cc:102
ns3::WaveNetDevice::CancelTx
void CancelTx(uint32_t channelNumber, enum AcIndex ac)
Definition: wave-net-device.cc:455
ns3::TxProfile::adaptable
bool adaptable
adaptable
Definition: wave-net-device.h:115
first.address
address
Definition: first.py:44
ns3::WifiMode::GetUniqueName
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:122
ns3::TxProfile
Definition: wave-net-device.h:113
ns3::WaveNetDevice::m_channelManager
Ptr< ChannelManager > m_channelManager
the channel manager
Definition: wave-net-device.h:390
ns3::SchInfo::channelNumber
uint32_t channelNumber
channel number
Definition: channel-scheduler.h:67
ns3::WifiTxVector::SetChannelWidth
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
Definition: wifi-tx-vector.cc:254
ns3::WaveNetDevice::GetMulticast
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Definition: wave-net-device.cc:579
ns3::WaveNetDevice::StartVsa
bool StartVsa(const VsaInfo &vsaInfo)
Definition: wave-net-device.cc:234
ns3::WaveNetDevice::IPv6_PROT_NUMBER
static const uint16_t IPv6_PROT_NUMBER
IP v6 Protocol number.
Definition: wave-net-device.h:360
ns3::WifiRemoteStationManager::SetupPhy
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
Definition: wifi-remote-station-manager.cc:142
ns3::Object::DoInitialize
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
higher-tx-tag.h
ns3::WaveNetDevice::SetAddress
virtual void SetAddress(Address address)
Set the address of this interface.
Definition: wave-net-device.cc:523
ns3::TxInfo::preamble
WifiPreamble preamble
preamble
Definition: wave-net-device.h:68
ns3::VsaInfo::channelNumber
uint32_t channelNumber
channel number
Definition: vsa-manager.h:68
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
ns3::WaveNetDevice::SetChannelCoordinator
void SetChannelCoordinator(Ptr< ChannelCoordinator > channelCoordinator)
Definition: wave-net-device.cc:486
ns3::MakePointerAccessor
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: pointer.h:227
ns3::WaveNetDevice::m_phyEntities
PhyEntities m_phyEntities
Phy entities.
Definition: wave-net-device.h:388
ns3::WaveNetDevice::MacEntitiesI
std::map< uint32_t, Ptr< OcbWifiMac > >::const_iterator MacEntitiesI
MacEntities iterator typedef.
Definition: wave-net-device.h:382
ns3::WaveNetDevice::AddMac
void AddMac(uint32_t channelNumber, Ptr< OcbWifiMac > mac)
Definition: wave-net-device.cc:177
ns3::Packet::AddPacketTag
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:956
ns3::SocketPriorityTag
indicates whether the socket has a priority set.
Definition: socket.h:1309
ns3::WaveNetDevice::IsMulticast
virtual bool IsMulticast(void) const
Definition: wave-net-device.cc:574
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::VsaInfo::oi
OrganizationIdentifier oi
OI.
Definition: vsa-manager.h:65
ns3::WaveNetDevice::StartSch
bool StartSch(const SchInfo &schInfo)
Definition: wave-net-device.cc:283
ns3::WaveNetDevice::GetIfIndex
virtual uint32_t GetIfIndex(void) const
Definition: wave-net-device.cc:512
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::WaveNetDevice::m_channelScheduler
Ptr< ChannelScheduler > m_channelScheduler
the channel scheduler
Definition: wave-net-device.h:391
ns3::WaveNetDevice::WaveNetDevice
WaveNetDevice(void)
Definition: wave-net-device.cc:86
ns3::AcIndex
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:71
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::WaveNetDevice::GetVsaManager
Ptr< VsaManager > GetVsaManager(void) const
Definition: wave-net-device.cc:501
ns3::WaveNetDevice::Send
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Definition: wave-net-device.cc:599
ns3::OrganizationIdentifier::IsNull
bool IsNull(void) const
Definition: vendor-specific-action.cc:84
ns3::WaveNetDevice::IsBridge
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Definition: wave-net-device.cc:593
ns3::NetDevice::PacketType
PacketType
Packet types are used as they are in Linux.
Definition: net-device.h:297
ns3::WaveNetDevice::IsBroadcast
virtual bool IsBroadcast(void) const
Definition: wave-net-device.cc:564
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::LlcSnapHeader
Header for the LLC/SNAP encapsulation.
Definition: llc-snap-header.h:43
ns3::WaveNetDevice::~WaveNetDevice
virtual ~WaveNetDevice(void)
Definition: wave-net-device.cc:92
ns3::LLC_SNAP_HEADER_LENGTH
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octects of the LLC/SNAP header.
Definition: llc-snap-header.h:33
ns3::WaveNetDevice::SendFrom
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Definition: wave-net-device.cc:714
ns3::WaveNetDevice::StopVsa
bool StopVsa(uint32_t channelNumber)
Definition: wave-net-device.cc:264
ns3::WaveNetDevice::m_forwardUp
NetDevice::ReceiveCallback m_forwardUp
forward up receive callback
Definition: wave-net-device.h:402
ns3::WaveNetDevice::GetAddress
virtual Address GetAddress(void) const
Definition: wave-net-device.cc:531
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
ns3::WaveNetDevice::SupportsSendFrom
virtual bool SupportsSendFrom(void) const
Definition: wave-net-device.cc:731
ns3::Object::Initialize
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
ns3::LlcSnapHeader::GetType
uint16_t GetType(void)
Return the Ethertype.
Definition: llc-snap-header.cc:44
ns3::WaveNetDevice::SendX
bool SendX(Ptr< Packet > packet, const Address &dest, uint32_t protocol, const TxInfo &txInfo)
Definition: wave-net-device.cc:372
ns3::WaveNetDevice::SetVsaManager
void SetVsaManager(Ptr< VsaManager > vsaManager)
Definition: wave-net-device.cc:496
ns3::TxProfile::txPowerLevel
uint32_t txPowerLevel
transmit power level
Definition: wave-net-device.h:116
ns3::WifiTxVector::SetPreambleType
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Definition: wifi-tx-vector.cc:248
ns3::TxInfo
Definition: wave-net-device.h:64
ns3::WaveNetDevice::NeedsArp
virtual bool NeedsArp(void) const
Definition: wave-net-device.cc:640
ns3::WaveNetDevice::SetPromiscReceiveCallback
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
Definition: wave-net-device.cc:721
ns3::WaveNetDevice::StopSch
bool StopSch(uint32_t channelNumber)
Definition: wave-net-device.cc:294
third.phy
phy
Definition: third.py:93
ns3::WaveNetDevice::m_txProfile
TxProfile * m_txProfile
transmit profile
Definition: wave-net-device.h:394
ns3::NetDevice
Network layer to device interface.
Definition: net-device.h:96
ns3::WifiNetDevice::GetMac
Ptr< WifiMac > GetMac(void) const
Definition: wifi-net-device.cc:201
ns3::WaveNetDevice::SetChannelManager
void SetChannelManager(Ptr< ChannelManager > channelManager)
Definition: wave-net-device.cc:466
ns3::NetDevice::PACKET_MULTICAST
@ PACKET_MULTICAST
Packet addressed to multicast group.
Definition: net-device.h:302