21 #ifndef UAN_MAC_RC_GW_H
22 #define UAN_MAC_RC_GW_H
25 #include "ns3/mac8-address.h"
27 #include "ns3/nstime.h"
28 #include "ns3/traced-callback.h"
73 virtual void Clear (
void);
89 (
Time now,
Time delay, uint32_t numRts, uint32_t totalBytes,
90 double secs, uint32_t ctlRate,
double actualX);
219 double ComputeAlpha (uint32_t totalFrames, uint32_t totalBytes, uint32_t n, uint32_t a,
double deltaK);
235 double ComputeExpS (uint32_t a, uint32_t ld, std::vector<double> exppdk);
260 double ComputePiK (uint32_t a, uint32_t n, uint32_t
k);
270 double ComputeExpBOverA (uint32_t n, uint32_t a, uint32_t ldlh, std::vector<double> deltaK);
278 uint64_t
NchooseK (uint32_t n, uint32_t
k);
a polymophic address class
A class used for addressing MAC8 MAC's.
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.
uint32_t m_numNodes
Number of non-gateway nodes in this gateway's neighborhood.
void ReceiveError(Ptr< Packet > pkt, double sinr)
PHY receive error callback.
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)
Enqueue packet to be transmitted.
void SendPacket(Ptr< Packet > pkt, uint32_t rate)
Send packet on PHY.
virtual void DoDispose()
Destructor implementation.
uint32_t m_maxRes
Maximum number of reservations to accept per cycle.
double ComputeAlpha(uint32_t totalFrames, uint32_t totalBytes, uint32_t n, uint32_t a, double deltaK)
Compute alpha parameter.
virtual void Clear(void)
Clears all pointer references.
double m_minRetryRate
Smallest allowed RTS retry rate.
uint16_t m_currentRetryRate
Retry rate number for current cycle.
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)
Set the callback to forward packets up to higher layers.
uint32_t m_ctsSizeN
Size of UanHeaderRcCts.
static TypeId GetTypeId(void)
Register this type.
uint32_t m_rateStep
Increments available for rate assignment in bps.
std::map< Mac8Address, AckData > m_ackData
AckData for each node.
void(* CycleCallback)(Time now, Time delay, uint32_t numRts, uint32_t totalBytes, double secs, uint32_t ctlRate, double actualX)
TracedCallback signature for.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
TracedCallback< Time, Time, uint32_t, uint32_t, double, uint32_t, double > m_cycleLogger
A packet was destined for and received at this MAC layer.
std::set< std::pair< Time, Mac8Address > > m_sortedRes
Queued request times.
Time m_maxDelta
Maximum propagation delay between gateway and non-gateway nodes .
double ComputeExpS(uint32_t a, uint32_t ld, std::vector< double > exppdk)
Throughput for a reservations with framesize ld, given expected delays exppdk.
Time m_sifs
Spacing between frames to account for timing error and processing delay.
bool m_cleared
Flag when we've been cleared.
uint32_t m_ctsSizeG
Size of UanHeaderCommon and UanHeaderRcCtsGlobal.
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
@ INCYCLE
Cycling through nodes.
@ IDLE
Initial idle state.
uint32_t m_frameSize
Size of data frames in bytes.
uint64_t NchooseK(uint32_t n, uint32_t k)
Binomial coefficient.
uint32_t m_numRates
Number of rates per Phy layer.
void CycleStarted(void)
Set state to INCYCLE.
void ReceivePacket(Ptr< Packet > pkt, double sinr, UanTxMode mode)
PHY receive ok callback.
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forwardUpCb
Forwarding up callback.
uint32_t m_currentRateNum
Rate number corresponding to data rate of current cycle.
double ComputePiK(uint32_t a, uint32_t n, uint32_t k)
Numeric function.
uint32_t m_totalRate
Total available channel rate in bps (for a single channel, without splitting reservation channel).
uint32_t m_rtsSize
Size of UanHeaderCommon and UanHeaderRcRts.
State m_state
Gateway processing state.
void StartCycle(void)
Cycle through pending requests.
uint32_t FindOptA(void)
Compute the optimum maximum number of reservations to accept per cycle.
std::map< Mac8Address, Request > m_requests
Request for each node.
double m_retryStep
Retry rate increment.
virtual void AttachPhy(Ptr< UanPhy > phy)
Attach PHY layer to this MAC.
double ComputeExpBOverA(uint32_t n, uint32_t a, uint32_t ldlh, std::vector< double > deltaK)
Numeric function.
std::map< Mac8Address, Time > m_propDelay
Propagation delay to each node.
std::vector< double > GetExpPdk(void)
Get the expected propagation delay to each node.
uint32_t m_ackSize
Size of UanHeaderCommon and UanHeaderRcAck.
uint32_t CompExpMinIndex(uint32_t n, uint32_t k)
Index to the k'th expected delay among n nodes.
TracedCallback< Ptr< const Packet >, UanTxMode > m_rxLogger
A packet was destined for and received at this MAC layer.
void EndCycle(void)
End cycle by scheduling pending ACKs.
virtual ~UanMacRcGw()
Dummy destructor, see DoDispose.
Abstraction of packet modulation information.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t expFrames
Expected number of frames.
uint8_t frameNo
Frame number being ACK'ed.
std::set< uint8_t > rxFrames
Received frames.
uint8_t retryNo
Retry number.
uint16_t length
Request header length.
uint8_t frameNo
Current frame number.
uint8_t numFrames
Number of frames.
Time rxTime
Time request received.