A Discrete-Event Network Simulator
API
ns3::WaveNetDevice Class Reference

This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStationManager). More...

#include "wave-net-device.h"

+ Inheritance diagram for ns3::WaveNetDevice:
+ Collaboration diagram for ns3::WaveNetDevice:

Public Types

typedef Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > WaveVsaCallback
 
- Public Types inherited from ns3::NetDevice
typedef void(* LinkChangeTracedCallback) ()
 TracedCallback signature for link changed event. More...
 
enum  PacketType {
  PACKET_HOST = 1 , NS3_PACKET_HOST = PACKET_HOST , PACKET_BROADCAST , NS3_PACKET_BROADCAST = PACKET_BROADCAST ,
  PACKET_MULTICAST , NS3_PACKET_MULTICAST = PACKET_MULTICAST , PACKET_OTHERHOST , NS3_PACKET_OTHERHOST = PACKET_OTHERHOST
}
 Packet types are used as they are in Linux. More...
 
typedef Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, enum PacketTypePromiscReceiveCallback
 
typedef Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
 

Public Member Functions

 WaveNetDevice ()
 
 ~WaveNetDevice () override
 
void AddLinkChangeCallback (Callback< void > callback) override
 
void AddMac (uint32_t channelNumber, Ptr< OcbWifiMac > mac)
 
void AddPhy (Ptr< WifiPhy > phy)
 
void CancelTx (uint32_t channelNumber, AcIndex ac)
 
void ChangeAddress (Address newAddress)
 
bool DeleteTxProfile (uint32_t channelNumber)
 
Address GetAddress () const override
 
Address GetBroadcast () const override
 
Ptr< ChannelGetChannel () const override
 
Ptr< ChannelCoordinatorGetChannelCoordinator () const
 
Ptr< ChannelManagerGetChannelManager () const
 
Ptr< ChannelSchedulerGetChannelScheduler () const
 
uint32_t GetIfIndex () const override
 
Ptr< OcbWifiMacGetMac (uint32_t channelNumber) const
 
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs () const
 
uint16_t GetMtu () const override
 
Address GetMulticast (Ipv4Address multicastGroup) const override
 Make and return a MAC multicast address using the provided multicast group. More...
 
Address GetMulticast (Ipv6Address addr) const override
 Get the MAC multicast address corresponding to the IPv6 address provided. More...
 
Ptr< WifiPhyGetPhy (uint8_t index) const override
 
const std::vector< Ptr< WifiPhy > > & GetPhys () const override
 
Ptr< VsaManagerGetVsaManager () const
 
bool IsBridge () const override
 Return true if the net device is acting as a bridge. More...
 
bool IsBroadcast () const override
 
bool IsLinkUp () const override
 
bool IsMulticast () const override
 
bool IsPointToPoint () const override
 Return true if the net device is on a point-to-point link. More...
 
bool NeedsArp () const override
 
bool RegisterTxProfile (const TxProfile &txprofile)
 
bool Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
 
bool SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
 
bool SendX (Ptr< Packet > packet, const Address &dest, uint32_t protocol, const TxInfo &txInfo)
 
void SetAddress (Address address) override
 Set the address of this interface. More...
 
void SetChannelCoordinator (Ptr< ChannelCoordinator > channelCoordinator)
 
void SetChannelManager (Ptr< ChannelManager > channelManager)
 
void SetChannelScheduler (Ptr< ChannelScheduler > channelScheduler)
 
void SetIfIndex (const uint32_t index) override
 
bool SetMtu (const uint16_t mtu) override
 
void SetPromiscReceiveCallback (PromiscReceiveCallback cb) override
 
void SetReceiveCallback (NetDevice::ReceiveCallback cb) override
 
void SetVsaManager (Ptr< VsaManager > vsaManager)
 
void SetWaveVsaCallback (WaveVsaCallback vsaCallback)
 
bool StartSch (const SchInfo &schInfo)
 
bool StartVsa (const VsaInfo &vsaInfo)
 
bool StopSch (uint32_t channelNumber)
 
bool StopVsa (uint32_t channelNumber)
 
bool SupportsSendFrom () const override
 
- Public Member Functions inherited from ns3::WifiNetDevice
 WifiNetDevice ()
 
 WifiNetDevice (const WifiNetDevice &o)=delete
 
 ~WifiNetDevice () override
 
void AddLinkChangeCallback (Callback< void > callback) override
 
Address GetAddress () const override
 
Address GetBroadcast () const override
 
Ptr< ChannelGetChannel () const override
 
Ptr< EhtConfigurationGetEhtConfiguration () const
 
Ptr< HeConfigurationGetHeConfiguration () const
 
Ptr< HtConfigurationGetHtConfiguration () const
 
uint32_t GetIfIndex () const override
 
Ptr< WifiMacGetMac () const
 
uint16_t GetMtu () const override
 
Address GetMulticast (Ipv4Address multicastGroup) const override
 Make and return a MAC multicast address using the provided multicast group. More...
 
Address GetMulticast (Ipv6Address addr) const override
 Get the MAC multicast address corresponding to the IPv6 address provided. More...
 
Ptr< NodeGetNode () const override
 
uint8_t GetNPhys () const
 
uint8_t GetNRemoteStationManagers () const
 
Ptr< WifiPhyGetPhy () const
 
Ptr< WifiRemoteStationManagerGetRemoteStationManager () const
 
Ptr< WifiRemoteStationManagerGetRemoteStationManager (uint8_t linkId) const
 
virtual const std::vector< Ptr< WifiRemoteStationManager > > & GetRemoteStationManagers () const
 
WifiStandard GetStandard () const
 Get the Wifi standard. More...
 
Ptr< VhtConfigurationGetVhtConfiguration () const
 
bool IsBridge () const override
 Return true if the net device is acting as a bridge. More...
 
bool IsBroadcast () const override
 
bool IsLinkUp () const override
 
bool IsMulticast () const override
 
bool IsPointToPoint () const override
 Return true if the net device is on a point-to-point link. More...
 
bool NeedsArp () const override
 
WifiNetDeviceoperator= (const WifiNetDevice &)=delete
 
bool Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
 
bool SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
 
void SetAddress (Address address) override
 Set the address of this interface. More...
 
void SetEhtConfiguration (Ptr< EhtConfiguration > ehtConfiguration)
 
void SetHeConfiguration (Ptr< HeConfiguration > heConfiguration)
 
void SetHtConfiguration (Ptr< HtConfiguration > htConfiguration)
 
void SetIfIndex (const uint32_t index) override
 
void SetMac (const Ptr< WifiMac > mac)
 
bool SetMtu (const uint16_t mtu) override
 
void SetNode (const Ptr< Node > node) override
 
void SetPhy (const Ptr< WifiPhy > phy)
 
void SetPhys (const std::vector< Ptr< WifiPhy >> &phys)
 
void SetPromiscReceiveCallback (PromiscReceiveCallback cb) override
 
void SetReceiveCallback (NetDevice::ReceiveCallback cb) override
 
void SetRemoteStationManager (const Ptr< WifiRemoteStationManager > manager)
 
void SetRemoteStationManagers (const std::vector< Ptr< WifiRemoteStationManager >> &managers)
 
void SetStandard (WifiStandard standard)
 Set the Wifi standard. More...
 
void SetVhtConfiguration (Ptr< VhtConfiguration > vhtConfiguration)
 
bool SupportsSendFrom () const override
 
- Public Member Functions inherited from ns3::NetDevice
 ~NetDevice () override
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::WifiNetDevice
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::NetDevice
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Types

typedef std::map< uint32_t, Ptr< OcbWifiMac > > MacEntities
 MacEntities typedef. More...
 
typedef std::map< uint32_t, Ptr< OcbWifiMac > >::const_iterator MacEntitiesI
 MacEntities iterator typedef. More...
 
typedef std::vector< Ptr< WifiPhy > > PhyEntities
 PhyEntities typedef. More...
 
typedef std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
 PhyEntities iterator typedef. More...
 

Private Member Functions

void DoDispose () override
 Destructor implementation. More...
 
void DoInitialize () override
 Initialize() implementation. More...
 
void ForwardUp (Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
 Receive a packet from the lower layer and pass the packet up the stack. More...
 
bool IsAvailableChannel (uint32_t channelNumber) const
 

Private Attributes

TracedCallback< Address, Addressm_addressChange
 
Ptr< ChannelCoordinatorm_channelCoordinator
 the channel coordinator More...
 
Ptr< ChannelManagerm_channelManager
 the channel manager More...
 
Ptr< ChannelSchedulerm_channelScheduler
 the channel scheduler More...
 
NetDevice::ReceiveCallback m_forwardUp
 forward up receive callback More...
 
uint32_t m_ifIndex
 IF index. More...
 
MacEntities m_macEntities
 MAC entities. More...
 
uint16_t m_mtu
 MTU. More...
 
PhyEntities m_phyEntities
 Phy entities. More...
 
NetDevice::PromiscReceiveCallback m_promiscRx
 promiscious receive callback More...
 
TxProfilem_txProfile
 transmit profile More...
 
Ptr< VsaManagerm_vsaManager
 the VSA manager More...
 

Static Private Attributes

static const uint16_t IPv4_PROT_NUMBER = 0x0800
 IP v4 Protocol number. More...
 
static const uint16_t IPv6_PROT_NUMBER = 0x86DD
 IP v6 Protocol number. More...
 
static const uint16_t MAX_MSDU_SIZE = 2304
 This value conforms to the 802.11 specification. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::WifiNetDevice
void DoDispose () override
 Destructor implementation. More...
 
void DoInitialize () override
 Initialize() implementation. More...
 
void ForwardUp (Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
 Receive a packet from the lower layer and pass the packet up the stack. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStationManager).

Besides that, to support multiple channel operation this class also holds ns3::ChannelScheduler, ns3::ChannelManager, ns3::ChannelCoordinator and ns3::VsaManager.

these primitives specified in the standard will not be implemented because of limited use in simulation: void StartTimingAdvertisement (); void StopTimingAdvertisement (); UtcTime GetUtcTime (); void SetUtcTime ();

Config Paths

ns3::WaveNetDevice is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice"

Attributes

No TraceSources are defined for this type.
Size of this type is 400 bytes (on a 64-bit architecture).

Definition at line 168 of file wave-net-device.h.

Member Typedef Documentation

◆ MacEntities

typedef std::map<uint32_t, Ptr<OcbWifiMac> > ns3::WaveNetDevice::MacEntities
private

MacEntities typedef.

Definition at line 391 of file wave-net-device.h.

◆ MacEntitiesI

typedef std::map<uint32_t, Ptr<OcbWifiMac> >::const_iterator ns3::WaveNetDevice::MacEntitiesI
private

MacEntities iterator typedef.

Definition at line 393 of file wave-net-device.h.

◆ PhyEntities

typedef std::vector<Ptr<WifiPhy> > ns3::WaveNetDevice::PhyEntities
private

PhyEntities typedef.

Definition at line 396 of file wave-net-device.h.

◆ PhyEntitiesI

typedef std::vector<Ptr<WifiPhy> >::const_iterator ns3::WaveNetDevice::PhyEntitiesI
private

PhyEntities iterator typedef.

Definition at line 398 of file wave-net-device.h.

◆ WaveVsaCallback

typedef Callback<bool, Ptr<const Packet>, const Address&, uint32_t, uint32_t> ns3::WaveNetDevice::WaveVsaCallback
Parameters
packetthe packet is Vendor Specific Action frame.
addressthe address of the MAC from which the management frame was received.
managementIDidentify the originator of the data. Values are specified in IEEE P1609.0 with range 0-15.
channelNumberthe channel on which the frame was received.
Returns
true if the callback could handle the packet successfully, false otherwise.

Definition at line 271 of file wave-net-device.h.

Constructor & Destructor Documentation

◆ WaveNetDevice()

ns3::WaveNetDevice::WaveNetDevice ( )

Definition at line 96 of file wave-net-device.cc.

References NS_LOG_FUNCTION.

◆ ~WaveNetDevice()

ns3::WaveNetDevice::~WaveNetDevice ( )
override

Definition at line 102 of file wave-net-device.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddLinkChangeCallback()

void ns3::WaveNetDevice::AddLinkChangeCallback ( Callback< void >  callback)
overridevirtual
Parameters
callbackthe callback to invoke

Add a callback invoked whenever the link status changes to UP. This callback is typically used by the IP/ARP layer to flush the ARP cache and by IPv6 stack to flush NDISC cache whenever the link goes up.

Implements ns3::NetDevice.

Definition at line 591 of file wave-net-device.cc.

References NS_LOG_WARN.

◆ AddMac()

void ns3::WaveNetDevice::AddMac ( uint32_t  channelNumber,
Ptr< OcbWifiMac mac 
)
Parameters
channelNumberthe specific channel
macadd a new available MAC entity for specific channel

Definition at line 188 of file wave-net-device.cc.

References ns3::ChannelManager::IsWaveChannel(), m_macEntities, third::mac, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ns3::WaveHelper::Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddPhy()

void ns3::WaveNetDevice::AddPhy ( Ptr< WifiPhy phy)
Parameters
phyadd a new available PHY entity

Definition at line 222 of file wave-net-device.cc.

References m_phyEntities, NS_FATAL_ERROR, NS_LOG_FUNCTION, and third::phy.

Referenced by ns3::WaveHelper::Install().

+ Here is the caller graph for this function:

◆ CancelTx()

void ns3::WaveNetDevice::CancelTx ( uint32_t  channelNumber,
AcIndex  ac 
)
Parameters
channelNumberthe specific channel number
acthe specific access category

Cancel all transmissions with the particular category and channel number.

Definition at line 472 of file wave-net-device.cc.

References ns3::WifiNetDevice::GetMac(), IsAvailableChannel(), and third::mac.

+ Here is the call graph for this function:

◆ ChangeAddress()

void ns3::WaveNetDevice::ChangeAddress ( Address  newAddress)
Parameters
newAddressan immediate MAC-layer address change is required

This method is similar with SetAddress method, but SetAddress is suggested for initializing a device, while this method is preferred for changing address and a addressChange TracedCallback will be called.

Definition at line 453 of file wave-net-device.cc.

References GetAddress(), m_addressChange, m_macEntities, NS_LOG_FUNCTION, and SetAddress().

+ Here is the call graph for this function:

◆ DeleteTxProfile()

bool ns3::WaveNetDevice::DeleteTxProfile ( uint32_t  channelNumber)
Parameters
channelNumberthe specific channel number delete a registered transmitter profile in the MLME after the associated IP-based data transfer is complete
Returns
whether the tx profile is unregistered successfully

Definition at line 363 of file wave-net-device.cc.

References ns3::TxProfile::channelNumber, IsAvailableChannel(), m_txProfile, and NS_LOG_FUNCTION.

Referenced by WaveNetDeviceExample::SendIpExample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::WaveNetDevice::DoDispose ( )
overrideprivatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 108 of file wave-net-device.cc.

References ns3::Object::Dispose(), ns3::WifiNetDevice::DoDispose(), m_channelCoordinator, m_channelManager, m_channelScheduler, m_macEntities, m_phyEntities, m_txProfile, m_vsaManager, third::mac, NS_LOG_FUNCTION, and third::phy.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::WaveNetDevice::DoInitialize ( )
overrideprivatevirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 144 of file wave-net-device.cc.

References ns3::Object::DoInitialize(), ForwardUp(), ns3::Object::Initialize(), m_channelCoordinator, m_channelManager, m_channelScheduler, m_macEntities, m_phyEntities, m_vsaManager, third::mac, ns3::MakeCallback(), NS_FATAL_ERROR, NS_LOG_FUNCTION, third::phy, and ns3::WifiRemoteStationManager::SetupPhy().

+ Here is the call graph for this function:

◆ ForwardUp()

void ns3::WaveNetDevice::ForwardUp ( Ptr< const Packet packet,
Mac48Address  from,
Mac48Address  to 
)
private

◆ GetAddress()

Address ns3::WaveNetDevice::GetAddress ( ) const
overridevirtual
Returns
the current Address of this interface.

Implements ns3::NetDevice.

Definition at line 559 of file wave-net-device.cc.

References CCH, and ns3::WifiNetDevice::GetMac().

Referenced by ChangeAddress(), ForwardUp(), WaveNetDeviceExample::SendIpPacket(), and AnnexC_TestCase::SendPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBroadcast()

Address ns3::WaveNetDevice::GetBroadcast ( ) const
overridevirtual
Returns
the broadcast address supported by this netdevice.

Calling this method is invalid if IsBroadcast returns not true.

Implements ns3::NetDevice.

Definition at line 603 of file wave-net-device.cc.

References ns3::Mac48Address::GetBroadcast().

+ Here is the call graph for this function:

◆ GetChannel()

Ptr< Channel > ns3::WaveNetDevice::GetChannel ( ) const
overridevirtual
Returns
the channel this NetDevice is connected to. The value returned can be zero if the NetDevice is not yet connected to any channel or if the underlying NetDevice has no concept of a channel. i.e., callers must check for zero and be ready to handle it.

Implements ns3::NetDevice.

Definition at line 543 of file wave-net-device.cc.

References ns3::WifiPhy::GetChannel(), ns3::WifiNetDevice::GetPhy(), m_phyEntities, and NS_ASSERT.

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetChannelCoordinator()

Ptr< ChannelCoordinator > ns3::WaveNetDevice::GetChannelCoordinator ( ) const
Returns
current channel coordinator for multiple channel operation

Definition at line 513 of file wave-net-device.cc.

References m_channelCoordinator.

Referenced by ns3::VsaManager::DoSendVsa(), ns3::DefaultChannelScheduler::GetAssignedAccessType(), GetTypeId(), and ns3::WaveFrameExchangeManager::SetWaveNetDevice().

+ Here is the caller graph for this function:

◆ GetChannelManager()

Ptr< ChannelManager > ns3::WaveNetDevice::GetChannelManager ( ) const
Returns
currentc channel manager for multiple channel operation

Definition at line 489 of file wave-net-device.cc.

References m_channelManager.

Referenced by ns3::VsaManager::DoSendVsa(), and GetTypeId().

+ Here is the caller graph for this function:

◆ GetChannelScheduler()

Ptr< ChannelScheduler > ns3::WaveNetDevice::GetChannelScheduler ( ) const
Returns
current channel scheduler for multiple channel operation

Definition at line 501 of file wave-net-device.cc.

References m_channelScheduler.

Referenced by ns3::VsaManager::DoSendVsa(), GetTypeId(), ns3::WaveFrameExchangeManager::SetWaveNetDevice(), ChannelAccessTestCase::TestAlternatingAfter(), ChannelAccessTestCase::TestContinuousAfter(), and ChannelAccessTestCase::TestExtendedAfter().

+ Here is the caller graph for this function:

◆ GetIfIndex()

uint32_t ns3::WaveNetDevice::GetIfIndex ( ) const
overridevirtual
Returns
index ifIndex of the device

Implements ns3::NetDevice.

Definition at line 537 of file wave-net-device.cc.

References m_ifIndex.

◆ GetMac()

Ptr< OcbWifiMac > ns3::WaveNetDevice::GetMac ( uint32_t  channelNumber) const
Parameters
channelNumberthe specific channel number
Returns
corresponding MAC entity

Definition at line 203 of file wave-net-device.cc.

References m_macEntities, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ns3::DefaultChannelScheduler::AssignDefaultCchAccess(), ns3::VsaManager::DoSendVsa(), ns3::DefaultChannelScheduler::NotifyGuardSlotStart(), ns3::ChannelScheduler::StartSch(), and ns3::DefaultChannelScheduler::SwitchToNextChannel().

+ Here is the caller graph for this function:

◆ GetMacs()

std::map< uint32_t, Ptr< OcbWifiMac > > ns3::WaveNetDevice::GetMacs ( ) const
Returns
all inserted MAC entities.

Definition at line 215 of file wave-net-device.cc.

References m_macEntities, and NS_LOG_FUNCTION.

Referenced by ns3::WaveHelper::AssignStreams(), and ns3::VsaManager::DoInitialize().

+ Here is the caller graph for this function:

◆ GetMtu()

uint16_t ns3::WaveNetDevice::GetMtu ( ) const
overridevirtual
Returns
the link-level MTU in bytes for this interface.

This value is typically used by the IP layer to perform IP fragmentation when needed.

Implements ns3::NetDevice.

Definition at line 576 of file wave-net-device.cc.

References m_mtu.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetMulticast() [1/2]

Address ns3::WaveNetDevice::GetMulticast ( Ipv4Address  multicastGroup) const
overridevirtual

Make and return a MAC multicast address using the provided multicast group.

RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet multicast address by placing the low-order 23-bits of the IP address into the low-order 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex). Similar RFCs exist for Ipv6 and Eui64 mappings. This method performs the multicast address creation function appropriate to the underlying MAC address of the device. This MAC address is encapsulated in an abstract Address to avoid dependencies on the exact MAC address format.

In the case of net devices that do not support multicast, clients are expected to test NetDevice::IsMulticast and avoid attempting to map multicast packets. Subclasses of NetDevice that do support multicasting are expected to override this method and provide an implementation appropriate to the particular device.

Parameters
multicastGroupThe IP address for the multicast group destination of the packet.
Returns
The MAC multicast Address used to send packets to the provided multicast group.
Warning
Calling this method is invalid if IsMulticast returns not true.
See also
IsMulticast()

Implements ns3::NetDevice.

Definition at line 615 of file wave-net-device.cc.

References ns3::Mac48Address::GetMulticast().

+ Here is the call graph for this function:

◆ GetMulticast() [2/2]

Address ns3::WaveNetDevice::GetMulticast ( Ipv6Address  addr) const
overridevirtual

Get the MAC multicast address corresponding to the IPv6 address provided.

Parameters
addrIPv6 address
Returns
the MAC multicast address
Warning
Calling this method is invalid if IsMulticast returns not true.

Implements ns3::NetDevice.

Definition at line 621 of file wave-net-device.cc.

References ns3::Mac48Address::GetMulticast().

+ Here is the call graph for this function:

◆ GetPhy()

Ptr< WifiPhy > ns3::WaveNetDevice::GetPhy ( uint8_t  index) const
overridevirtual
Parameters
indexthe index of PHY entity
Returns
corresponding PHY entity

Reimplemented from ns3::WifiNetDevice.

Definition at line 233 of file wave-net-device.cc.

References m_phyEntities, and NS_LOG_FUNCTION.

Referenced by ns3::DefaultChannelScheduler::GetAssignedAccessType().

+ Here is the caller graph for this function:

◆ GetPhys()

const std::vector< Ptr< WifiPhy > > & ns3::WaveNetDevice::GetPhys ( ) const
overridevirtual
Returns
all inserted PHY entities.

Reimplemented from ns3::WifiNetDevice.

Definition at line 240 of file wave-net-device.cc.

References m_phyEntities, and NS_LOG_FUNCTION.

Referenced by ns3::WaveHelper::AssignStreams(), ns3::YansWavePhyHelper::EnablePcapInternal(), and ns3::DefaultChannelScheduler::GetAssignedAccessType().

+ Here is the caller graph for this function:

◆ GetTypeId()

◆ GetVsaManager()

Ptr< VsaManager > ns3::WaveNetDevice::GetVsaManager ( ) const
Returns
current VSA manager for multiple channel operation

Definition at line 525 of file wave-net-device.cc.

References m_vsaManager.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ IsAvailableChannel()

bool ns3::WaveNetDevice::IsAvailableChannel ( uint32_t  channelNumber) const
private
Parameters
channelNumberthe specific channel
Returns
whether this channel is valid and available for use

Definition at line 697 of file wave-net-device.cc.

References ns3::ChannelManager::IsWaveChannel(), m_macEntities, and NS_LOG_DEBUG.

Referenced by CancelTx(), DeleteTxProfile(), RegisterTxProfile(), SendX(), StartSch(), StartVsa(), StopSch(), and StopVsa().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsBridge()

bool ns3::WaveNetDevice::IsBridge ( ) const
overridevirtual

Return true if the net device is acting as a bridge.

Returns
value of m_isBridge flag

Implements ns3::NetDevice.

Definition at line 633 of file wave-net-device.cc.

◆ IsBroadcast()

bool ns3::WaveNetDevice::IsBroadcast ( ) const
overridevirtual
Returns
true if this interface supports a broadcast address, false otherwise.

Implements ns3::NetDevice.

Definition at line 597 of file wave-net-device.cc.

◆ IsLinkUp()

bool ns3::WaveNetDevice::IsLinkUp ( ) const
overridevirtual
Returns
true if link is up; false otherwise

Implements ns3::NetDevice.

Definition at line 582 of file wave-net-device.cc.

◆ IsMulticast()

bool ns3::WaveNetDevice::IsMulticast ( ) const
overridevirtual
Returns
value of m_isMulticast flag

Implements ns3::NetDevice.

Definition at line 609 of file wave-net-device.cc.

◆ IsPointToPoint()

bool ns3::WaveNetDevice::IsPointToPoint ( ) const
overridevirtual

Return true if the net device is on a point-to-point link.

Returns
value of m_isPointToPoint flag

Implements ns3::NetDevice.

Definition at line 627 of file wave-net-device.cc.

◆ NeedsArp()

bool ns3::WaveNetDevice::NeedsArp ( ) const
overridevirtual
Returns
true if ARP is needed, false otherwise.

Called by higher-layers to check if this NetDevice requires ARP to be used.

Implements ns3::NetDevice.

Definition at line 682 of file wave-net-device.cc.

◆ RegisterTxProfile()

bool ns3::WaveNetDevice::RegisterTxProfile ( const TxProfile txprofile)
Parameters
txprofiletransmit profile for IP-based data register a transmitter profile in the MLME before the associated IP-based data transfer starts.
Returns
whether the tx profile is registered successfully

note: This method should be called before WaveNetDevice::Send method

Definition at line 317 of file wave-net-device.cc.

References CCH, ns3::TxProfile::channelNumber, ns3::TxProfile::dataRate, ns3::WifiMode::GetUniqueName(), IsAvailableChannel(), m_phyEntities, m_txProfile, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::TxProfile::txPowerLevel.

Referenced by WaveNetDeviceExample::SendIpExample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Send()

bool ns3::WaveNetDevice::Send ( Ptr< Packet packet,
const Address dest,
uint16_t  protocolNumber 
)
overridevirtual
Parameters
packetpacket sent from above down to Network Device
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.
Returns
whether the Send operation succeeded

Normally this method is called by 1609.3 standard to send IP-based packets, however high layers can also send packets in other types except IP-based packets in CCH.

Implements ns3::NetDevice.

Definition at line 639 of file wave-net-device.cc.

References ns3::TxProfile::adaptable, ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::TxProfile::channelNumber, ns3::Mac48Address::ConvertFrom(), ns3::TxProfile::dataRate, ns3::WifiNetDevice::GetMac(), m_channelScheduler, m_txProfile, third::mac, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::TxProfile::preamble, ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetPreambleType(), ns3::WifiTxVector::SetTxPowerLevel(), ns3::LlcSnapHeader::SetType(), and ns3::TxProfile::txPowerLevel.

Referenced by ChannelRoutingTestCase::SendIp(), and WaveNetDeviceExample::SendIpPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendFrom()

bool ns3::WaveNetDevice::SendFrom ( Ptr< Packet packet,
const Address source,
const Address dest,
uint16_t  protocolNumber 
)
overridevirtual
Parameters
packetpacket sent from above down to Network Device
sourcesource mac address (so called "MAC spoofing")
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.

Called from higher layer to send packet into Network Device with the specified source and destination Addresses.

Returns
whether the Send operation succeeded

Implements ns3::NetDevice.

Definition at line 757 of file wave-net-device.cc.

References NS_LOG_FUNCTION.

◆ SendX()

bool ns3::WaveNetDevice::SendX ( Ptr< Packet packet,
const Address dest,
uint32_t  protocol,
const TxInfo txInfo 
)
Parameters
packetpacket sent from above down to Network Device
destmac address of the destination (already resolved)
protocolidentifies the type of payload contained in the packet. Used to call the right L3Protocol when the packet is received.
txInfoWSMP or other packets parameters for sending
Returns
whether the SendX operation succeeded

Normally this method is called by 1609.3 standard to send WSMP packets, however high layers can also send packets in other types except IP-based packets in CCH.

Definition at line 385 of file wave-net-device.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), CCH, ns3::TxInfo::channelNumber, ns3::Mac48Address::ConvertFrom(), ns3::TxInfo::dataRate, ns3::WifiNetDevice::GetMac(), IPv4_PROT_NUMBER, IPv6_PROT_NUMBER, IsAvailableChannel(), m_channelScheduler, m_phyEntities, third::mac, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::TxInfo::preamble, ns3::TxInfo::priority, ns3::Packet::ReplacePacketTag(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetPreambleType(), ns3::SocketPriorityTag::SetPriority(), ns3::WifiTxVector::SetTxPowerLevel(), ns3::LlcSnapHeader::SetType(), and ns3::TxInfo::txPowerLevel.

Referenced by WaveNetDeviceExample::SendOneWsmpPacket(), AnnexC_TestCase::SendPacket(), ChannelRoutingTestCase::SendWsmp(), and ChannelAccessTestCase::SendX().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAddress()

void ns3::WaveNetDevice::SetAddress ( Address  address)
overridevirtual

Set the address of this interface.

Parameters
addressaddress to set

Implements ns3::NetDevice.

Definition at line 550 of file wave-net-device.cc.

References first::address, ns3::Mac48Address::ConvertFrom(), and m_macEntities.

Referenced by ChangeAddress(), and ns3::WaveHelper::Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetChannelCoordinator()

void ns3::WaveNetDevice::SetChannelCoordinator ( Ptr< ChannelCoordinator channelCoordinator)
Parameters
channelCoordinatorthe channel coordinator for multiple channel operation

Definition at line 507 of file wave-net-device.cc.

References m_channelCoordinator.

Referenced by GetTypeId(), and ns3::WaveHelper::Install().

+ Here is the caller graph for this function:

◆ SetChannelManager()

void ns3::WaveNetDevice::SetChannelManager ( Ptr< ChannelManager channelManager)
Parameters
channelManagerthe channel manager for multiple channel operation

Definition at line 483 of file wave-net-device.cc.

References m_channelManager.

Referenced by GetTypeId(), and ns3::WaveHelper::Install().

+ Here is the caller graph for this function:

◆ SetChannelScheduler()

void ns3::WaveNetDevice::SetChannelScheduler ( Ptr< ChannelScheduler channelScheduler)
Parameters
channelSchedulerthe channel scheduler for multiple channel operation

Definition at line 495 of file wave-net-device.cc.

References m_channelScheduler.

Referenced by GetTypeId(), and ns3::WaveHelper::Install().

+ Here is the caller graph for this function:

◆ SetIfIndex()

void ns3::WaveNetDevice::SetIfIndex ( const uint32_t  index)
overridevirtual
Parameters
indexifIndex of the device

Implements ns3::NetDevice.

Definition at line 531 of file wave-net-device.cc.

References m_ifIndex.

◆ SetMtu()

bool ns3::WaveNetDevice::SetMtu ( const uint16_t  mtu)
overridevirtual
Parameters
mtuMTU value, in bytes, to set for the device
Returns
whether the MTU value was within legal bounds

Override for default MTU defined on a per-type basis.

Implements ns3::NetDevice.

Definition at line 565 of file wave-net-device.cc.

References ns3::LLC_SNAP_HEADER_LENGTH, m_mtu, and MAX_MSDU_SIZE.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetPromiscReceiveCallback()

void ns3::WaveNetDevice::SetPromiscReceiveCallback ( PromiscReceiveCallback  cb)
overridevirtual
Parameters
cbcallback to invoke whenever a packet has been received in promiscuous mode and must be forwarded to the higher layers.

Enables netdevice promiscuous mode and sets the callback that will handle promiscuous mode packets. Note, promiscuous mode packets means all packets, including those packets that can be sensed by the netdevice but which are intended to be received by other hosts.

Implements ns3::NetDevice.

Definition at line 767 of file wave-net-device.cc.

References m_macEntities, and m_promiscRx.

◆ SetReceiveCallback()

void ns3::WaveNetDevice::SetReceiveCallback ( NetDevice::ReceiveCallback  cb)
overridevirtual
Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Set the callback to be used to notify higher layers when a packet has been received.

Implements ns3::NetDevice.

Definition at line 691 of file wave-net-device.cc.

References m_forwardUp.

Referenced by WaveNetDeviceExample::CreateWaveNodes(), ChannelAccessTestCase::DoRun(), and AnnexC_TestCase::DoRun().

+ Here is the caller graph for this function:

◆ SetVsaManager()

void ns3::WaveNetDevice::SetVsaManager ( Ptr< VsaManager vsaManager)
Parameters
vsaManagerthe VSA manager for multiple channel operation

Definition at line 519 of file wave-net-device.cc.

References m_vsaManager.

Referenced by GetTypeId(), and ns3::WaveHelper::Install().

+ Here is the caller graph for this function:

◆ SetWaveVsaCallback()

void ns3::WaveNetDevice::SetWaveVsaCallback ( WaveVsaCallback  vsaCallback)
Parameters
vsaCallbackthe VSA receive callback for 1609 management information

Definition at line 288 of file wave-net-device.cc.

References m_vsaManager, and NS_LOG_FUNCTION.

Referenced by WaveNetDeviceExample::CreateWaveNodes().

+ Here is the caller graph for this function:

◆ StartSch()

bool ns3::WaveNetDevice::StartSch ( const SchInfo schInfo)
Parameters
schInfothe parameters about how to start SCH service
Returns
whether channel access is assigned successfully

Definition at line 295 of file wave-net-device.cc.

References ns3::SchInfo::channelNumber, IsAvailableChannel(), m_channelScheduler, and NS_LOG_FUNCTION.

Referenced by WaveNetDeviceExample::SendIpExample(), WaveNetDeviceExample::SendWsaExample(), WaveNetDeviceExample::SendWsmpExample(), ChannelAccessTestCase::TestAlternating(), ChannelAccessTestCase::TestContinuous(), and ChannelAccessTestCase::TestExtended().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartVsa()

bool ns3::WaveNetDevice::StartVsa ( const VsaInfo vsaInfo)
Parameters
vsaInfothe parameters about how to send VSA frame
Returns
whether the request for VSA transmission is completed

Definition at line 247 of file wave-net-device.cc.

References ns3::VsaInfo::channelNumber, IsAvailableChannel(), ns3::OrganizationIdentifier::IsNull(), m_channelScheduler, m_vsaManager, ns3::VsaInfo::managementId, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::VsaInfo::oi, and ns3::VsaInfo::vsc.

Referenced by ChannelRoutingTestCase::SendWsa(), and WaveNetDeviceExample::SendWsaExample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopSch()

bool ns3::WaveNetDevice::StopSch ( uint32_t  channelNumber)
Parameters
channelNumberthe channel which access resource will be released.
Returns
whether channel access is released successfully

Definition at line 306 of file wave-net-device.cc.

References IsAvailableChannel(), m_channelScheduler, and NS_LOG_FUNCTION.

Referenced by WaveNetDeviceExample::SendIpExample(), WaveNetDeviceExample::SendWsaExample(), and WaveNetDeviceExample::SendWsmpExample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopVsa()

bool ns3::WaveNetDevice::StopVsa ( uint32_t  channelNumber)
Parameters
channelNumberthe channel on which VSA transmit event will be canceled.
Returns
whether the request for stopping VSA transmission is completed

Definition at line 276 of file wave-net-device.cc.

References IsAvailableChannel(), m_vsaManager, and NS_LOG_FUNCTION.

Referenced by WaveNetDeviceExample::SendWsaExample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SupportsSendFrom()

bool ns3::WaveNetDevice::SupportsSendFrom ( ) const
overridevirtual
Returns
true if this interface supports a bridging mode, false otherwise.

Implements ns3::NetDevice.

Definition at line 777 of file wave-net-device.cc.

References CCH, and ns3::WifiNetDevice::GetMac().

+ Here is the call graph for this function:

Member Data Documentation

◆ IPv4_PROT_NUMBER

const uint16_t ns3::WaveNetDevice::IPv4_PROT_NUMBER = 0x0800
staticprivate

IP v4 Protocol number.

Definition at line 369 of file wave-net-device.h.

Referenced by SendX().

◆ IPv6_PROT_NUMBER

const uint16_t ns3::WaveNetDevice::IPv6_PROT_NUMBER = 0x86DD
staticprivate

IP v6 Protocol number.

Definition at line 371 of file wave-net-device.h.

Referenced by SendX().

◆ m_addressChange

TracedCallback<Address, Address> ns3::WaveNetDevice::m_addressChange
private
Todo:
The Address arguments should be passed by const reference, since they are large.

Definition at line 410 of file wave-net-device.h.

Referenced by ChangeAddress().

◆ m_channelCoordinator

Ptr<ChannelCoordinator> ns3::WaveNetDevice::m_channelCoordinator
private

the channel coordinator

Definition at line 403 of file wave-net-device.h.

Referenced by DoDispose(), DoInitialize(), GetChannelCoordinator(), and SetChannelCoordinator().

◆ m_channelManager

Ptr<ChannelManager> ns3::WaveNetDevice::m_channelManager
private

the channel manager

Definition at line 401 of file wave-net-device.h.

Referenced by DoDispose(), DoInitialize(), GetChannelManager(), and SetChannelManager().

◆ m_channelScheduler

Ptr<ChannelScheduler> ns3::WaveNetDevice::m_channelScheduler
private

the channel scheduler

Definition at line 402 of file wave-net-device.h.

Referenced by DoDispose(), DoInitialize(), GetChannelScheduler(), Send(), SendX(), SetChannelScheduler(), StartSch(), StartVsa(), and StopSch().

◆ m_forwardUp

NetDevice::ReceiveCallback ns3::WaveNetDevice::m_forwardUp
private

forward up receive callback

Definition at line 413 of file wave-net-device.h.

Referenced by ForwardUp(), and SetReceiveCallback().

◆ m_ifIndex

uint32_t ns3::WaveNetDevice::m_ifIndex
private

IF index.

Definition at line 415 of file wave-net-device.h.

Referenced by GetIfIndex(), and SetIfIndex().

◆ m_macEntities

MacEntities ns3::WaveNetDevice::m_macEntities
private

◆ m_mtu

uint16_t ns3::WaveNetDevice::m_mtu
mutableprivate

MTU.

Definition at line 416 of file wave-net-device.h.

Referenced by GetMtu(), and SetMtu().

◆ m_phyEntities

PhyEntities ns3::WaveNetDevice::m_phyEntities
private

Phy entities.

Definition at line 399 of file wave-net-device.h.

Referenced by AddPhy(), DoDispose(), DoInitialize(), GetChannel(), GetPhy(), GetPhys(), GetTypeId(), RegisterTxProfile(), and SendX().

◆ m_promiscRx

NetDevice::PromiscReceiveCallback ns3::WaveNetDevice::m_promiscRx
private

promiscious receive callback

Definition at line 414 of file wave-net-device.h.

Referenced by ForwardUp(), and SetPromiscReceiveCallback().

◆ m_txProfile

TxProfile* ns3::WaveNetDevice::m_txProfile
private

transmit profile

Definition at line 405 of file wave-net-device.h.

Referenced by DeleteTxProfile(), DoDispose(), RegisterTxProfile(), and Send().

◆ m_vsaManager

Ptr<VsaManager> ns3::WaveNetDevice::m_vsaManager
private

the VSA manager

Definition at line 404 of file wave-net-device.h.

Referenced by DoDispose(), DoInitialize(), GetVsaManager(), SetVsaManager(), SetWaveVsaCallback(), StartVsa(), and StopVsa().

◆ MAX_MSDU_SIZE

const uint16_t ns3::WaveNetDevice::MAX_MSDU_SIZE = 2304
staticprivate

This value conforms to the 802.11 specification.

Definition at line 366 of file wave-net-device.h.

Referenced by GetTypeId(), and SetMtu().


The documentation for this class was generated from the following files: