|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
25 #include "ns3/mac8-address.h"
27 #include "ns3/nstime.h"
28 #include "ns3/trace-source-accessor.h"
29 #include "ns3/traced-callback.h"
30 #include "ns3/event-id.h"
31 #include "ns3/random-variable-stream.h"
44 class UanHeaderRcCtsGlobal;
189 virtual void Clear (
void);
a unique identifier for an interface.
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)
Enqueue packet to be transmitted.
uint32_t m_ctsSizeN
Size of UanHeaderRcCts.
A class used for addressing MAC8 MAC's.
void SetFrameNo(uint8_t fn)
Set the frame number.
void ProcessAck(Ptr< Packet > ack)
Process a received ACK.
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)
Set the callback to forward packets up to higher layers.
EventId m_startAgain
(Unused).
An identifier for simulation events.
void ReceiveOkFromPhy(Ptr< Packet > pkt, double sinr, UanTxMode mode)
PHY receive ok Callback.
Ptr< ExponentialRandomVariable > m_ev
Provides exponential random variables.
void ScheduleData(const UanHeaderRcCts &ctsh, const UanHeaderRcCtsGlobal &ctsg, uint32_t ctsBytes)
Schedule Packet sends.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetTransmitted(bool t=true)
Set the reservation transmitted state.
void SendRts(void)
Send RTS packet.
Mac8Address m_assocAddr
Next hop address.
uint8_t m_frameNo
Frame number.
Time m_sifs
Spacing between frames to account for timing error and processing delay.
uint8_t m_retryNo
Number of retries.
uint8_t GetRetryNo() const
Get the retry number.
~Reservation()
Destructor.
uint32_t m_ctsSizeG
Size of UanHeaderCommon and UanHeaderRcCtsGlobal.
uint8_t m_frameNo
Current frame number.
static TypeId GetTypeId(void)
Register this type.
uint32_t m_currentRate
Rate number corresponding to data rate of current cycle.
const std::list< std::pair< Ptr< Packet >, Mac8Address > > & GetPktList(void) const
Get the list of packets.
uint32_t GetNoFrames() const
Get the number of frames in this Reservation.
virtual ~UanMacRc()
Dummy destructor, DoDispose.
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
uint32_t GetLength() const
Get the total length of the Reservation.
void AddTimestamp(Time t)
Set the time of the latest RTS sent.
std::list< Reservation > m_resList
List of scheduled reservations.
TracedCallback< Ptr< const Packet >, UanTxMode > m_rxLogger
A packet was destined for and received at this MAC layer.
@ IDLE
Finished scheduling packet sends.
Time m_learnedProp
Propagation delay to gateway.
UanMacRc()
Default constructor.
a polymophic address class
uint32_t m_queueLimit
Maximum packets to queue at MAC.
void IncrementRetry()
Increment the retry count.
bool m_cleared
Flag when we've been cleared.
uint8_t GetFrameNo() const
Get the frame number.
bool IsPhy1Ok(void)
Check that PHY is ok: not CTS or ACK not to my address.
void RtsTimeout(void)
Retry RTS.
Simulation virtual time values and global simulation resolution.
Abstraction of packet modulation information.
Stores reservation info for use in scheduling data channel by reservation channel MAC.
UanHeaderRcRts CreateRtsHeader(const Reservation &res)
Create the RTS header from a Reservation.
void AssociateTimeout(void)
Periodically retry association.
TracedCallback< Ptr< const Packet >, uint32_t > m_enqueueLogger
A packet arrived at the MAC for transmission.
double m_minRetryRate
Smallest allowed RTS retry rate.
void(* QueueTracedCallback)(Ptr< const Packet > packet, uint32_t proto)
TracedCallback signature for dequeue of a packet.
Time GetTimestamp(uint8_t n) const
Get the timestamp for the n'th RTS.
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktList
Queued packets for each address.
EventId m_rtsEvent
The RTS event.
void Associate(void)
Associate with a gateway by sending the first GWPING.
Non-gateway node MAC for reservation channel MAC protocol.
void DoDispose()
Destructor implementation.
uint32_t m_numRates
Number of rates per Phy layer.
@ UNASSOCIATED
Initial state.
Virtual base class for all UAN MAC protocols.
double m_retryStep
Retry rate increment.
@ GWPSENT
Associated with gateway.
uint32_t m_length
Total length of queued packets.
bool IsTransmitted() const
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forwardUpCb
The callback to forward a packet up to higher layer.
virtual void Clear(void)
Clears all pointer references.
TracedCallback< Ptr< const Packet >, uint32_t > m_dequeueLogger
A was passed down to the PHY from the MAC.
void SendPacket(Ptr< Packet > pkt, uint32_t rate)
Send on packet on the PHY.
virtual void AttachPhy(Ptr< UanPhy > phy)
Attach PHY layer to this MAC.
Reservation()
Default constructor.
void BlockRtsing(void)
Callback to block RST.
static uint32_t m_cntrlSends
Global count of calls to Associate, AssociateTimeout, SendRts, and RtsTimeout.
Forward calls to a chain of Callback.
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktQueue
Pending packets.
bool m_rtsBlocked
RTS blocked while processing ACK.
double m_retryRate
Number of retry attempts per second (of RTS/GWPING.
std::vector< Time > m_timestamp
Timestamps for each retry.
bool m_transmitted
Has this reservation been transmitted.
uint32_t m_maxFrames
Maximum number of frames to include in a single RTS.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
@ TYPE_GWPING
Gateway ping.