|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/wifi-phy.h"
23 #include "ns3/llc-snap-header.h"
24 #include "ns3/channel.h"
26 #include "ns3/socket.h"
27 #include "ns3/object-map.h"
28 #include "ns3/object-vector.h"
43 .SetGroupName (
"Wave")
45 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
50 .AddAttribute (
"Channel",
"The channel attached to this device",
53 MakePointerChecker<Channel> ())
54 .AddAttribute (
"PhyEntities",
"The PHY entities attached to this device.",
57 MakeObjectVectorChecker<WifiPhy> ())
58 .AddAttribute (
"MacEntities",
"The MAC layer attached to this device.",
61 MakeObjectMapChecker<OcbWifiMac> ())
62 .AddAttribute (
"ChannelScheduler",
"The channel scheduler attached to this device.",
66 MakePointerChecker<ChannelScheduler> ())
67 .AddAttribute (
"ChannelManager",
"The channel manager attached to this device.",
71 MakePointerChecker<ChannelManager> ())
72 .AddAttribute (
"ChannelCoordinator",
"The channel coordinator attached to this device.",
76 MakePointerChecker<ChannelCoordinator> ())
77 .AddAttribute (
"VsaManager",
"The VSA manager attached to this device.",
81 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)))
430 mac->NotifyTx (packet);
431 mac->Enqueue (packet, realTo);
440 if (newAddress == oldAddress)
561 NS_LOG_WARN (
"WaveNetDevice is linkup forever, so this callback will be never called");
604 NS_LOG_DEBUG (
"there is no tx profile registered for transmission");
615 NS_LOG_DEBUG (
"High layer does not want to control tx parameters.");
634 mac->NotifyTx (packet);
635 mac->Enqueue (packet, realTo);
658 NS_LOG_DEBUG (
"this is no a valid WAVE channel for channel " << channelNumber);
663 NS_LOG_DEBUG (
"this is no available WAVE entity for channel " << channelNumber);
699 mac->NotifyRx (copy);
708 mac->NotifyPromiscRx (copy);
726 i->second->SetPromisc ();
733 return (
GetMac (
CCH))->SupportsSendFrom ();
a unique identifier for an interface.
@ PACKET_BROADCAST
Packet addressed to all.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
WifiPreamble preamble
preamble
static TypeId GetTypeId(void)
Get the type ID.
NetDevice::PromiscReceiveCallback m_promiscRx
promiscious receive callback
virtual void DoInitialize(void)
Initialize() implementation.
void Dispose(void)
Dispose of this Object.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
bool DeleteTxProfile(uint32_t channelNumber)
uint32_t priority
priority
static Mac48Address GetMulticast(Ipv4Address address)
This class holds together multiple, ns3::WifiPhy, and ns3::OcbWifiMac (including ns3::WifiRemoteStati...
virtual bool IsLinkUp(void) const
void SetChannelScheduler(Ptr< ChannelScheduler > channelScheduler)
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
void AddHeader(const Header &header)
Add header to this packet.
void ChangeAddress(Address newAddress)
Ptr< WifiPhy > GetPhy(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MacEntities m_macEntities
MAC entities.
bool IsAvailableChannel(uint32_t channelNumber) const
bool IsNull(void) const
Check for null implementation.
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
static bool IsWaveChannel(uint32_t channelNumber)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
virtual bool SetMtu(const uint16_t mtu)
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
virtual void DoDispose(void)
Destructor implementation.
virtual uint16_t GetMtu(void) const
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Ptr< VsaManager > m_vsaManager
the VSA manager
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
uint32_t channelNumber
channel number
std::vector< Ptr< WifiPhy > >::const_iterator PhyEntitiesI
PhyEntities iterator typedef.
Ptr< ChannelManager > GetChannelManager(void) const
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
@ PACKET_HOST
Packet addressed oo us.
void SetWaveVsaCallback(WaveVsaCallback vsaCallback)
Hold objects of type Ptr<T>.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
virtual Ptr< Channel > GetChannel(void) const
Container for a set of ns3::Object pointers.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void SetIfIndex(const uint32_t index)
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
Ptr< ChannelCoordinator > m_channelCoordinator
the channel coordinator
bool RegisterTxProfile(const TxProfile &txprofile)
WifiMode dataRate
data rate
static const uint16_t MAX_MSDU_SIZE
This value conforms to the 802.11 specification.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
static const uint16_t IPv4_PROT_NUMBER
IP v4 Protocol number.
void AddPhy(Ptr< WifiPhy > phy)
void SetPriority(uint8_t priority)
Set the tag's priority.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static Mac48Address GetBroadcast(void)
virtual Address GetBroadcast(void) const
uint8_t managementId
management ID
@ PACKET_OTHERHOST
Packet addressed to someone else.
represent a single transmission mode
std::vector< Ptr< WifiPhy > > GetPhys(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
uint32_t txPowerLevel
transmit power level
a polymophic address class
static Mac48Address ConvertFrom(const Address &address)
uint32_t m_ifIndex
IF index.
uint32_t channelNumber
channel number
virtual void AddLinkChangeCallback(Callback< void > callback)
Ptr< ChannelScheduler > GetChannelScheduler(void) const
bool IsBroadcast(void) const
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
TracedCallback< Address, Address > m_addressChange
WifiMode dataRate
data rate
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void DoDispose(void) override
Destructor implementation.
void CancelTx(uint32_t channelNumber, enum AcIndex ac)
std::string GetUniqueName(void) const
Ptr< ChannelManager > m_channelManager
the channel manager
uint32_t channelNumber
channel number
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
bool StartVsa(const VsaInfo &vsaInfo)
static const uint16_t IPv6_PROT_NUMBER
IP v6 Protocol number.
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...
virtual void DoInitialize(void)
Initialize() implementation.
virtual void SetAddress(Address address)
Set the address of this interface.
WifiPreamble preamble
preamble
uint32_t channelNumber
channel number
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
void SetChannelCoordinator(Ptr< ChannelCoordinator > channelCoordinator)
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
PhyEntities m_phyEntities
Phy entities.
std::map< uint32_t, Ptr< OcbWifiMac > >::const_iterator MacEntitiesI
MacEntities iterator typedef.
void AddMac(uint32_t channelNumber, Ptr< OcbWifiMac > mac)
void AddPacketTag(const Tag &tag) const
Add a packet tag.
indicates whether the socket has a priority set.
virtual bool IsMulticast(void) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
OrganizationIdentifier oi
OI.
bool StartSch(const SchInfo &schInfo)
virtual uint32_t GetIfIndex(void) const
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Ptr< ChannelScheduler > m_channelScheduler
the channel scheduler
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< VsaManager > GetVsaManager(void) const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
PacketType
Packet types are used as they are in Linux.
virtual bool IsBroadcast(void) const
Hold an unsigned integer type.
virtual ~WaveNetDevice(void)
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octects of the LLC/SNAP header.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
bool StopVsa(uint32_t channelNumber)
NetDevice::ReceiveCallback m_forwardUp
forward up receive callback
virtual Address GetAddress(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 SupportsSendFrom(void) const
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
bool SendX(Ptr< Packet > packet, const Address &dest, uint32_t protocol, const TxInfo &txInfo)
void SetVsaManager(Ptr< VsaManager > vsaManager)
uint32_t txPowerLevel
transmit power level
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
virtual bool NeedsArp(void) const
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
bool StopSch(uint32_t channelNumber)
TxProfile * m_txProfile
transmit profile
Network layer to device interface.
Ptr< WifiMac > GetMac(void) const
void SetChannelManager(Ptr< ChannelManager > channelManager)
@ PACKET_MULTICAST
Packet addressed to multicast group.