|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include "ns3/llc-snap-header.h"
24 #include "ns3/simulator.h"
25 #include "ns3/callback.h"
27 #include "ns3/packet.h"
30 #include "ns3/packet-burst.h"
34 #include "ns3/uinteger.h"
35 #include "ns3/trace-source-accessor.h"
36 #include "ns3/pointer.h"
56 TypeId (
"ns3::WimaxNetDevice")
59 .SetGroupName (
"Wimax")
63 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
70 "The PHY layer attached to this device.",
73 MakePointerChecker<WimaxPhy> ())
75 .AddAttribute (
"Channel",
76 "The channel attached to this device.",
79 MakePointerChecker<WimaxChannel> ())
82 "receive/transmit transition gap.",
85 MakeUintegerChecker<uint16_t> (0, 120))
88 "transmit/receive transition gap.",
91 MakeUintegerChecker<uint16_t> (0, 120))
93 .AddAttribute (
"ConnectionManager",
94 "The connection manager attached to this device.",
98 MakePointerChecker<ConnectionManager> ())
100 .AddAttribute (
"BurstProfileManager",
101 "The burst profile manager attached to this device.",
105 MakePointerChecker<BurstProfileManager> ())
107 .AddAttribute (
"BandwidthManager",
108 "The bandwidth manager attached to this device.",
112 MakePointerChecker<BandwidthManager> ())
114 .AddAttribute (
"InitialRangingConnection",
115 "Initial ranging connection",
118 MakePointerChecker<WimaxConnection> ())
120 .AddAttribute (
"BroadcastConnection",
121 "Broadcast connection",
124 MakePointerChecker<WimaxConnection> ())
126 .AddTraceSource (
"Rx",
129 "ns3::WimaxNetDevice::TxRxTracedCallback")
131 .AddTraceSource (
"Tx",
134 "ns3::WimaxNetDevice::TxRxTracedCallback");
309 llcHdr.
SetType (protocolNumber);
534 return m_phy->GetChannel ();
551 llcHdr.
SetType (protocolNumber);
555 return DoSend (packet, from, to, protocolNumber);
586 m_phy->Send (params);
600 uint64_t frequency = 5000;
602 for (uint8_t i = 0; i < 200; i++)
650 NS_FATAL_ERROR (
"Not implemented-- please implement and contribute a patch");
a unique identifier for an interface.
static Cid Broadcast(void)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static uint8_t m_direction
downlink or uplink
void SetBurstProfileManager(Ptr< BurstProfileManager > burstProfileManager)
Set the burst profile manager.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< WimaxPhy > m_phy
the phy
void ForwardUp(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest)
Forward a packet to the next layer above the device.
static Mac48Address GetMulticast(Ipv4Address address)
uint16_t GetTtg(void) const
Get transmission/receive transition gap.
Ptr< ConnectionManager > GetConnectionManager(void) const
Get the connection manager of the device.
void ForwardDown(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType)
Forward a packet down the stack.
void AddHeader(const Header &header)
Add header to this packet.
uint16_t GetRtg(void) const
Get receive/transmit transition gap.
virtual void AddLinkChangeCallback(Callback< void > callback)
Add link change callback function.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< void > m_linkChange
link change callback
virtual void SetLinkChangeCallback(Callback< void > callback)
Set link change callback function.
virtual bool SetMtu(const uint16_t mtu)
Set MTU value for the device.
void SetState(uint8_t state)
Set the device state.
virtual Address MakeMulticastAddress(Ipv4Address multicastGroup) const
Make multicast address.
bool IsNull(void) const
Check for null implementation.
Ptr< BurstProfileManager > GetBurstProfileManager(void) const
Get the burst profile manager.
virtual bool SupportsSendFrom(void) const
Check if device supports the SendFrom method.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
Set promiscious receive callback function.
static const uint16_t DEFAULT_MSDU_SIZE
recommended by wimax forum.
virtual Ptr< Channel > GetChannel(void) const
Get the channel.
virtual Address GetMulticast(void) const
Get multicast address.
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Hold objects of type Ptr<T>.
NetDevice::PromiscReceiveCallback m_promiscRx
promiscious receive fcallback function
virtual ~WimaxNetDevice(void)
std::string m_name
service name
virtual bool IsMulticast(void) const
Check if multicast enabled.
void CreateDefaultConnections(void)
Creates the initial ranging and broadcast connections.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void DoReceive(Ptr< Packet > packet)=0
Receive a packet.
virtual void SetName(const std::string name)
Set device name.
TracedCallback< Ptr< const Packet >, const Mac48Address & > m_traceRx
Ptr< WimaxConnection > GetInitialRangingConnection(void) const
Get the initial ranging connection.
void Receive(Ptr< const PacketBurst > burst)
Receive a packet burst.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< BandwidthManager > m_bandwidthManager
badnwidth manager
virtual bool IsBroadcast(void) const
Check if broadcast enabled.
void InitializeChannels(void)
Initialize channels function.
virtual bool IsLinkUp(void) const
Check if link is up.
uint32_t m_ifIndex
IF index.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
static uint32_t m_nrFrames
temp, shall be in BS. defined here to allow SS to access. SS shall actually determine it from DLFP,...
Ptr< WimaxConnection > m_initialRangingConnection
initial rnaging connection
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static Mac48Address GetBroadcast(void)
virtual uint32_t GetIfIndex(void) const
Get interface index.
virtual void SetIfIndex(const uint32_t index)
Set interface index.
std::vector< uint64_t > m_dlChannels
not sure if it shall be included here
ModulationType
ModulationType enumeration.
a polymophic address class
void Attach(Ptr< WimaxChannel > channel)
Attach device to channel.
virtual Ptr< Node > GetNode(void) const
Get node pointer.
static Mac48Address ConvertFrom(const Address &address)
void SetTtg(uint16_t ttg)
Set transmission/receive transition gap.
static Cid InitialRanging(void)
Ucd GetCurrentUcd(void) const
Get the current UCD.
uint8_t GetState(void) const
Get the device state.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
virtual bool DoSend(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest, uint16_t protocolNumber)=0
Send a packet.
void SetPhy(Ptr< WimaxPhy > phy)
Set the physical layer object.
virtual Address GetAddress(void) const
Get address of the device.
Mac48Address m_address
MAC address.
Ptr< ConnectionManager > m_connectionManager
connection manager
bool IsPromisc(void)
Check if device is promiscious.
Ptr< Node > m_node
the node
Mac48Address GetMacAddress(void) const
Get the MAC address.
void SetBandwidthManager(Ptr< BandwidthManager > bandwidthManager)
Set the bandwidth manager on the device.
static const uint16_t MAX_MSDU_SIZE
Maximum MSDU size.
uint32_t GetNrFrames(void) const
Get the number of frames.
Dcd GetCurrentDcd(void) const
Get the current DCD.
virtual Ptr< Channel > GetPhyChannel(void) const
Get the channel (this method is redundant with GetChannel())
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Send function.
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...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
NetDevice::ReceiveCallback m_forwardUp
forward up callback function
Ptr< WimaxConnection > GetBroadcastConnection(void) const
Get the broadcast connection.
void SetRtg(uint16_t rtg)
Set receive/transmit transition gap.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
void SetCurrentUcd(Ucd ucd)
Set the current UCD.
Ptr< WimaxConnection > m_broadcastConnection
broadcast connection
virtual Address GetBroadcast(void) const
Get broadcast address.
virtual std::string GetName(void) const
Get device name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual void SetNode(Ptr< Node > node)
Set node pointer.
Ptr< BandwidthManager > GetBandwidthManager(void) const
Get the bandwidth manager on the device.
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual bool NeedsArp(void) const
Check if device needs ARP.
virtual void DoDispose(void)
Destructor implementation.
void SetReceiveCallback(void)
Set receive callback function.
void NotifyPromiscTrace(Ptr< Packet > p)
Notify promiscious trace of a packet arrival.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetMacAddress(Mac48Address address)
Set the MAC address.
static Time m_frameStartTime
temp, to determine the frame start time at SS side, shall actually be determined by frame start pream...
Hold an unsigned integer type.
The SendParams class defines the parameters with which Send() function of a particular PHY is called.
void SetChannel(Ptr< WimaxChannel > wimaxChannel)
Set the channel object.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
virtual uint16_t GetMtu(void) const
Get MTU of the device.
uint16_t m_ttg
length of TTG in units of PSs
void SetNrFrames(uint32_t nrFrames)
Set the number of frames.
virtual void SetAddress(Address address)
Set address of the device.
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 IsPointToPoint(void) const
Check if device is a point-to-point device.
Ptr< BurstProfileManager > m_burstProfileManager
burst profile manager
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
TracedCallback< Ptr< const Packet >, const Mac48Address & > m_traceTx
uint16_t m_rtg
length of RTG in units of PSs
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Send a packet.
virtual void DoDispose(void)
Destructor implementation.
This class implements Downlink channel descriptor as described by "IEEE Standard for Local and metrop...
Ptr< WimaxPhy > GetPhy(void) const
Get the physical layer object.
Network layer to device interface.
void SetCurrentDcd(Dcd dcd)
Set the current DCD.
static TypeId GetTypeId(void)
Get the type ID.
virtual Ptr< WimaxChannel > DoGetChannel(void) const
Get the channel.
virtual void SetConnectionManager(Ptr< ConnectionManager > connectionManager)
Set the connection manager of the device.