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