|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/uan-mac.h"
25 #include "ns3/nstime.h"
26 #include "ns3/simulator.h"
27 #include "ns3/uan-phy.h"
28 #include "ns3/uan-tx-mode.h"
29 #include "ns3/mac8-address.h"
30 #include "ns3/random-variable-stream.h"
65 virtual void SetCw (uint32_t cw);
77 virtual uint32_t
GetCw (
void);
89 virtual void Clear (
void);
a unique identifier for an interface.
bool m_cleared
Flag when we've been cleared.
A class used for addressing MAC8 MAC's.
void SaveTimer(void)
Cancel SendEvent and save remaining delay.
An identifier for simulation events.
uint32_t m_cw
Contention window size.
void SendPacket(void)
Send packet on PHY.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void AttachPhy(Ptr< UanPhy > phy)
Attach PHY layer to this MAC.
TracedCallback< Ptr< const Packet >, UanTxMode > m_rxLogger
A packet destined for this MAC was received.
uint16_t m_pktTxProt
Next packet protocol number (usage varies by MAC).
void StartTimer(void)
Schedule SendPacket after delay.
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)
Set the callback to forward packets up to higher layers.
virtual void NotifyRxEndOk(void)
Called when UanPhy finishes receiving packet without error.
UanMacCw()
Default constructor.
static TypeId GetTypeId(void)
Register this type.
virtual void DoDispose()
Destructor implementation.
virtual void NotifyCcaEnd(void)
Called when UanPhy stops sensing channel is busy.
TracedCallback< Ptr< const Packet >, uint16_t > m_enqueueLogger
A packet arrived at the MAC for transmission.
Ptr< UniformRandomVariable > m_rv
Provides uniform random variable for contention window.
State m_state
Current state.
virtual void NotifyTxStart(Time duration)
Called when transmission starts from Phy object.
Time m_slotTime
Slot time duration.
a polymophic address class
EventId m_sendEvent
Scheduled SendPacket event.
Ptr< Packet > m_pktTx
Next packet to send.
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)
Enqueue packet to be transmitted.
bool m_txOngoing
Tx is ongoing.
virtual void NotifyRxEndError(void)
Called when UanPhy finishes receiving packet in error.
Simulation virtual time values and global simulation resolution.
Abstraction of packet modulation information.
Time m_sendTime
Time to send next packet.
void PhyRxPacketGood(Ptr< Packet > packet, double sinr, UanTxMode mode)
Receive packet from lower layer (passed to PHY as callback).
@ RUNNING
Delay timer running.
void(* QueueTracedCallback)(Ptr< const Packet > packet, uint16_t proto)
TracedCallback signature for enqueue/dequeue of a packet.
void EndTx(void)
End TX state.
virtual uint32_t GetCw(void)
Get the contention window size.
virtual void NotifyRxStart(void)
Called when UanPhy begins receiving packet.
virtual void NotifyCcaStart(void)
Called when UanPhy begins sensing channel is busy.
Time m_savedDelayS
Remaining delay until next send.
CW-MAC protocol, similar in idea to the 802.11 DCF with constant backoff window.
virtual void Clear(void)
Clears all pointer references.
Interface for PHY event listener.
Virtual base class for all UAN MAC protocols.
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forwardUpCb
Forwarding up callback.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual void SetSlotTime(Time duration)
Set the slot time duration.
TracedCallback< Ptr< const Packet >, uint16_t > m_dequeueLogger
A packet was passed down to the PHY from the MAC.
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
Forward calls to a chain of Callback.
void PhyRxPacketError(Ptr< Packet > packet, double sinr)
Packet received at lower layer in error.
virtual void NotifyTxEnd(void)
Function called when Phy object finishes transmitting packet.
virtual ~UanMacCw()
Dummy destructor, DoDispose.
virtual Time GetSlotTime(void)
Get the slot time duration.
State
Enum defining possible Phy states.
virtual void SetCw(uint32_t cw)
Set the contention window size.