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