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  .SetGroupName ("Wave")
45  .AddConstructor<WaveNetDevice> ()
46  .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit",
50  MakeUintegerChecker<uint16_t> (1,MAX_MSDU_SIZE - LLC_SNAP_HEADER_LENGTH))
51  .AddAttribute ("Channel", "The channel attached to this device",
52  PointerValue (),
54  MakePointerChecker<WifiChannel> ())
55  .AddAttribute ("PhyEntities", "The PHY entities attached to this device.",
58  MakeObjectVectorChecker<WifiPhy> ())
59  .AddAttribute ("MacEntities", "The MAC layer attached to this device.",
60  ObjectMapValue (),
62  MakeObjectMapChecker<OcbWifiMac> ())
63  .AddAttribute ("ChannelScheduler", "The channel scheduler attached to this device.",
64  PointerValue (),
67  MakePointerChecker<ChannelScheduler> ())
68  .AddAttribute ("ChannelManager", "The channel manager attached to this device.",
69  PointerValue (),
72  MakePointerChecker<ChannelManager> ())
73  .AddAttribute ("ChannelCoordinator", "The channel coordinator attached to this device.",
74  PointerValue (),
77  MakePointerChecker<ChannelCoordinator> ())
78  .AddAttribute ("VsaManager", "The VSA manager attached to this device.",
79  PointerValue (),
82  MakePointerChecker<VsaManager> ())
83  ;
84  return tid;
85 }
86 
88  : m_txProfile (0)
89 {
90  NS_LOG_FUNCTION (this);
91 }
92 
94 {
95  NS_LOG_FUNCTION (this);
96 }
97 
98 void
100 {
101  NS_LOG_FUNCTION (this);
102  if (m_txProfile != 0)
103  {
104  delete m_txProfile;
105  m_txProfile = 0;
106  }
107  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
108  {
109  Ptr<WifiPhy> phy = (*i);
110  phy->Dispose ();
111  }
112  m_phyEntities.clear ();
113  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
114  {
115  Ptr<OcbWifiMac> mac = i->second;
117  stationManager->Dispose ();
118  mac->Dispose ();
119  }
120  m_macEntities.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;
154  // Make each MAC entity in sleep mode.
155  mac->Suspend ();
156  mac->Initialize ();
157 
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.SetTxPowerLevel (txInfo.txPowerLevel);
412  txVector.SetMode (txInfo.dataRate);
413  HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, false);
414  packet->AddPacketTag (tag);
415  }
416 
417  LlcSnapHeader llc;
418  llc.SetType (protocol);
419  packet->AddHeader (llc);
420 
421  // according to channel number and priority,
422  // route the packet to a proper queue.
423  QosTag qos = QosTag (txInfo.priority);
424  packet->AddPacketTag (qos);
425  Ptr<WifiMac> mac = GetMac (txInfo.channelNumber);
426  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
427  mac->NotifyTx (packet);
428  mac->Enqueue (packet, realTo);
429  return true;
430 }
431 
432 void
434 {
435  NS_LOG_FUNCTION (this << newAddress);
436  Address oldAddress = GetAddress ();
437  if (newAddress == oldAddress)
438  {
439  return;
440  }
441  SetAddress (newAddress);
442  // Since MAC address is changed, the MAC layer including multiple MAC entities should be reset
443  // and internal MAC queues will be flushed.
444  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
445  {
446  i->second->Reset ();
447  }
448  m_addressChange (oldAddress, newAddress);
449 }
450 
451 void
452 WaveNetDevice::CancelTx (uint32_t channelNumber, enum AcIndex ac)
453 {
454  if (IsAvailableChannel (channelNumber))
455  {
456  return;
457  }
458  Ptr<OcbWifiMac> mac = GetMac (channelNumber);
459  mac->CancleTx (ac);
460 }
461 
462 void
464 {
465  m_channelManager = channelManager;
466 }
469 {
470  return m_channelManager;
471 }
472 void
474 {
475  m_channelScheduler = channelScheduler;
476 }
479 {
480  return m_channelScheduler;
481 }
482 void
484 {
485  m_channelCoordinator = channelCoordinator;
486 }
489 {
490  return m_channelCoordinator;
491 }
492 void
494 {
495  m_vsaManager = vsaManager;
496 }
499 {
500  return m_vsaManager;
501 }
502 
503 void
504 WaveNetDevice::SetIfIndex (const uint32_t index)
505 {
506  m_ifIndex = index;
507 }
508 uint32_t
510 {
511  return m_ifIndex;
512 }
515 {
516  NS_ASSERT (!m_phyEntities.empty ());
517  return GetPhy (0)->GetChannel ();
518 }
519 void
521 {
522  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
523  {
524  i->second->SetAddress (Mac48Address::ConvertFrom (address));
525  }
526 }
527 Address
529 {
530  return (GetMac (CCH))->GetAddress ();
531 }
532 bool
533 WaveNetDevice::SetMtu (const uint16_t mtu)
534 {
536  {
537  return false;
538  }
539  m_mtu = mtu;
540  return true;
541 }
542 uint16_t
544 {
545  return m_mtu;
546 }
547 bool
549 {
550  // Different from WifiNetDevice::IsLinkUp, a WaveNetDevice device
551  // is always link up so the m_linkup variable is true forever.
552  // Even the device is in channel switch state, packets can still be queued.
553  return true;
554 }
555 void
557 {
558  NS_LOG_WARN ("WaveNetDevice is linkup forever, so this callback will be never called");
559 }
560 bool
562 {
563  return true;
564 }
565 Address
567 {
568  return Mac48Address::GetBroadcast ();
569 }
570 bool
572 {
573  return true;
574 }
575 Address
577 {
578  return Mac48Address::GetMulticast (multicastGroup);
579 }
581 {
582  return Mac48Address::GetMulticast (addr);
583 }
584 bool
586 {
587  return false;
588 }
589 bool
591 {
592  return false;
593 }
594 
595 bool
596 WaveNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocol)
597 {
598  NS_LOG_FUNCTION (this << packet << dest << protocol);
599  if (m_txProfile == 0)
600  {
601  NS_LOG_DEBUG ("there is no tx profile registered for transmission");
602  return false;
603  }
604  if (!m_channelScheduler->IsChannelAccessAssigned (m_txProfile->channelNumber))
605  {
606  NS_LOG_DEBUG ("there is no channel access assigned for channel " << m_txProfile->channelNumber);
607  return false;
608  }
610  {
611  // let MAC layer itself determine tx parameters.
612  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
613  }
614  else
615  {
616  WifiTxVector txVector;
618  txVector.SetMode (m_txProfile->dataRate);
620  packet->AddPacketTag (tag);
621  }
622 
623  LlcSnapHeader llc;
624  llc.SetType (protocol);
625  packet->AddHeader (llc);
626 
627  // qos tag is already inserted into the packet by high layer or with default value 7 if high layer forget it.
629  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
630  mac->NotifyTx (packet);
631  mac->Enqueue (packet, realTo);
632  return true;
633 }
634 
635 Ptr<Node>
637 {
638  return m_node;
639 }
640 void
642 {
643  m_node = node;
644 }
645 bool
647 {
648  // Whether NeedsArp or not?
649  // For IP-based packets , yes; For WSMP packets, no;
650  // so return true always.
651  return true;
652 }
653 void
655 {
656  m_forwardUp = cb;
657 }
658 
659 bool
660 WaveNetDevice::IsAvailableChannel (uint32_t channelNumber) const
661 {
662  if (!ChannelManager::IsWaveChannel (channelNumber))
663  {
664  NS_LOG_DEBUG ("this is no a valid WAVE channel for channel " << channelNumber);
665  return false;
666  }
667  if (m_macEntities.find (channelNumber) == m_macEntities.end ())
668  {
669  NS_LOG_DEBUG ("this is no available WAVE entity for channel " << channelNumber);
670  return false;
671  }
672  return true;
673 }
674 
675 void
677 {
678  NS_LOG_FUNCTION (this << packet << from << to);
679  LlcSnapHeader llc;
680  packet->RemoveHeader (llc);
681  enum NetDevice::PacketType type;
682  if (to.IsBroadcast ())
683  {
685  }
686  else if (to.IsGroup ())
687  {
689  }
690  else if (to == GetAddress ())
691  {
692  type = NetDevice::PACKET_HOST;
693  }
694  else
695  {
697  }
698 
699  if (type != NetDevice::PACKET_OTHERHOST)
700  {
701  // currently we cannot know from which MAC entity the packet is received,
702  // so we use the MAC entity for CCH as it receives this packet.
703  Ptr<OcbWifiMac> mac = GetMac (CCH);
704  mac->NotifyRx (packet);
705  m_forwardUp (this, packet, llc.GetType (), from);
706  }
707 
708  if (!m_promiscRx.IsNull ())
709  {
710  // currently we cannot know from which MAC entity the packet is received,
711  // so we use the MAC entity for CCH as it receives this packet.
712  Ptr<OcbWifiMac> mac = GetMac (CCH);
713  mac->NotifyPromiscRx (packet);
714  m_promiscRx (this, packet, llc.GetType (), from, to, type);
715  }
716 }
717 
718 bool
719 WaveNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocol)
720 {
721  NS_LOG_FUNCTION (this << packet << source << dest << protocol);
722  return false;
723 }
724 
725 void
727 {
728  m_promiscRx = cb;
729  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
730  {
731  i->second->SetPromisc ();
732  }
733 }
734 
735 bool
737 {
738  return (GetMac (CCH))->SupportsSendFrom ();
739 }
740 
741 } // 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:984
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:1078
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:67
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
This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStati...
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:339
#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
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
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:269
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1296
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:263
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:183
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:57
TypeId SetParent(TypeId tid)
Definition: type-id.cc:638
void Dispose(void)
Dispose of this Object.
Definition: object.cc:208
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:346
Header for the LLC/SNAP encapsulation.
virtual void SetNode(Ptr< Node > node)