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