21 #include "ns3/wifi-channel.h"
22 #include "ns3/llc-snap-header.h"
23 #include "ns3/uinteger.h"
25 #include "ns3/trace-source-accessor.h"
27 #include "ns3/qos-tag.h"
28 #include "ns3/object-map.h"
29 #include "ns3/object-vector.h"
44 .SetGroupName (
"Wave")
46 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
51 .AddAttribute (
"Channel",
"The channel attached to this device",
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.",
62 MakeObjectMapChecker<OcbWifiMac> ())
63 .AddAttribute (
"ChannelScheduler",
"The channel scheduler attached to this device.",
67 MakePointerChecker<ChannelScheduler> ())
68 .AddAttribute (
"ChannelManager",
"The channel manager attached to this device.",
72 MakePointerChecker<ChannelManager> ())
73 .AddAttribute (
"ChannelCoordinator",
"The channel coordinator attached to this device.",
77 MakePointerChecker<ChannelCoordinator> ())
78 .AddAttribute (
"VsaManager",
"The VSA manager attached to this device.",
82 MakePointerChecker<VsaManager> ())
182 NS_FATAL_ERROR (
"The channel " << channelNumber <<
" is not a valid WAVE channel number");
186 NS_FATAL_ERROR (
"The MAC entity for channel " << channelNumber <<
" already exists.");
197 NS_FATAL_ERROR (
"there is no available MAC entity for channel " << channelNumber);
202 std::map<uint32_t, Ptr<OcbWifiMac> >
226 std::vector<Ptr<WifiPhy> >
246 if (vsaInfo.
vsc == 0)
248 NS_LOG_DEBUG (
"vendor specific information shall not be null");
253 NS_LOG_DEBUG (
"when organization identifier is not set, management ID "
254 "shall be in range from 0 to 15");
323 NS_LOG_DEBUG (
"IP-based packets shall not be transmitted on the CCH");
329 NS_LOG_DEBUG (
"High layer does not want to control tx parameters.");
336 if (!((*i)->IsModeSupported (txprofile.
dataRate)))
386 NS_LOG_DEBUG (
"IP-based packets shall not be transmitted on the CCH");
398 NS_LOG_DEBUG (
"High layer does not want to control tx parameters.");
405 if ( !((*i)->IsModeSupported (txInfo.
dataRate)))
428 mac->NotifyTx (packet);
429 mac->Enqueue (packet, realTo);
438 if (newAddress == oldAddress)
559 NS_LOG_WARN (
"WaveNetDevice is linkup forever, so this callback will be never called");
602 NS_LOG_DEBUG (
"there is no tx profile registered for transmission");
613 NS_LOG_DEBUG (
"High layer does not want to control tx parameters.");
631 mac->NotifyTx (packet);
632 mac->Enqueue (packet, realTo);
665 NS_LOG_DEBUG (
"this is no a valid WAVE channel for channel " << channelNumber);
670 NS_LOG_DEBUG (
"this is no available WAVE entity for channel " << channelNumber);
732 i->second->SetPromisc ();
739 return (
GetMac (
CCH))->SupportsSendFrom ();
virtual Address GetAddress(void) const
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Ptr< WifiPhy > GetPhy(uint32_t index) const
void Dispose(void)
Dispose of this Object.
bool StopVsa(uint32_t channelNumber)
virtual Ptr< WifiChannel > GetChannel(void) const =0
Return the WifiChannel this WifiPhy is connected to.
virtual void DoInitialize(void)
Initialize() implementation.
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 "...
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.
Ptr< ChannelCoordinator > m_channelCoordinator
void AddPacketTag(const Tag &tag) const
Add a packet tag.
bool IsNull(void) const
Check for null implementation.
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
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...
PacketType
Packet types are used as they are in Linux.
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.
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...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Packet addressed to multicast group.
virtual void DoDispose(void)
Destructor implementation.
virtual void SetAddress(Address address)
Set the address of this interface.
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...
Ptr< VsaManager > GetVsaManager(void) const
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...
void SetChannelWidth(uint32_t channelWidth)
Sets the selected channelWidth (in MHz)
a polymophic address class
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
static const uint16_t IPv6_PROT_NUMBER
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...
static Mac48Address GetMulticast(Ipv4Address address)
bool DeleteTxProfile(uint32_t channelNumber)
Ptr< ChannelManager > m_channelManager
virtual ~WaveNetDevice(void)
Hold an unsigned integer type.
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...
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
static Mac48Address GetBroadcast(void)
Ptr< VsaManager > m_vsaManager
void NotifyPromiscRx(Ptr< const Packet > packet)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
The aim of the QosTag is to provide means for an Application to specify the TID which will be used by...
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
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.
Packet addressed to someone else.
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
virtual Address GetBroadcast(void) const
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)
void AddPhy(Ptr< WifiPhy > phy)
Describes an IPv6 address.
bool StartVsa(const VsaInfo &vsaInfo)
Ipv4 addresses are stored in host order in this class.
virtual Ptr< Node > GetNode(void) const
TracedCallback< Address, Address > m_addressChange
virtual void AddLinkChangeCallback(Callback< void > callback)
Network layer to device interface.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
static TypeId GetTypeId(void)
void SetVsaManager(Ptr< VsaManager > vsaManager)
NetDevice::PromiscReceiveCallback m_promiscRx
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
PhyEntities m_phyEntities
OrganizationIdentifier oi
std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
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)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
MacEntities m_macEntities
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...
virtual bool IsLinkUp(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool RegisterTxProfile(const TxProfile &txprofile)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
void CancelTx(uint32_t channelNumber, enum AcIndex ac)
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
void AddHeader(const Header &header)
Add header to this packet.
virtual void SetNode(Ptr< Node > node)