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-phy.h"
22 #include "ns3/llc-snap-header.h"
23 #include "ns3/log.h"
24 #include "ns3/socket.h"
25 #include "ns3/object-map.h"
26 #include "ns3/object-vector.h"
27 #include "wave-net-device.h"
28 #include "higher-tx-tag.h"
29 
30 namespace ns3 {
31 
32 NS_LOG_COMPONENT_DEFINE ("WaveNetDevice");
33 
34 NS_OBJECT_ENSURE_REGISTERED (WaveNetDevice);
35 
36 TypeId
38 {
39  static TypeId tid = TypeId ("ns3::WaveNetDevice")
40  .SetParent<NetDevice> ()
41  .SetGroupName ("Wave")
42  .AddConstructor<WaveNetDevice> ()
43  .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit",
47  MakeUintegerChecker<uint16_t> (1,MAX_MSDU_SIZE - LLC_SNAP_HEADER_LENGTH))
48  .AddAttribute ("Channel", "The channel attached to this device",
49  PointerValue (),
51  MakePointerChecker<Channel> ())
52  .AddAttribute ("PhyEntities", "The PHY entities attached to this device.",
55  MakeObjectVectorChecker<WifiPhy> ())
56  .AddAttribute ("MacEntities", "The MAC layer attached to this device.",
57  ObjectMapValue (),
59  MakeObjectMapChecker<OcbWifiMac> ())
60  .AddAttribute ("ChannelScheduler", "The channel scheduler attached to this device.",
61  PointerValue (),
64  MakePointerChecker<ChannelScheduler> ())
65  .AddAttribute ("ChannelManager", "The channel manager attached to this device.",
66  PointerValue (),
69  MakePointerChecker<ChannelManager> ())
70  .AddAttribute ("ChannelCoordinator", "The channel coordinator attached to this device.",
71  PointerValue (),
74  MakePointerChecker<ChannelCoordinator> ())
75  .AddAttribute ("VsaManager", "The VSA manager attached to this device.",
76  PointerValue (),
79  MakePointerChecker<VsaManager> ())
80  ;
81  return tid;
82 }
83 
85  : m_txProfile (0)
86 {
87  NS_LOG_FUNCTION (this);
88 }
89 
91 {
92  NS_LOG_FUNCTION (this);
93 }
94 
95 void
97 {
98  NS_LOG_FUNCTION (this);
99  if (m_txProfile != 0)
100  {
101  delete m_txProfile;
102  m_txProfile = 0;
103  }
104  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
105  {
106  Ptr<WifiPhy> phy = (*i);
107  phy->Dispose ();
108  }
109  m_phyEntities.clear ();
110  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
111  {
112  Ptr<OcbWifiMac> mac = i->second;
114  stationManager->Dispose ();
115  mac->Dispose ();
116  }
117  m_macEntities.clear ();
119  m_channelManager->Dispose ();
120  m_channelScheduler->Dispose ();
121  m_vsaManager->Dispose ();
123  m_channelManager = 0;
124  m_channelScheduler = 0;
125  m_vsaManager = 0;
126  // chain up.
128 }
129 
130 void
132 {
133  NS_LOG_FUNCTION (this);
134  if (m_phyEntities.size () == 0)
135  {
136  NS_FATAL_ERROR ("there is no PHY entity in this WAVE device");
137  }
138  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
139  {
140  Ptr<WifiPhy> phy = (*i);
141  phy->Initialize ();
142  }
143  if (m_macEntities.size () == 0)
144  {
145  NS_FATAL_ERROR ("there is no MAC entity in this WAVE device");
146  }
147  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
148  {
149  Ptr<OcbWifiMac> mac = i->second;
151  // Make each MAC entity in sleep mode.
152  mac->Suspend ();
153  mac->Initialize ();
154 
156  // Currently PHY is not attached to MAC and will be dynamically attached and unattached to MAC latter,
157  // however WifiRemoteStationManager in the MAC shall know something in the PHY such as supported data rates.
158  // Since these information can be treated as same when same PHY devices are added, here we force
159  // all of WifiRemoteStationManagers in multiple MAC entities only associate with single PHY device even there may
160  // be multiple PHY entities. This approach may be strange but can work fine.
161  stationManager->SetupPhy (m_phyEntities[0]);
162  stationManager->Initialize ();
163  }
164  m_channelScheduler->SetWaveNetDevice (this);
165  m_vsaManager->SetWaveNetDevice (this);
166  m_channelScheduler->Initialize ();
168  m_channelManager->Initialize ();
169  m_vsaManager->Initialize ();
171 }
172 
173 void
174 WaveNetDevice::AddMac (uint32_t channelNumber, Ptr<OcbWifiMac> mac)
175 {
176  NS_LOG_FUNCTION (this << channelNumber << mac);
177  if (!ChannelManager::IsWaveChannel (channelNumber))
178  {
179  NS_FATAL_ERROR ("The channel " << channelNumber << " is not a valid WAVE channel number");
180  }
181  if (m_macEntities.find (channelNumber) != m_macEntities.end ())
182  {
183  NS_FATAL_ERROR ("The MAC entity for channel " << channelNumber << " already exists.");
184  }
185  m_macEntities.insert (std::make_pair (channelNumber, mac));
186 }
188 WaveNetDevice::GetMac (uint32_t channelNumber) const
189 {
190  NS_LOG_FUNCTION (this << channelNumber);
191  MacEntitiesI i = m_macEntities.find (channelNumber);
192  if (i == m_macEntities.end ())
193  {
194  NS_FATAL_ERROR ("there is no available MAC entity for channel " << channelNumber);
195  }
196  return i->second;
197 }
198 
199 std::map<uint32_t, Ptr<OcbWifiMac> >
201 {
202  NS_LOG_FUNCTION (this);
203  return m_macEntities;
204 }
205 
206 void
208 {
209  NS_LOG_FUNCTION (this << phy);
210  if (std::find (m_phyEntities.begin (), m_phyEntities.end (), phy) != m_phyEntities.end ())
211  {
212  NS_FATAL_ERROR ("This PHY entity is already inserted");
213  }
214  m_phyEntities.push_back (phy);
215 }
217 WaveNetDevice::GetPhy (uint32_t index) const
218 {
219  NS_LOG_FUNCTION (this << index);
220  return m_phyEntities.at (index);
221 }
222 
223 std::vector<Ptr<WifiPhy> >
225 {
226  NS_LOG_FUNCTION (this);
227  return m_phyEntities;
228 }
229 
230 bool
232 {
233  NS_LOG_FUNCTION (this << &vsaInfo);
234  if (!IsAvailableChannel ( vsaInfo.channelNumber))
235  {
236  return false;
237  }
238  if (!m_channelScheduler->IsChannelAccessAssigned (vsaInfo.channelNumber))
239  {
240  NS_LOG_DEBUG ("there is no channel access assigned for channel " << vsaInfo.channelNumber);
241  return false;
242  }
243  if (vsaInfo.vsc == 0)
244  {
245  NS_LOG_DEBUG ("vendor specific information shall not be null");
246  return false;
247  }
248  if (vsaInfo.oi.IsNull () && vsaInfo.managementId >= 16)
249  {
250  NS_LOG_DEBUG ("when organization identifier is not set, management ID "
251  "shall be in range from 0 to 15");
252  return false;
253  }
254 
255  m_vsaManager->SendVsa (vsaInfo);
256  return true;
257 }
258 
259 
260 bool
261 WaveNetDevice::StopVsa (uint32_t channelNumber)
262 {
263  NS_LOG_FUNCTION (this << channelNumber);
264  if (!IsAvailableChannel (channelNumber))
265  {
266  return false;
267  }
268  m_vsaManager->RemoveByChannel (channelNumber);
269  return true;
270 }
271 
272 void
274 {
275  NS_LOG_FUNCTION (this);
276  m_vsaManager->SetWaveVsaCallback (vsaCallback);
277 }
278 
279 bool
281 {
282  NS_LOG_FUNCTION (this << &schInfo);
283  if (!IsAvailableChannel (schInfo.channelNumber))
284  {
285  return false;
286  }
287  return m_channelScheduler->StartSch (schInfo);
288 }
289 
290 bool
291 WaveNetDevice::StopSch (uint32_t channelNumber)
292 {
293  NS_LOG_FUNCTION (this << channelNumber);
294  if (!IsAvailableChannel (channelNumber))
295  {
296  return false;
297  }
298  return m_channelScheduler->StopSch (channelNumber);
299 }
300 
301 bool
303 {
304  NS_LOG_FUNCTION (this << &txprofile);
305  if (m_txProfile != 0)
306  {
307  return false;
308  }
309  if (!IsAvailableChannel (txprofile.channelNumber))
310  {
311  return false;
312  }
313  if (txprofile.txPowerLevel > 8)
314  {
315  return false;
316  }
317  // IP-based packets is not allowed to send in the CCH.
318  if (txprofile.channelNumber == CCH)
319  {
320  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
321  return false;
322  }
323  if (txprofile.dataRate == WifiMode () || txprofile.txPowerLevel == 8)
324  {
325  // let MAC layer itself determine tx parameters.
326  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
327  }
328  else
329  {
330  // if current PHY devices do not support data rate of the tx profile
331  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
332  {
333  if (!((*i)->IsModeSupported (txprofile.dataRate)))
334  {
335  NS_LOG_DEBUG ("This data rate " << txprofile.dataRate.GetUniqueName () << " is not supported by current PHY device");
336  return false;
337  }
338  }
339  }
340 
341  m_txProfile = new TxProfile ();
342  *m_txProfile = txprofile;
343  return true;
344 }
345 
346 bool
347 WaveNetDevice::DeleteTxProfile (uint32_t channelNumber)
348 {
349  NS_LOG_FUNCTION (this << channelNumber);
350  if (!IsAvailableChannel (channelNumber))
351  {
352  return false;
353  }
354  if (m_txProfile == 0)
355  {
356  return false;
357  }
358  if (m_txProfile->channelNumber != channelNumber)
359  {
360  return false;
361  }
362 
363  delete m_txProfile;
364  m_txProfile = 0;
365  return true;
366 }
367 
368 bool
369 WaveNetDevice::SendX (Ptr<Packet> packet, const Address & dest, uint32_t protocol, const TxInfo & txInfo)
370 {
371  NS_LOG_FUNCTION (this << packet << dest << protocol << &txInfo);
372  if (!IsAvailableChannel (txInfo.channelNumber))
373  {
374  return false;
375  }
376  if (!m_channelScheduler->IsChannelAccessAssigned (txInfo.channelNumber))
377  {
378  NS_LOG_DEBUG ("there is no channel access assigned for channel " << txInfo.channelNumber);
379  return false;
380  }
381  if ((txInfo.channelNumber == CCH) && (protocol == IPv4_PROT_NUMBER || protocol == IPv6_PROT_NUMBER))
382  {
383  NS_LOG_DEBUG ("IP-based packets shall not be transmitted on the CCH");
384  return false;
385  }
386  if ((txInfo.priority > 7) || txInfo.txPowerLevel > 8)
387  {
388  NS_LOG_DEBUG ("invalid transmit parameters.");
389  return false;
390  }
391 
392  if ((txInfo.dataRate == WifiMode ()) || (txInfo.txPowerLevel == 8))
393  {
394  // let MAC layer itself determine tx parameters.
395  NS_LOG_DEBUG ("High layer does not want to control tx parameters.");
396  }
397  else
398  {
399  // if current PHY devices do not support data rate of the tx profile
400  for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); ++i)
401  {
402  if ( !((*i)->IsModeSupported (txInfo.dataRate)))
403  {
404  return false;
405  }
406  }
407  WifiTxVector txVector;
408  txVector.SetChannelWidth (10);
409  txVector.SetTxPowerLevel (txInfo.txPowerLevel);
410  txVector.SetMode (txInfo.dataRate);
411  txVector.SetPreambleType (txInfo.preamble);
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  SocketPriorityTag prio;
423  prio.SetPriority (txInfo.priority);
424  packet->ReplacePacketTag (prio);
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);
621  packet->AddPacketTag (tag);
622  }
623 
624  LlcSnapHeader llc;
625  llc.SetType (protocol);
626  packet->AddHeader (llc);
627 
628  // qos tag is already inserted into the packet by high layer or with default value 7 if high layer forget it.
630  Mac48Address realTo = Mac48Address::ConvertFrom (dest);
631  mac->NotifyTx (packet);
632  mac->Enqueue (packet, realTo);
633  return true;
634 }
635 
636 Ptr<Node>
638 {
639  return m_node;
640 }
641 void
643 {
644  m_node = node;
645 }
646 bool
648 {
649  // Whether NeedsArp or not?
650  // For IP-based packets , yes; For WSMP packets, no;
651  // so return true always.
652  return true;
653 }
654 void
656 {
657  m_forwardUp = cb;
658 }
659 
660 bool
661 WaveNetDevice::IsAvailableChannel (uint32_t channelNumber) const
662 {
663  if (!ChannelManager::IsWaveChannel (channelNumber))
664  {
665  NS_LOG_DEBUG ("this is no a valid WAVE channel for channel " << channelNumber);
666  return false;
667  }
668  if (m_macEntities.find (channelNumber) == m_macEntities.end ())
669  {
670  NS_LOG_DEBUG ("this is no available WAVE entity for channel " << channelNumber);
671  return false;
672  }
673  return true;
674 }
675 
676 void
678 {
679  NS_LOG_FUNCTION (this << packet << from << to);
680  LlcSnapHeader llc;
681  packet->RemoveHeader (llc);
682  enum NetDevice::PacketType type;
683  if (to.IsBroadcast ())
684  {
686  }
687  else if (to.IsGroup ())
688  {
690  }
691  else if (to == GetAddress ())
692  {
693  type = NetDevice::PACKET_HOST;
694  }
695  else
696  {
698  }
699 
700  if (type != NetDevice::PACKET_OTHERHOST)
701  {
702  // currently we cannot know from which MAC entity the packet is received,
703  // so we use the MAC entity for CCH as it receives this packet.
705  mac->NotifyRx (packet);
706  m_forwardUp (this, packet, llc.GetType (), from);
707  }
708 
709  if (!m_promiscRx.IsNull ())
710  {
711  // currently we cannot know from which MAC entity the packet is received,
712  // so we use the MAC entity for CCH as it receives this packet.
714  mac->NotifyPromiscRx (packet);
715  m_promiscRx (this, packet, llc.GetType (), from, to, type);
716  }
717 }
718 
719 bool
720 WaveNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocol)
721 {
722  NS_LOG_FUNCTION (this << packet << source << dest << protocol);
723  return false;
724 }
725 
726 void
728 {
729  m_promiscRx = cb;
730  for (MacEntitiesI i = m_macEntities.begin (); i != m_macEntities.end (); ++i)
731  {
732  i->second->SetPromisc ();
733  }
734 }
735 
736 bool
738 {
739  return (GetMac (CCH))->SupportsSendFrom ();
740 }
741 
742 } // namespace ns3
virtual Address GetAddress(void) const
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
Ptr< WifiPhy > GetPhy(uint32_t index) const
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
bool StopVsa(uint32_t channelNumber)
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
uint32_t m_ifIndex
IF index.
static const uint16_t IPv4_PROT_NUMBER
IP v4 Protocol 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:1176
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:45
WifiMode dataRate
data rate
uint32_t priority
priority
WifiMode dataRate
data rate
Ptr< ChannelCoordinator > m_channelCoordinator
the channel coordinator
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:852
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1270
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:296
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
MacEntities iterator typedef.
This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStati...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
Packet addressed to multicast group.
Definition: net-device.h:302
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
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:298
#define CCH
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
Ptr< VsaManager > GetVsaManager(void) const
uint32_t txPowerLevel
transmit power level
Ptr< Packet > vsc
VSC.
Definition: vsa-manager.h:67
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:47
uint32_t channelNumber
channel number
a polymophic address class
Definition: address.h:90
Ptr< Node > m_node
the node
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
static const uint16_t IPv6_PROT_NUMBER
IP v6 Protocol number.
uint8_t managementId
management ID
Definition: vsa-manager.h:66
void SetForwardUpCallback(ForwardUpCallback upCallback)
tuple phy
Definition: third.py:86
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:220
static Mac48Address GetMulticast(Ipv4Address address)
uint16_t GetType(void)
Return the Ethertype.
bool DeleteTxProfile(uint32_t channelNumber)
Ptr< ChannelManager > m_channelManager
the channel manager
virtual ~WaveNetDevice(void)
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetChannelScheduler(Ptr< ChannelScheduler > channelScheduler)
Ptr< ChannelScheduler > m_channelScheduler
the channel scheduler
uint16_t m_mtu
MTU.
void SetChannelManager(Ptr< ChannelManager > channelManager)
void ChangeAddress(Address newAddress)
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
Definition: packet.cc:866
WifiPreamble preamble
preamble
indicates whether the socket has a priority set.
Definition: socket.h:1303
void Suspend(void)
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity...
uint32_t channelNumber
channel number
NetDevice::ReceiveCallback m_forwardUp
forward up receive callback
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:450
static Mac48Address GetBroadcast(void)
Ptr< VsaManager > m_vsaManager
the VSA manager
void NotifyPromiscRx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:277
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
tuple mac
Definition: third.py:92
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...
uint32_t txPowerLevel
transmit power level
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
transmit profile
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
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
uint32_t channelNumber
channel number
Definition: vsa-manager.h:68
bool IsGroup(void) const
Packet addressed to someone else.
Definition: net-device.h:304
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
uint32_t channelNumber
channel number
virtual Address GetBroadcast(void) const
an EUI-48 address
Definition: mac48-address.h:43
static const uint16_t MAX_MSDU_SIZE
This value conforms to the 802.11 specification.
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
bool adaptable
adaptable
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:271
void AddPhy(Ptr< WifiPhy > phy)
Describes an IPv6 address.
Definition: ipv6-address.h:49
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:95
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
static TypeId GetTypeId(void)
Get the type ID.
void SetVsaManager(Ptr< VsaManager > vsaManager)
NetDevice::PromiscReceiveCallback m_promiscRx
promiscious receive callback
Packet addressed to all.
Definition: net-device.h:300
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:269
PhyEntities m_phyEntities
Phy entities.
OrganizationIdentifier oi
OI.
Definition: vsa-manager.h:65
std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
PhyEntities iterator typedef.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
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)
void SetChannelWidth(uint8_t channelWidth)
Sets the selected channelWidth (in MHz)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Definition: object-map.h:80
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
MacEntities m_macEntities
MAC entities.
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
void SetPriority(uint8_t priority)
Set the tag's priority.
Definition: socket.cc:848
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:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:914
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:38
void CancelTx(uint32_t channelNumber, enum AcIndex ac)
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
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:256
WifiPreamble preamble
preamble
Header for the LLC/SNAP encapsulation.
virtual void SetNode(Ptr< Node > node)