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/wifi-channel.h"
22 #include "ns3/llc-snap-header.h"
23 #include "ns3/uinteger.h"
24 #include "ns3/node.h"
25 #include "ns3/trace-source-accessor.h"
26 #include "ns3/log.h"
27 #include "ns3/qos-tag.h"
28 #include "ns3/object-map.h"
29 #include "ns3/object-vector.h"
30 #include "wave-net-device.h"
31 #include "higher-tx-tag.h"
32 
33 namespace ns3 {
34 
35 NS_LOG_COMPONENT_DEFINE ("WaveNetDevice");
36 
37 NS_OBJECT_ENSURE_REGISTERED (WaveNetDevice);
38 
39 TypeId
41 {
42  static TypeId tid = TypeId ("ns3::WaveNetDevice")
43  .SetParent<NetDevice> ()
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<WifiChannel> ())
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;
116  stationManager->Dispose ();
117  mac->Dispose ();
118  }
119  m_macEntities.clear ();
121  m_channelManager->Dispose ();
122  m_channelScheduler->Dispose ();
123  m_vsaManager->Dispose ();
125  m_channelManager = 0;
126  m_channelScheduler = 0;
127  m_vsaManager = 0;
128  // chain up.
130 }
131 
132 void
134 {
135  NS_LOG_FUNCTION (this);
136  if (m_phyEntities.size () == 0)
137  {
138  NS_FATAL_ERROR ("there is no PHY entity in this WAVE device");
139  }
140  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
141  {
142  Ptr<WifiPhy> phy = (*i);
143  phy->Initialize ();
144  }
145  if (m_macEntities.size () == 0)
146  {
147  NS_FATAL_ERROR ("there is no MAC entity in this WAVE device");
148  }
149  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
150  {
151  Ptr<OcbWifiMac> mac = i->second;
153  // Make each MAC entity in sleep mode.
154  mac->Suspend ();
155  mac->Initialize ();
156 
158  // Currently PHY is not attached to MAC and will be dynamically attached and unattached to MAC latter,
159  // however WifiRemoteStationManager in the MAC shall know something in the PHY such as supported data rates.
160  // Since these information can be treated as same when same PHY devices are added, here we force
161  // all of WifiRemoteStationManagers in multiple MAC entities only associate with single PHY device even there may
162  // be multiple PHY entities. This approach may be strange but can work fine.
163  stationManager->SetupPhy (m_phyEntities[0]);
164  stationManager->Initialize ();
165  }
166  m_channelScheduler->SetWaveNetDevice (this);
167  m_vsaManager->SetWaveNetDevice (this);
168  m_channelScheduler->Initialize ();
170  m_channelManager->Initialize ();
171  m_vsaManager->Initialize ();
173 }
174 
175 void
176 WaveNetDevice::AddMac (uint32_t channelNumber, Ptr<OcbWifiMac> mac)
177 {
178  NS_LOG_FUNCTION (this << channelNumber << mac);
179  if (!ChannelManager::IsWaveChannel (channelNumber))
180  {
181  NS_FATAL_ERROR ("The channel " << channelNumber << " is not a valid WAVE channel number");
182  }
183  if (m_macEntities.find (channelNumber) != m_macEntities.end ())
184  {
185  NS_FATAL_ERROR ("The MAC entity for channel " << channelNumber << " already exists.");
186  }
187  m_macEntities.insert (std::make_pair (channelNumber, mac));
188 }
190 WaveNetDevice::GetMac (uint32_t channelNumber) const
191 {
192  NS_LOG_FUNCTION (this << channelNumber);
193  MacEntitiesI i = m_macEntities.find (channelNumber);
194  if (i == m_macEntities.end ())
195  {
196  NS_FATAL_ERROR ("there is no available MAC entity for channel " << channelNumber);
197  }
198  return i->second;
199 }
200 
201 std::map<uint32_t, Ptr<OcbWifiMac> >
203 {
204  NS_LOG_FUNCTION (this);
205  return m_macEntities;
206 }
207 
208 void
210 {
211  NS_LOG_FUNCTION (this << phy);
212  if (std::find (m_phyEntities.begin (), m_phyEntities.end (), phy) != m_phyEntities.end ())
213  {
214  NS_FATAL_ERROR ("This PHY entity is already inserted");
215  }
216  m_phyEntities.push_back (phy);
217 }
219 WaveNetDevice::GetPhy (uint32_t index) const
220 {
221  NS_LOG_FUNCTION (this << index);
222  return m_phyEntities.at (index);
223 }
224 
225 std::vector<Ptr<WifiPhy> >
227 {
228  NS_LOG_FUNCTION (this);
229  return m_phyEntities;
230 }
231 
232 bool
234 {
235  NS_LOG_FUNCTION (this << &vsaInfo);
236  if (!IsAvailableChannel ( vsaInfo.channelNumber))
237  {
238  return false;
239  }
240  if (!m_channelScheduler->IsChannelAccessAssigned (vsaInfo.channelNumber))
241  {
242  NS_LOG_DEBUG ("there is no channel access assigned for channel " << vsaInfo.channelNumber);
243  return false;
244  }
245  if (vsaInfo.vsc == 0)
246  {
247  NS_LOG_DEBUG ("vendor specific information shall not be null");
248  return false;
249  }
250  if (vsaInfo.oi.IsNull () && vsaInfo.managementId >= 16)
251  {
252  NS_LOG_DEBUG ("when organization identifier is not set, management ID "
253  "shall be in range from 0 to 15");
254  return false;
255  }
256 
257  m_vsaManager->SendVsa (vsaInfo);
258  return true;
259 }
260 
261 
262 bool
263 WaveNetDevice::StopVsa (uint32_t channelNumber)
264 {
265  NS_LOG_FUNCTION (this << channelNumber);
266  if (!IsAvailableChannel (channelNumber))
267  {
268  return false;
269  }
270  m_vsaManager->RemoveByChannel (channelNumber);
271  return true;
272 }
273 
274 void
276 {
277  NS_LOG_FUNCTION (this);
278  m_vsaManager->SetWaveVsaCallback (vsaCallback);
279 }
280 
281 bool
283 {
284  NS_LOG_FUNCTION (this << &schInfo);
285  if (!IsAvailableChannel (schInfo.channelNumber))
286  {
287  return false;
288  }
289  return m_channelScheduler->StartSch (schInfo);
290 }
291 
292 bool
293 WaveNetDevice::StopSch (uint32_t channelNumber)
294 {
295  NS_LOG_FUNCTION (this << channelNumber);
296  if (!IsAvailableChannel (channelNumber))
297  {
298  return false;
299  }
300  return m_channelScheduler->StopSch (channelNumber);
301 }
302 
303 bool
305 {
306  NS_LOG_FUNCTION (this << &txprofile);
307  if (m_txProfile != 0)
308  {
309  return false;
310  }
311  if (!IsAvailableChannel (txprofile.channelNumber))
312  {
313  return false;
314  }
315  if (txprofile.txPowerLevel > 8)
316  {
317  return false;
318  }
319  // IP-based packets is not allowed to send in the CCH.
320  if (txprofile.channelNumber == CCH)
321  {
322  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
323  return false;
324  }
325  if (txprofile.dataRate == WifiMode () || txprofile.txPowerLevel == 8)
326  {
327  // let MAC layer itself determine tx parameters.
328  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
329  }
330  else
331  {
332  // if current PHY devices do not support data rate of the tx profile
333  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
334  {
335  if (!((*i)->IsModeSupported (txprofile.dataRate)))
336  {
337  NS_LOG_DEBUG ("This data rate " << txprofile.dataRate.GetUniqueName () << " is not supported by current PHY device");
338  return false;
339  }
340  }
341  }
342 
343  m_txProfile = new TxProfile ();
344  *m_txProfile = txprofile;
345  return true;
346 }
347 
348 bool
349 WaveNetDevice::DeleteTxProfile (uint32_t channelNumber)
350 {
351  NS_LOG_FUNCTION (this << channelNumber);
352  if (!IsAvailableChannel (channelNumber))
353  {
354  return false;
355  }
356  if (m_txProfile == 0)
357  {
358  return false;
359  }
360  if (m_txProfile->channelNumber != channelNumber)
361  {
362  return false;
363  }
364 
365  delete m_txProfile;
366  m_txProfile = 0;
367  return true;
368 }
369 
370 bool
371 WaveNetDevice::SendX (Ptr<Packet> packet, const Address & dest, uint32_t protocol, const TxInfo & txInfo)
372 {
373  NS_LOG_FUNCTION (this << packet << dest << protocol << &txInfo);
374  if (!IsAvailableChannel (txInfo.channelNumber))
375  {
376  return false;
377  }
378  if (!m_channelScheduler->IsChannelAccessAssigned (txInfo.channelNumber))
379  {
380  NS_LOG_DEBUG ("there is no channel access assigned for channel " << txInfo.channelNumber);
381  return false;
382  }
383  if ((txInfo.channelNumber == CCH) && (protocol == IPv4_PROT_NUMBER || protocol == IPv6_PROT_NUMBER))
384  {
385  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
386  return false;
387  }
388  if ((txInfo.priority > 7) || txInfo.txPowerLevel > 8)
389  {
390  NS_LOG_DEBUG ("invalid transmit parameters.");
391  return false;
392  }
393 
394  if ((txInfo.dataRate == WifiMode ()) || (txInfo.txPowerLevel == 8))
395  {
396  // let MAC layer itself determine tx parameters.
397  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
398  }
399  else
400  {
401  // if current PHY devices do not support data rate of the tx profile
402  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
403  {
404  if ( !((*i)->IsModeSupported (txInfo.dataRate)))
405  {
406  return false;
407  }
408  }
409  WifiTxVector txVector;
410  txVector.SetTxPowerLevel (txInfo.txPowerLevel);
411  txVector.SetMode (txInfo.dataRate);
412  HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, false);
413  packet->AddPacketTag (tag);
414  }
415 
416  LlcSnapHeader llc;
417  llc.SetType (protocol);
418  packet->AddHeader (llc);
419 
420  // according to channel number and priority,
421  // route the packet to a proper queue.
422  QosTag qos = QosTag (txInfo.priority);
423  packet->AddPacketTag (qos);
424  Ptr<WifiMac> mac = GetMac (txInfo.channelNumber);
425  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
426  mac->NotifyTx (packet);
427  mac->Enqueue (packet, realTo);
428  return true;
429 }
430 
431 void
433 {
434  NS_LOG_FUNCTION (this << newAddress);
435  Address oldAddress = GetAddress ();
436  if (newAddress == oldAddress)
437  {
438  return;
439  }
440  SetAddress (newAddress);
441  // Since MAC address is changed, the MAC layer including multiple MAC entities should be reset
442  // and internal MAC queues will be flushed.
443  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
444  {
445  i->second->Reset ();
446  }
447  m_addressChange (oldAddress, newAddress);
448 }
449 
450 void
451 WaveNetDevice::CancelTx (uint32_t channelNumber, enum AcIndex ac)
452 {
453  if (IsAvailableChannel (channelNumber))
454  {
455  return;
456  }
457  Ptr<OcbWifiMac> mac = GetMac (channelNumber);
458  mac->CancleTx (ac);
459 }
460 
461 void
463 {
464  m_channelManager = channelManager;
465 }
468 {
469  return m_channelManager;
470 }
471 void
473 {
474  m_channelScheduler = channelScheduler;
475 }
478 {
479  return m_channelScheduler;
480 }
481 void
483 {
484  m_channelCoordinator = channelCoordinator;
485 }
488 {
489  return m_channelCoordinator;
490 }
491 void
493 {
494  m_vsaManager = vsaManager;
495 }
498 {
499  return m_vsaManager;
500 }
501 
502 void
503 WaveNetDevice::SetIfIndex (const uint32_t index)
504 {
505  m_ifIndex = index;
506 }
507 uint32_t
509 {
510  return m_ifIndex;
511 }
514 {
515  NS_ASSERT (!m_phyEntities.empty ());
516  return GetPhy (0)->GetChannel ();
517 }
518 void
520 {
521  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
522  {
523  i->second->SetAddress (Mac48Address::ConvertFrom (address));
524  }
525 }
526 Address
528 {
529  return (GetMac (CCH))->GetAddress ();
530 }
531 bool
532 WaveNetDevice::SetMtu (const uint16_t mtu)
533 {
535  {
536  return false;
537  }
538  m_mtu = mtu;
539  return true;
540 }
541 uint16_t
543 {
544  return m_mtu;
545 }
546 bool
548 {
549  // Different from WifiNetDevice::IsLinkUp, a WaveNetDevice device
550  // is always link up so the m_linkup variable is true forever.
551  // Even the device is in channel switch state, packets can still be queued.
552  return true;
553 }
554 void
556 {
557  NS_LOG_WARN ("WaveNetDevice is linkup forever, so this callback will be never called");
558 }
559 bool
561 {
562  return true;
563 }
564 Address
566 {
567  return Mac48Address::GetBroadcast ();
568 }
569 bool
571 {
572  return true;
573 }
574 Address
576 {
577  return Mac48Address::GetMulticast (multicastGroup);
578 }
580 {
581  return Mac48Address::GetMulticast (addr);
582 }
583 bool
585 {
586  return false;
587 }
588 bool
590 {
591  return false;
592 }
593 
594 bool
595 WaveNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocol)
596 {
597  NS_LOG_FUNCTION (this << packet << dest << protocol);
598  if (m_txProfile == 0)
599  {
600  NS_LOG_DEBUG ("there is no tx profile registered for transmission");
601  return false;
602  }
603  if (!m_channelScheduler->IsChannelAccessAssigned (m_txProfile->channelNumber))
604  {
605  NS_LOG_DEBUG ("there is no channel access assigned for channel " << m_txProfile->channelNumber);
606  return false;
607  }
609  {
610  // let MAC layer itself determine tx parameters.
611  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
612  }
613  else
614  {
615  WifiTxVector txVector;
617  txVector.SetMode (m_txProfile->dataRate);
619  packet->AddPacketTag (tag);
620  }
621 
622  LlcSnapHeader llc;
623  llc.SetType (protocol);
624  packet->AddHeader (llc);
625 
626  // qos tag is already inserted into the packet by high layer or with default value 7 if high layer forget it.
628  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
629  mac->NotifyTx (packet);
630  mac->Enqueue (packet, realTo);
631  return true;
632 }
633 
634 Ptr<Node>
636 {
637  return m_node;
638 }
639 void
641 {
642  m_node = node;
643 }
644 bool
646 {
647  // Whether NeedsArp or not?
648  // For IP-based packets , yes; For WSMP packets, no;
649  // so return true always.
650  return true;
651 }
652 void
654 {
655  m_forwardUp = cb;
656 }
657 
658 bool
659 WaveNetDevice::IsAvailableChannel (uint32_t channelNumber) const
660 {
661  if (!ChannelManager::IsWaveChannel (channelNumber))
662  {
663  NS_LOG_DEBUG ("this is no a valid WAVE channel for channel " << channelNumber);
664  return false;
665  }
666  if (m_macEntities.find (channelNumber) == m_macEntities.end ())
667  {
668  NS_LOG_DEBUG ("this is no available WAVE entity for channel " << channelNumber);
669  return false;
670  }
671  return true;
672 }
673 
674 void
676 {
677  NS_LOG_FUNCTION (this << packet << from << to);
678  LlcSnapHeader llc;
679  packet->RemoveHeader (llc);
680  enum NetDevice::PacketType type;
681  if (to.IsBroadcast ())
682  {
684  }
685  else if (to.IsGroup ())
686  {
688  }
689  else if (to == GetAddress ())
690  {
691  type = NetDevice::PACKET_HOST;
692  }
693  else
694  {
696  }
697 
698  if (type != NetDevice::PACKET_OTHERHOST)
699  {
700  // currently we cannot know from which MAC entity the packet is received,
701  // so we use the MAC entity for CCH as it receives this packet.
702  Ptr<OcbWifiMac> mac = GetMac (CCH);
703  mac->NotifyRx (packet);
704  m_forwardUp (this, packet, llc.GetType (), from);
705  }
706 
707  if (!m_promiscRx.IsNull ())
708  {
709  // currently we cannot know from which MAC entity the packet is received,
710  // so we use the MAC entity for CCH as it receives this packet.
711  Ptr<OcbWifiMac> mac = GetMac (CCH);
712  mac->NotifyPromiscRx (packet);
713  m_promiscRx (this, packet, llc.GetType (), from, to, type);
714  }
715 }
716 
717 bool
718 WaveNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocol)
719 {
720  NS_LOG_FUNCTION (this << packet << source << dest << protocol);
721  return false;
722 }
723 
724 void
726 {
727  m_promiscRx = cb;
728  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
729  {
730  i->second->SetPromisc ();
731  }
732 }
733 
734 bool
736 {
737  return (GetMac (CCH))->SupportsSendFrom ();
738 }
739 
740 } // namespace ns3
virtual Address GetAddress(void) const
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:268
Ptr< WifiPhy > GetPhy(uint32_t index) const
bool StopVsa(uint32_t channelNumber)
virtual Ptr< WifiChannel > GetChannel(void) const =0
Return the WifiChannel this WifiPhy is connected to.
static const uint16_t IPv4_PROT_NUMBER
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Callback template class.
Definition: callback.h:978
bool StartSch(const SchInfo &schInfo)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetWaveVsaCallback(WaveVsaCallback vsaCallback)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
uint32_t priority
WifiMode dataRate
Ptr< ChannelCoordinator > m_channelCoordinator
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:836
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1072
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-vector.h:81
void CancleTx(enum AcIndex ac)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:61
PacketType
Packet types are used as they are in Linux.
Definition: net-device.h:272
bool SendX(Ptr< Packet > packet, const Address &dest, uint32_t protocol, const TxInfo &txInfo)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
virtual bool SupportsSendFrom(void) const
static bool IsWaveChannel(uint32_t channelNumber)
bool IsBroadcast(void) const
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
std::map< uint32_t, Ptr< OcbWifiMac > >::const_iterator MacEntitiesI
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:338
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
Packet addressed to multicast group.
Definition: net-device.h:278
void SetType(uint16_t type)
Set the Ethertype.
virtual void SetAddress(Address address)
Set the address of this interface.
Packet addressed oo us.
Definition: net-device.h:274
#define CCH
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:93
Ptr< VsaManager > GetVsaManager(void) const
uint32_t txPowerLevel
Ptr< Packet > vsc
Definition: vsa-manager.h:64
virtual bool NeedsArp(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission...
Definition: higher-tx-tag.h:45
uint32_t channelNumber
a polymophic address class
Definition: address.h:90
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
static const uint16_t IPv6_PROT_NUMBER
uint8_t managementId
Definition: vsa-manager.h:63
virtual void SetForwardUpCallback(ForwardUpCallback upCallback)
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:210
static Mac48Address GetMulticast(Ipv4Address address)
uint16_t GetType(void)
Return the Ethertype.
bool DeleteTxProfile(uint32_t channelNumber)
Ptr< ChannelManager > m_channelManager
virtual ~WaveNetDevice(void)
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetChannelScheduler(Ptr< ChannelScheduler > channelScheduler)
Ptr< ChannelScheduler > m_channelScheduler
void SetChannelManager(Ptr< ChannelManager > channelManager)
void ChangeAddress(Address newAddress)
void Suspend(void)
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity...
uint32_t channelNumber
NetDevice::ReceiveCallback m_forwardUp
virtual void DoDispose(void)
Destructor implementation.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:97
static Mac48Address GetBroadcast(void)
Ptr< VsaManager > m_vsaManager
void NotifyPromiscRx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:268
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1290
The aim of the QosTag is to provide means for an Application to specify the TID which will be used by...
Definition: qos-tag.h:61
uint32_t txPowerLevel
static Mac48Address ConvertFrom(const Address &address)
virtual void SetIfIndex(const uint32_t index)
bool StopSch(uint32_t channelNumber)
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octects of the LLC/SNAP header.
virtual uint16_t GetMtu(void) const
TxProfile * m_txProfile
bool IsAvailableChannel(uint32_t channelNumber) const
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
Definition: pointer.h:36
uint32_t channelNumber
Definition: vsa-manager.h:65
bool IsGroup(void) const
Packet addressed to someone else.
Definition: net-device.h:280
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
uint32_t channelNumber
virtual Address GetBroadcast(void) const
an EUI-48 address
Definition: mac48-address.h:43
static const uint16_t MAX_MSDU_SIZE
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
virtual bool IsMulticast(void) const
virtual Ptr< Channel > GetChannel(void) const
Ptr< ChannelManager > GetChannelManager(void) const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
virtual bool IsBroadcast(void) const
std::vector< Ptr< WifiPhy > > GetPhys(void) const
void NotifyRx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:262
void AddPhy(Ptr< WifiPhy > phy)
Describes an IPv6 address.
Definition: ipv6-address.h:47
bool StartVsa(const VsaInfo &vsaInfo)
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
virtual Ptr< Node > GetNode(void) const
TracedCallback< Address, Address > m_addressChange
virtual void AddLinkChangeCallback(Callback< void > callback)
Network layer to device interface.
Definition: net-device.h:75
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:228
static TypeId GetTypeId(void)
void SetVsaManager(Ptr< VsaManager > vsaManager)
NetDevice::PromiscReceiveCallback m_promiscRx
Packet addressed to all.
Definition: net-device.h:276
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
PhyEntities m_phyEntities
OrganizationIdentifier oi
Definition: vsa-manager.h:62
std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:182
void AddMac(uint32_t channelNumber, Ptr< OcbWifiMac > mac)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual bool SetMtu(const uint16_t mtu)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
MacEntities m_macEntities
tuple address
Definition: first.py:37
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Container for a set of ns3::Object pointers.
void SetChannelCoordinator(Ptr< ChannelCoordinator > channelCoordinator)
Ptr< ChannelScheduler > GetChannelScheduler(void) const
virtual uint32_t GetIfIndex(void) const
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
virtual bool IsLinkUp(void) const
a unique identifier for an interface.
Definition: type-id.h:51
TypeId SetParent(TypeId tid)
Definition: type-id.cc:631
void Dispose(void)
Dispose of this Object.
Definition: object.cc:207
bool RegisterTxProfile(const TxProfile &txprofile)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:35
void CancelTx(uint32_t channelNumber, enum AcIndex ac)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:253
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:345
Header for the LLC/SNAP encapsulation.
virtual void SetNode(Ptr< Node > node)