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);
Simulation virtual time values and global simulation resolution.
Mac8Address m_address
My addrese.s.
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()
Destructor implementation.
void AddTimestamp(Time t)
Set the time of the latest RTS sent.
void(* QueueTracedCallback)(Ptr< const Packet > packet, uint32_t proto)
TracedCallback signature for dequeue of a packet.
Forward calls to a chain of Callback.
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.
uint32_t GetNoFrames() const
Get the number of frames in this Reservation.
UanHeaderRcRts CreateRtsHeader(const Reservation &res)
Create the RTS header from a Reservation.
bool IsTransmitted() const
void ProcessAck(Ptr< Packet > ack)
Process a received ACK.
uint8_t m_retryNo
Number of retries.
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktQueue
Pending packets.
uint32_t GetLength() const
Get the total length of the Reservation.
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
uint8_t GetFrameNo() const
Get the frame number.
void BlockRtsing(void)
Callback to block RST.
void SetTransmitted(bool t=true)
Set the reservation transmitted state.
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forwardUpCb
The callback to forward a packet up to higher layer.
Virtual base class for all UAN MAC protocols.
Reservation()
Default constructor.
std::vector< Time > m_timestamp
Timestamps for each retry.
TracedCallback< Ptr< const Packet >, uint32_t > m_dequeueLogger
A was passed down to the PHY from the MAC.
virtual void Clear(void)
Clears all pointer references.
double m_minRetryRate
Smallest allowed RTS retry rate.
Abstraction of packet modulation information.
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktList
Queued packets for each address.
double m_retryStep
Retry rate increment.
A class used for addressing MAC8 MAC's.
const std::list< std::pair< Ptr< Packet >, Mac8Address > > & GetPktList(void) const
Get the list of packets.
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.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)
Enqueue packet to be transmitted.
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 >, uint32_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.
Time m_sifs
Spacing between frames to account for timing error and processing 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 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.
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 GetRetryNo() const
Get the retry 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.
uint32_t m_ctsSizeN
Size of UanHeaderRcCts.
Time GetTimestamp(uint8_t n) const
Get the timestamp for the n'th RTS.
bool m_transmitted
Has this reservation been transmitted.
Mac8Address m_assocAddr
Next hop address.
a unique identifier for an interface.
void Associate(void)
Associate with a gateway by sending the first GWPING.
void IncrementRetry()
Increment the retry count.
uint32_t m_ctsSizeG
Size of UanHeaderCommon and UanHeaderRcCtsGlobal.
~Reservation()
Destructor.