DESERT 4.0.0
UWSmartOFDM Class Reference

This is the base class of UWSmartOFDM protocol, which is a derived class of MMac. More...

#include <uw-smart-ofdm.h>

Inheritance diagram for UWSmartOFDM:
Inheritance graph
Collaboration diagram for UWSmartOFDM:
Collaboration graph

Classes

class  AckTimer
 
class  AssignmentTimer
 
class  AssignmentValidTimer
 
class  BackOffTimer
 
class  CTSTimer
 
class  DATATimer
 
class  RTSTimer
 
class  UWSmartOFDMTimer
 

Public Member Functions

 UWSmartOFDM ()
 
virtual ~UWSmartOFDM ()
 
virtual int command (int argc, const char *const *argv)
 
void init_macofdm_node (int subCarNum, double carSize, int ctrl_subCar, std::string modulation)
 

Protected Types

enum  UWSMARTOFDM_STATUS {
  UWSMARTOFDM_STATE_IDLE = 1 , UWSMARTOFDM_STATE_BACKOFF , UWSMARTOFDM_STATE_TX_DATA , UWSMARTOFDM_STATE_TX_ACK ,
  UWSMARTOFDM_STATE_WAIT_ACK , UWSMARTOFDM_STATE_DATA_RX , UWSMARTOFDM_STATE_ACK_RX , UWSMARTOFDM_STATE_NOT_SET ,
  UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT , UWSMARTOFDM_STATE_RX_IDLE , UWSMARTOFDM_STATE_RX_WAIT_ACK , UWSMARTOFDM_STATE_CHK_BACKOFF_TIMEOUT ,
  UWSMARTOFDM_STATE_RX_BACKOFF , UWSMARTOFDM_STATE_WRONG_PKT_RX , UWSMARTOFDM_STATE_TX_RTS , UWSMARTOFDM_STATE_RX_RTS ,
  UWSMARTOFDM_STATE_WAIT_CTS , UWSMARTOFDM_STATE_CTRL_BACKOFF , UWSMARTOFDM_STATE_CHK_CTS_BACKOFF_TIMEOUT , UWSMARTOFDM_STATE_TX_CTS ,
  UWSMARTOFDM_STATE_RX_CTS , UWSMARTOFDM_STATE_RX_ACTIVE , UWSMARTOFDM_STATE_TX_ACTIVE , UWSMARTOFDM_STATE_WAIT_DATA
}
 
enum  UWSMARTOFDM_REASON_STATUS {
  UWSMARTOFDM_REASON_DATA_PENDING , UWSMARTOFDM_REASON_DATA_NOCAR , UWSMARTOFDM_REASON_DATA_CARASSIGNED , UWSMARTOFDM_REASON_DATA_RX ,
  UWSMARTOFDM_REASON_DATA_TX , UWSMARTOFDM_REASON_ACK_TX , UWSMARTOFDM_REASON_ACK_RX , UWSMARTOFDM_REASON_ACK_TIMEOUT ,
  UWSMARTOFDM_REASON_DATA_EMPTY , UWSMARTOFDM_REASON_NOT_SET , UWSMARTOFDM_REASON_MAX_TX_TRIES , UWSMARTOFDM_REASON_START_RX ,
  UWSMARTOFDM_REASON_PKT_NOT_FOR_ME , UWSMARTOFDM_REASON_WAIT_ACK_PENDING , UWSMARTOFDM_REASON_PKT_ERROR , UWSMARTOFDM_REASON_BACKOFF_TIMEOUT ,
  UWSMARTOFDM_REASON_BACKOFF_PENDING , UWSMARTOFDM_REASON_WAIT_CTS_PENDING , UWSMARTOFDM_REASON_CTS_TX , UWSMARTOFDM_REASON_RTS_TX ,
  UWSMARTOFDM_REASON_CTS_RX , UWSMARTOFDM_REASON_RTS_RX , UWSMARTOFDM_REASON_CTS_BACKOFF_TIMEOUT , UWSMARTOFDM_REASON_PHY_LAYER_RECEIVING ,
  UWSMARTOFDM_REASON_PHY_LAYER_SENDING , UWSMARTOFDM_REASON_MAX_RTS_TRIES , UWSMARTOFDM_REASON_WAIT_DATA , UWSMARTOFDM_REASON_DATAT_EXPIRED ,
  UWSMARTOFDM_REASON_PREVIOUS_RTS
}
 
enum  UWSMARTOFDM_PKT_TYPE {
  UWSMARTOFDM_ACK_PKT = 1 , UWSMARTOFDM_DATA_PKT , UWSMARTOFDM_DATAMAX_PKT , UWSMARTOFDM_RTS_PKT ,
  UWSMARTOFDM_CTS_PKT
}
 
enum  UWSMARTOFDM_ACK_MODES { UWSMARTOFDM_ACK_MODE = 1 , UWSMARTOFDM_NO_ACK_MODE }
 
enum  UWSMARTOFDM_TIMER_STATUS { UWSMARTOFDM_IDLE = 1 , UWSMARTOFDM_RUNNING , UWSMARTOFDM_FROZEN , UWSMARTOFDM_EXPIRED }
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual double computeTxTime (UWSMARTOFDM_PKT_TYPE type)
 
virtual void initPkt (Packet *p, UWSMARTOFDM_PKT_TYPE pkt_type, int dest_addr=0)
 
virtual double getBackoffTime ()
 
virtual void txData ()
 
virtual void txAck (int dest_addr)
 
virtual void txRTS ()
 
virtual void txCTS (int dest_addr, int *rcv_car, int bytesToSend)
 
virtual void stateIdle ()
 
virtual void stateSendRTS ()
 
virtual void stateSendCTS (Packet *p)
 
virtual void stateWaitCTS ()
 
virtual void stateBackoffCTS ()
 
virtual void stateRxIdle ()
 
virtual void stateTxData ()
 
virtual void stateTxAck (int dest_addr)
 
virtual void stateWaitAck ()
 
virtual void stateRxWaitAck ()
 
virtual void stateBackoff (double bt=0)
 
virtual void stateRxBackoff ()
 
virtual void stateCheckAckExpired ()
 
virtual void stateCheckBackoffExpired ()
 
virtual void stateCheckCTSBackoffExpired ()
 
virtual void stateRxData (Packet *p)
 
virtual void stateRxAck (Packet *p)
 
virtual void stateRxRTS (Packet *p)
 
virtual void stateRxCTS (Packet *p)
 
virtual void stateWaitData (double t)
 
virtual void exitBackoff ()
 
virtual void exitCTSBackoff ()
 
virtual void printStateInfo (double delay=0)
 
virtual void initInfo ()
 
virtual void refreshState (UWSMARTOFDM_STATUS state)
 
virtual void refreshReason (UWSMARTOFDM_REASON_STATUS reason)
 
virtual void incrCurrTxRounds ()
 
virtual void resetCurrTxRounds ()
 
virtual void updateRTT (double rtt)
 
virtual double getRTT ()
 
virtual double getRTSsent ()
 
virtual double getCTSsent ()
 
virtual void updateAckTimeout (double rtt)
 
virtual void updateLastDataIdRx (int id)
 
virtual void waitForUser ()
 
int getPktSeqNum (Packet *p)
 
void putPktInQueue (Packet *p)
 
void eraseItemFromPktQueue (int seq_num)
 
void putAckTimerInMap (int seq_num)
 
void eraseItemFrommapAckTimer (int seq_num)
 
virtual int getRemainingPkts ()
 
virtual void incrUpperDataRx ()
 
int getUpLayersDataPktsRx ()
 
int getHighPrioPktsSent ()
 
int getHighPrioPktsRecv ()
 
void carToBeUsed (criticalLevel c, int &top, int &bottom, int &avoid_top, int &avoid_bottom)
 
int pickFreeCarriers (int *freeC)
 
int matchCarriers (int *myFree, int *otherFree, int *matching)
 
void updateOccupancy (int *busyCar, int ntslots)
 
void clearOccTable ()
 
void resetAssignment ()
 
void printOccTable ()
 
void Mac2PhySetTxBusy (int, int get=0)
 
bool batchSending ()
 
void addInvalidCarriers (int c)
 
void removeInvalidCarrier (int c)
 
void updateInterfTable (Packet *p)
 

Protected Attributes

int max_tx_tries
 
double wait_constant
 
double backoff_tuner
 
int max_payload
 
int HDR_size
 
int ACK_size
 
int RTS_size
 
int CTS_size
 
int DATA_size
 
double ACK_timeout
 
double bitrateCar
 
int buffer_pkts
 
double alpha_
 
double max_backoff_counter
 
int uwsmartofdm_debug
 
std::vector< string > mac_carMod
 
std::vector< int > mac_carVec
 
std::vector< char > mac_prioVec
 
int mac_ncarriers
 
double mac_carrierSize
 
int ctrl_car
 
int data_car
 
bool coordinator
 
criticalLevel cLevel = LOW
 
bool car_assigned = 0
 
int nodeNum
 
std::atomic< int > current_rcvs
 
int current_macDA
 
int oTableIndex
 
int max_aval_car
 
int last_sent_data_id
 
bool print_transitions
 
bool has_buffer_queue
 
double start_tx_time
 
double srtt
 
double sumrtt
 
double sumrtt2
 
int rttsamples
 
int RTSsent = 0
 
int CTSsent = 0
 
int curr_tx_rounds
 
int last_data_id_rx
 
int recv_data_id
 
int high_prio_pkt_sent = 0
 
int high_prio_pkt_recv = 0
 
double nextAssignment
 
Packet * curr_data_pkt
 
int txsn
 
AckTimer ack_timer
 
BackOffTimer backoff_timer
 
CTSTimer CTS_timer
 
RTSTimer RTS_timer
 
DATATimer DATA_timer
 
AssignmentTimer assignment_timer
 
AssignmentValidTimer assignment_valid_timer
 
UWSMARTOFDM_REASON_STATUS last_reason
 
UWSMARTOFDM_STATUS curr_state
 
UWSMARTOFDM_STATUS prev_state
 
UWSMARTOFDM_STATUS prev_prev_state
 
UWSMARTOFDM_ACK_MODES ack_mode
 
map< pktSeqNum, Packet * > mapPacket
 
map< pktSeqNum, AckTimermapAckTimer
 
ofstream fout
 
MsgDisplayer msgDisp
 
std::vector< std::vector< int > > occupancy_table
 
std::mutex otabmtx
 
int timeslots
 
double timeslot_length
 
int max_car_reserved
 
int req_tslots
 
int current_timeslot
 
int max_rts_tries
 
int curr_rts_tries
 
int max_burst_size
 
int curr_pkt_batch
 
bool batch_sending
 
bool RTSvalid
 
double nextFreeTime
 
bool ackToSend
 
Packet * pkt_to_ack
 
int waitPkt
 
Packet * nextRTS
 
double nextRTSts
 
bool fullBand
 
std::vector< int > nouse_carriers
 
std::vector< std::vector< double > > interf_table
 

Static Protected Attributes

static bool initialized = false
 
static const double prop_speed = 1500.0
 
static map< UWSMARTOFDM_STATUS, string > status_info
 
static map< UWSMARTOFDM_REASON_STATUS, string > reason_info
 
static map< UWSMARTOFDM_PKT_TYPE, string > pkt_type_info
 
static map< criticalLevel, string > clevel_info
 

Detailed Description

This is the base class of UWSmartOFDM protocol, which is a derived class of MMac.

Member Enumeration Documentation

◆ UWSMARTOFDM_ACK_MODES

Enumeration class of UWSmartOFDM acknowledgement mode. First enumerator is given value 1. This protocol supports both acknowledgement and non-acknowledgement technique. If Acknowledgement is set, it uses Stop-And-Wait ARQ technique.

Enumerator
UWSMARTOFDM_ACK_MODE 
UWSMARTOFDM_NO_ACK_MODE 

◆ UWSMARTOFDM_PKT_TYPE

Enumeration class of UWSmartOFDM packet type. First enumerator is given value

  1. Three kinds of packets are supported by UWSmartOFDM protocol.
Enumerator
UWSMARTOFDM_ACK_PKT 
UWSMARTOFDM_DATA_PKT 
UWSMARTOFDM_DATAMAX_PKT 
UWSMARTOFDM_RTS_PKT 
UWSMARTOFDM_CTS_PKT 

◆ UWSMARTOFDM_REASON_STATUS

Enumeration class which tells the nodes the reason why it is in this state. First enumerator is given value 1.

Enumerator
UWSMARTOFDM_REASON_DATA_PENDING 
UWSMARTOFDM_REASON_DATA_NOCAR 
UWSMARTOFDM_REASON_DATA_CARASSIGNED 
UWSMARTOFDM_REASON_DATA_RX 
UWSMARTOFDM_REASON_DATA_TX 
UWSMARTOFDM_REASON_ACK_TX 
UWSMARTOFDM_REASON_ACK_RX 
UWSMARTOFDM_REASON_ACK_TIMEOUT 
UWSMARTOFDM_REASON_DATA_EMPTY 
UWSMARTOFDM_REASON_NOT_SET 
UWSMARTOFDM_REASON_MAX_TX_TRIES 
UWSMARTOFDM_REASON_START_RX 
UWSMARTOFDM_REASON_PKT_NOT_FOR_ME 
UWSMARTOFDM_REASON_WAIT_ACK_PENDING 
UWSMARTOFDM_REASON_PKT_ERROR 
UWSMARTOFDM_REASON_BACKOFF_TIMEOUT 
UWSMARTOFDM_REASON_BACKOFF_PENDING 
UWSMARTOFDM_REASON_WAIT_CTS_PENDING 
UWSMARTOFDM_REASON_CTS_TX 
UWSMARTOFDM_REASON_RTS_TX 
UWSMARTOFDM_REASON_CTS_RX 
UWSMARTOFDM_REASON_RTS_RX 
UWSMARTOFDM_REASON_CTS_BACKOFF_TIMEOUT 
UWSMARTOFDM_REASON_PHY_LAYER_RECEIVING 
UWSMARTOFDM_REASON_PHY_LAYER_SENDING 
UWSMARTOFDM_REASON_MAX_RTS_TRIES 
UWSMARTOFDM_REASON_WAIT_DATA 
UWSMARTOFDM_REASON_DATAT_EXPIRED 
UWSMARTOFDM_REASON_PREVIOUS_RTS 

◆ UWSMARTOFDM_STATUS

Enumeration class of UWSmartOFDM status. First enumerator is given value 1.

Enumerator
UWSMARTOFDM_STATE_IDLE 
UWSMARTOFDM_STATE_BACKOFF 
UWSMARTOFDM_STATE_TX_DATA 
UWSMARTOFDM_STATE_TX_ACK 
UWSMARTOFDM_STATE_WAIT_ACK 
UWSMARTOFDM_STATE_DATA_RX 
UWSMARTOFDM_STATE_ACK_RX 
UWSMARTOFDM_STATE_NOT_SET 
UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT 
UWSMARTOFDM_STATE_RX_IDLE 
UWSMARTOFDM_STATE_RX_WAIT_ACK 
UWSMARTOFDM_STATE_CHK_BACKOFF_TIMEOUT 
UWSMARTOFDM_STATE_RX_BACKOFF 
UWSMARTOFDM_STATE_WRONG_PKT_RX 
UWSMARTOFDM_STATE_TX_RTS 
UWSMARTOFDM_STATE_RX_RTS 
UWSMARTOFDM_STATE_WAIT_CTS 
UWSMARTOFDM_STATE_CTRL_BACKOFF 
UWSMARTOFDM_STATE_CHK_CTS_BACKOFF_TIMEOUT 
UWSMARTOFDM_STATE_TX_CTS 
UWSMARTOFDM_STATE_RX_CTS 
UWSMARTOFDM_STATE_RX_ACTIVE 
UWSMARTOFDM_STATE_TX_ACTIVE 
UWSMARTOFDM_STATE_WAIT_DATA 

◆ UWSMARTOFDM_TIMER_STATUS

Enumeration class of UWSmartOFDM timer status. First enumerator is given value

  1. It is employed to know the current status of a timer.
Enumerator
UWSMARTOFDM_IDLE 
UWSMARTOFDM_RUNNING 
UWSMARTOFDM_FROZEN 
UWSMARTOFDM_EXPIRED 

Constructor & Destructor Documentation

◆ UWSmartOFDM()

◆ ~UWSmartOFDM()

UWSmartOFDM::~UWSmartOFDM ( )
virtual

Destructor of UWSmartOFDM Class

Member Function Documentation

◆ addInvalidCarriers()

void UWSmartOFDM::addInvalidCarriers ( int  c)
inlineprotected

References nouse_carriers.

Referenced by command().

◆ batchSending()

bool UWSmartOFDM::batchSending ( )
protected

References batch_sending, and mapPacket.

◆ carToBeUsed()

void UWSmartOFDM::carToBeUsed ( criticalLevel  c,
int &  top,
int &  bottom,
int &  avoid_top,
int &  avoid_bottom 
)
protected

returns the current free carriers that can be given to a node top and bottom give the range avoid_top and avoid_bottom if a subrange must be avoided, 0 otherwise

References ctrl_car, data_car, HIGH, mac_carVec, mac_ncarriers, nodeNum, and uwsmartofdm_debug.

◆ clearOccTable()

void UWSmartOFDM::clearOccTable ( )
protected

clears the carriers used in the past moves the index for the current time to the next slot

References assignment_timer, ctrl_car, data_car, nouse_carriers, occupancy_table, oTableIndex, otabmtx, UWSmartOFDM::UWSmartOFDMTimer::schedule(), timeslot_length, and timeslots.

Here is the call graph for this function:

◆ command()

int UWSmartOFDM::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter. It implements the following OTcl methods:

Parameters
argcnumber of arguments in argv
argvarray of strings which are the command parameters (Note that argv[0] is the name of the object)
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or not

References ack_mode, addInvalidCarriers(), fout, getHighPrioPktsRecv(), getHighPrioPktsSent(), getUpLayersDataPktsRx(), init_macofdm_node(), initialized, initInfo(), mapPacket, print_transitions, UWSMARTOFDM_ACK_MODE, and UWSMARTOFDM_NO_ACK_MODE.

Here is the call graph for this function:

◆ computeTxTime()

double UWSmartOFDM::computeTxTime ( UWSMARTOFDM_PKT_TYPE  type)
protectedvirtual

Compute the transmission time of a packet. It uses a cross-layer message to calculate the duration of that packet.

Parameters
typeis a UWSMARTOFDM_PKT_TYPE
Returns
tranmission time of a packet which is a double data type.

References ACK_size, HDR_size, mapPacket, max_payload, UWSMARTOFDM_ACK_PKT, and UWSMARTOFDM_DATA_PKT.

◆ eraseItemFrommapAckTimer()

void UWSmartOFDM::eraseItemFrommapAckTimer ( int  seq_num)
inlineprotected

Erase an item from acknowledgement stored container.

Parameters
seq_numwhich is an integer data type.

References mapAckTimer.

Referenced by stateRxAck().

◆ eraseItemFromPktQueue()

void UWSmartOFDM::eraseItemFromPktQueue ( int  seq_num)
inlineprotected

It erases the packet from the container.

Parameters
seq_numwhich is an integer data type.

References mapPacket.

Referenced by stateRxAck(), stateSendRTS(), stateTxData(), and txData().

◆ exitBackoff()

void UWSmartOFDM::exitBackoff ( )
protectedvirtual

It stops the backoff timer.

References backoff_timer, and UWSmartOFDM::UWSmartOFDMTimer::stop().

Referenced by stateCheckBackoffExpired().

Here is the call graph for this function:

◆ exitCTSBackoff()

void UWSmartOFDM::exitCTSBackoff ( )
protectedvirtual

It stops the CTS backoff timer.

References CTS_timer, and UWSmartOFDM::UWSmartOFDMTimer::stop().

Referenced by stateCheckCTSBackoffExpired().

Here is the call graph for this function:

◆ getBackoffTime()

double UWSmartOFDM::getBackoffTime ( )
protectedvirtual

This function calculates the backoff duration and return the backoff time.It employs the exponential backoff algorithm.

Returns
backoff duration which is a double data type.

References ACK_timeout, backoff_timer, backoff_tuner, UWSmartOFDM::UWSmartOFDMTimer::getCounter(), UWSmartOFDM::UWSmartOFDMTimer::incrCounter(), max_backoff_counter, and uwsmartofdm_debug.

Referenced by stateBackoff().

Here is the call graph for this function:

◆ getCTSsent()

virtual double UWSmartOFDM::getCTSsent ( )
inlineprotectedvirtual

This method is used to get the total number of sent CTS messages.

References CTSsent.

◆ getHighPrioPktsRecv()

int UWSmartOFDM::getHighPrioPktsRecv ( )
inlineprotected

References high_prio_pkt_recv.

Referenced by command().

◆ getHighPrioPktsSent()

int UWSmartOFDM::getHighPrioPktsSent ( )
inlineprotected

References high_prio_pkt_sent.

Referenced by command().

◆ getPktSeqNum()

int UWSmartOFDM::getPktSeqNum ( Packet *  p)
inlineprotected

This method is used to get the sequence number from a packet.

Parameters
packetpointer
Returns
it returns sequence number which is an integer data type.

Referenced by putPktInQueue(), stateRxAck(), stateSendRTS(), stateTxData(), and txData().

◆ getRemainingPkts()

virtual int UWSmartOFDM::getRemainingPkts ( )
inlineprotectedvirtual

Number of packets which MAC layer receives form upper layer(s) but were not transmitted.

Returns
an integer value.

References mapPacket.

◆ getRTSsent()

virtual double UWSmartOFDM::getRTSsent ( )
inlineprotectedvirtual

This method is used to get the total number of sent RTS messages.

References RTSsent.

◆ getRTT()

virtual double UWSmartOFDM::getRTT ( )
inlineprotectedvirtual

This method is used to get the average RTT over all the receives RTT.

Returns
average RTT time which is a double data type.

References rttsamples, and sumrtt.

◆ getUpLayersDataPktsRx()

int UWSmartOFDM::getUpLayersDataPktsRx ( )
inlineprotected

Referenced by command().

◆ incrCurrTxRounds()

virtual void UWSmartOFDM::incrCurrTxRounds ( )
inlineprotectedvirtual

Increments the current transmission round of a packet. It keeps track of the number of retransmition of a packet.

References curr_tx_rounds.

Referenced by stateTxData(), and txData().

◆ incrUpperDataRx()

virtual void UWSmartOFDM::incrUpperDataRx ( )
inlineprotectedvirtual

Increment the number of Data packet receive for the upper layer.

Referenced by recvFromUpperLayers().

◆ init_macofdm_node()

void UWSmartOFDM::init_macofdm_node ( int  subCarNum,
double  carSize,
int  ctrl_subCar,
std::string  modulation 
)

◆ initInfo()

void UWSmartOFDM::initInfo ( )
protectedvirtual

This function is used to initialize the UWSmartOFDM protocol.

References initialized, pkt_type_info, print_transitions, reason_info, status_info, UWSMARTOFDM_ACK_PKT, UWSMARTOFDM_CTS_PKT, UWSMARTOFDM_DATA_PKT, UWSMARTOFDM_DATAMAX_PKT, UWSMARTOFDM_REASON_ACK_RX, UWSMARTOFDM_REASON_ACK_TIMEOUT, UWSMARTOFDM_REASON_ACK_TX, UWSMARTOFDM_REASON_BACKOFF_PENDING, UWSMARTOFDM_REASON_BACKOFF_TIMEOUT, UWSMARTOFDM_REASON_CTS_BACKOFF_TIMEOUT, UWSMARTOFDM_REASON_CTS_RX, UWSMARTOFDM_REASON_CTS_TX, UWSMARTOFDM_REASON_DATA_CARASSIGNED, UWSMARTOFDM_REASON_DATA_EMPTY, UWSMARTOFDM_REASON_DATA_NOCAR, UWSMARTOFDM_REASON_DATA_PENDING, UWSMARTOFDM_REASON_DATA_RX, UWSMARTOFDM_REASON_DATA_TX, UWSMARTOFDM_REASON_DATAT_EXPIRED, UWSMARTOFDM_REASON_MAX_RTS_TRIES, UWSMARTOFDM_REASON_MAX_TX_TRIES, UWSMARTOFDM_REASON_PHY_LAYER_RECEIVING, UWSMARTOFDM_REASON_PHY_LAYER_SENDING, UWSMARTOFDM_REASON_PKT_ERROR, UWSMARTOFDM_REASON_PKT_NOT_FOR_ME, UWSMARTOFDM_REASON_PREVIOUS_RTS, UWSMARTOFDM_REASON_RTS_RX, UWSMARTOFDM_REASON_RTS_TX, UWSMARTOFDM_REASON_START_RX, UWSMARTOFDM_REASON_WAIT_ACK_PENDING, UWSMARTOFDM_REASON_WAIT_CTS_PENDING, UWSMARTOFDM_REASON_WAIT_DATA, UWSMARTOFDM_RTS_PKT, UWSMARTOFDM_STATE_ACK_RX, UWSMARTOFDM_STATE_BACKOFF, UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT, UWSMARTOFDM_STATE_CHK_BACKOFF_TIMEOUT, UWSMARTOFDM_STATE_CTRL_BACKOFF, UWSMARTOFDM_STATE_DATA_RX, UWSMARTOFDM_STATE_IDLE, UWSMARTOFDM_STATE_RX_ACTIVE, UWSMARTOFDM_STATE_RX_BACKOFF, UWSMARTOFDM_STATE_RX_CTS, UWSMARTOFDM_STATE_RX_IDLE, UWSMARTOFDM_STATE_RX_RTS, UWSMARTOFDM_STATE_RX_WAIT_ACK, UWSMARTOFDM_STATE_TX_ACK, UWSMARTOFDM_STATE_TX_ACTIVE, UWSMARTOFDM_STATE_TX_CTS, UWSMARTOFDM_STATE_TX_DATA, UWSMARTOFDM_STATE_TX_RTS, UWSMARTOFDM_STATE_WAIT_ACK, UWSMARTOFDM_STATE_WAIT_CTS, UWSMARTOFDM_STATE_WAIT_DATA, and UWSMARTOFDM_STATE_WRONG_PKT_RX.

Referenced by command().

◆ initPkt()

void UWSmartOFDM::initPkt ( Packet *  p,
UWSMARTOFDM_PKT_TYPE  pkt_type,
int  dest_addr = 0 
)
protectedvirtual

This method, initialize the packet. If the packet is received from the upper layer, it adds the header (if any). In case of UWSmartOFDM with ARQ technique, it set the fields of ACK packet.

Parameters
Packetpointer P. The packet can be Data packet or ACK packet.
pkt_typeis an UWSMARTOFDM_PKT_TYPE. Packet can be either Data packet or ACK packet.
dest_addris a integer data type. It is initialized as 0.

References ACK_size, hdr_OFDMMAC::bytesToSend, hdr_OFDM::carMod, hdr_OFDM::carrierNum, hdr_OFDM::carriers, hdr_OFDM::carrierSize, ctrl_car, CTS_size, DATA_size, fullBand, HDR_size, mac_carMod, mac_carrierSize, mac_ncarriers, mapPacket, max_burst_size, hdr_OFDM::nativeOFDM, pkt_type_info, PT_MMAC_ACK, PT_MMAC_CTS, PT_MMAC_RTS, recv_data_id, RTS_size, UWSMARTOFDM_ACK_PKT, UWSMARTOFDM_CTS_PKT, UWSMARTOFDM_DATA_PKT, uwsmartofdm_debug, and UWSMARTOFDM_RTS_PKT.

Referenced by recvFromUpperLayers(), txAck(), txCTS(), and txRTS().

◆ Mac2PhySetTxBusy()

void UWSmartOFDM::Mac2PhySetTxBusy ( int  busy,
int  get = 0 
)
protected

◆ Mac2PhyStartTx()

void UWSmartOFDM::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

It informs that a packet transmission started.

Parameters
Packetpointer

References current_rcvs, msgDisp, MsgDisplayer::printStatus(), and uwsmartofdm_debug.

Referenced by txAck(), txCTS(), txData(), and txRTS().

Here is the call graph for this function:

◆ matchCarriers()

int UWSmartOFDM::matchCarriers ( int *  myFree,
int *  otherFree,
int *  matching 
)
protected

Returns free Carriers matching between itself and the sender to be used when an RTS is received to find carriers to include into CTS

Parameters
myFreeis node's free carriers
otherFreeis other node's free carriers
matchingis the match between myFree and otherFree
Returns
the number of matching carriers

References data_car, max_car_reserved, msgDisp, and MsgDisplayer::printStatus().

Referenced by txCTS().

Here is the call graph for this function:

◆ Phy2MacEndRx()

◆ Phy2MacEndTx()

◆ Phy2MacStartRx()

void UWSmartOFDM::Phy2MacStartRx ( const Packet *  p)
protectedvirtual

PHY layer informs the MAC layer that it is receiving a packet. @Param Packet pointer (constant)

References current_rcvs, and uwsmartofdm_debug.

◆ pickFreeCarriers()

int UWSmartOFDM::pickFreeCarriers ( int *  freeC)
protected

Returns max 5 carriers that are free in the next n time slots from occupancy table

Parameters
nis for how many timeslots I want them free,
freeCreturned carriers
Returns
number of free carriers

References data_car, occupancy_table, oTableIndex, and otabmtx.

Referenced by stateIdle(), stateRxCTS(), txCTS(), and txRTS().

◆ printOccTable()

void UWSmartOFDM::printOccTable ( )
protected

prints on terminal the table

References data_car, occupancy_table, oTableIndex, timeslots, and uwsmartofdm_debug.

Referenced by updateOccupancy().

◆ printStateInfo()

void UWSmartOFDM::printStateInfo ( double  delay = 0)
protectedvirtual

◆ putAckTimerInMap()

void UWSmartOFDM::putAckTimerInMap ( int  seq_num)
inlineprotected

Put acknowledgement timer in the container.

Parameters
seq_numwhich is an integer data type.

References ack_timer, and mapAckTimer.

Referenced by stateTxData().

◆ putPktInQueue()

void UWSmartOFDM::putPktInQueue ( Packet *  p)
inlineprotected

A node receives packet(s) from upper layer and store them in the container.

Parameters
packetpointer

References getPktSeqNum(), and mapPacket.

Referenced by recvFromUpperLayers().

Here is the call graph for this function:

◆ recvFromUpperLayers()

void UWSmartOFDM::recvFromUpperLayers ( Packet *  p)
protectedvirtual

◆ refreshReason()

virtual void UWSmartOFDM::refreshReason ( UWSMARTOFDM_REASON_STATUS  reason)
inlineprotectedvirtual

To know the reason why a node is in this current state.

Parameters
reasonis an UWSMARTOFDM_REASON_STATUS type.

References last_reason.

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxAck(), stateRxCTS(), stateRxData(), stateRxRTS(), stateSendCTS(), stateSendRTS(), stateTxData(), and stateWaitData().

◆ refreshState()

virtual void UWSmartOFDM::refreshState ( UWSMARTOFDM_STATUS  state)
inlineprotectedvirtual

Refreshes the states of the node. The node save the information of three states, they are: previous to previous state, previous state and current state of the node.

Parameters
statewhich is an UWSMARTOFDM_STATUS type.

References curr_state, prev_prev_state, and prev_state.

Referenced by stateBackoff(), stateBackoffCTS(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxAck(), stateRxBackoff(), stateRxCTS(), stateRxData(), stateRxIdle(), stateRxRTS(), stateRxWaitAck(), stateSendCTS(), stateSendRTS(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCTS(), and stateWaitData().

◆ removeInvalidCarrier()

void UWSmartOFDM::removeInvalidCarrier ( int  c)
protected

References nouse_carriers.

◆ resetAssignment()

void UWSmartOFDM::resetAssignment ( )
protected

resets value of car_assigned to FALSE

References car_assigned, and uwsmartofdm_debug.

◆ resetCurrTxRounds()

virtual void UWSmartOFDM::resetCurrTxRounds ( )
inlineprotectedvirtual

If a node is going to transmit a new packet, it resets the tx counter.

References curr_tx_rounds.

Referenced by stateTxData().

◆ stateBackoff()

◆ stateBackoffCTS()

void UWSmartOFDM::stateBackoffCTS ( )
protectedvirtual

Node is in BackoffCTS state. Waits for a CTS from coordinator.

References CTS_timer, curr_rts_tries, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), RTSvalid, UWSmartOFDM::UWSmartOFDMTimer::schedule(), and UWSMARTOFDM_STATE_CTRL_BACKOFF.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateCheckAckExpired()

void UWSmartOFDM::stateCheckAckExpired ( )
protectedvirtual

It checks whether the ack timer is already expired while it was busy with other activities.

References curr_state, mapAckTimer, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateBackoff(), stateIdle(), status_info, UWSMARTOFDM_REASON_ACK_TIMEOUT, UWSMARTOFDM_REASON_WAIT_ACK_PENDING, UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT, and UWSMARTOFDM_STATE_WAIT_ACK.

Referenced by stateTxData().

Here is the call graph for this function:

◆ stateCheckBackoffExpired()

void UWSmartOFDM::stateCheckBackoffExpired ( )
protectedvirtual

◆ stateCheckCTSBackoffExpired()

◆ stateIdle()

◆ stateRxAck()

void UWSmartOFDM::stateRxAck ( Packet *  p)
protectedvirtual

The node comes to this state if it receives an ACK packet. After receiving an ACK packet it changes it states according to the previously stored status information.

References current_rcvs, eraseItemFrommapAckTimer(), eraseItemFromPktQueue(), getPktSeqNum(), mapAckTimer, msgDisp, MsgDisplayer::printStatus(), refreshReason(), refreshState(), start_tx_time, stateIdle(), updateAckTimeout(), UWSMARTOFDM_REASON_ACK_RX, UWSMARTOFDM_STATE_ACK_RX, and UWSMARTOFDM_STATE_IDLE.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ stateRxBackoff()

void UWSmartOFDM::stateRxBackoff ( )
protectedvirtual

If a node start receiving a packet when it is in backoff state. The node first freeze (or another word, hold) the backoff timer and start receiving the packet.

References backoff_timer, UWSmartOFDM::UWSmartOFDMTimer::freeze(), print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_BACKOFF.

Here is the call graph for this function:

◆ stateRxCTS()

◆ stateRxData()

void UWSmartOFDM::stateRxData ( Packet *  p)
protectedvirtual

It process the packet which is received. After receiving a packet it changes it states according to the previously stored status information.

Parameters
<i>Data</i>packet pointer

References ack_mode, ack_timer, ackToSend, current_rcvs, DATA_timer, HDR_size, Mac2PhySetTxBusy(), msgDisp, pkt_to_ack, MsgDisplayer::printStatus(), recv_data_id, refreshReason(), refreshState(), stateBackoff(), stateIdle(), stateTxAck(), UWSmartOFDM::UWSmartOFDMTimer::stop(), UWSMARTOFDM_ACK_MODE, UWSMARTOFDM_REASON_DATA_RX, UWSMARTOFDM_STATE_DATA_RX, UWSMARTOFDM_STATE_IDLE, and waitPkt.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ stateRxIdle()

void UWSmartOFDM::stateRxIdle ( )
protectedvirtual

If a node start receiving a packet in Idle state.

References print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_IDLE.

Here is the call graph for this function:

◆ stateRxRTS()

void UWSmartOFDM::stateRxRTS ( Packet *  p)
protectedvirtual

◆ stateRxWaitAck()

void UWSmartOFDM::stateRxWaitAck ( )
protectedvirtual

If a node receives any packet while it was waiting for ACK packet, it moves to this state. The packet it is receiving can be a Data packet from another node or ACK packet.

References print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_WAIT_ACK.

Here is the call graph for this function:

◆ stateSendCTS()

void UWSmartOFDM::stateSendCTS ( Packet *  p)
protectedvirtual

Node is in sendRTS state. It has sent a CTS to the node.

References hdr_OFDMMAC::bytesToSend, DATA_size, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), txCTS(), hdr_OFDMMAC::usage_carriers, UWSMARTOFDM_REASON_CTS_TX, UWSMARTOFDM_STATE_TX_CTS, and waitPkt.

Referenced by stateIdle(), and stateRxRTS().

Here is the call graph for this function:

◆ stateSendRTS()

void UWSmartOFDM::stateSendRTS ( )
protectedvirtual

◆ stateTxAck()

void UWSmartOFDM::stateTxAck ( int  dest_addr)
protectedvirtual

If the protocl uses ARQ technique, in that case, after receiving a Data packet the node sends an ACK packet.

References ackToSend, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), txAck(), and UWSMARTOFDM_STATE_TX_ACK.

Referenced by Phy2MacEndRx(), and stateRxData().

Here is the call graph for this function:

◆ stateTxData()

◆ stateWaitAck()

void UWSmartOFDM::stateWaitAck ( )
protectedvirtual

After transmitting a Data packet, a node waits for the ACK packet.

References ACK_timeout, mapAckTimer, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), UWSMARTOFDM_STATE_WAIT_ACK, and wait_constant.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateWaitCTS()

void UWSmartOFDM::stateWaitCTS ( )
protectedvirtual

Node is in waitCTS state. Waits for a CTS from coordinator.

References msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), and UWSMARTOFDM_STATE_WAIT_CTS.

Referenced by stateCheckCTSBackoffExpired().

Here is the call graph for this function:

◆ stateWaitData()

void UWSmartOFDM::stateWaitData ( double  t)
protectedvirtual

◆ txAck()

void UWSmartOFDM::txAck ( int  dest_addr)
protectedvirtual

This methods transmits ACK packet from MAC layer to PHY layer.

Parameters
dest_addrwhich is an integer data type.

References initPkt(), Mac2PhyStartTx(), and UWSMARTOFDM_ACK_PKT.

Referenced by stateTxAck().

Here is the call graph for this function:

◆ txCTS()

void UWSmartOFDM::txCTS ( int  dest_addr,
int *  rcv_car,
int  bytesToSend 
)
protectedvirtual

This methods transmits CTS packet from MAC layer to PHY layer.

Parameters
dest_addrwhich is an integer data type.
rcv_carcarriers received in the RTS
bytesToSendbytes requested by RTS

References ack_mode, bitrateCar, CTSsent, data_car, initPkt(), Mac2PhySetTxBusy(), Mac2PhyStartTx(), matchCarriers(), msgDisp, nextFreeTime, nextRTS, pickFreeCarriers(), MsgDisplayer::printStatus(), stateIdle(), hdr_OFDMMAC::timeReserved, timeslot_length, updateOccupancy(), hdr_OFDMMAC::usage_carriers, UWSMARTOFDM_ACK_MODE, UWSMARTOFDM_CTS_PKT, and uwsmartofdm_debug.

Referenced by stateSendCTS().

Here is the call graph for this function:

◆ txData()

void UWSmartOFDM::txData ( )
protectedvirtual

This method transmits Data packets from MAC layer to PHY layer.

References ack_mode, curr_data_pkt, curr_rts_tries, eraseItemFromPktQueue(), getPktSeqNum(), incrCurrTxRounds(), Mac2PhyStartTx(), and UWSMARTOFDM_NO_ACK_MODE.

Referenced by stateTxData().

Here is the call graph for this function:

◆ txRTS()

void UWSmartOFDM::txRTS ( )
protectedvirtual

This methods transmits RTS packet from MAC layer to PHY layer.

Parameters
dest_addrwhich is an integer data type.

References curr_rts_tries, current_macDA, initPkt(), Mac2PhySetTxBusy(), Mac2PhyStartTx(), msgDisp, nextFreeTime, pickFreeCarriers(), MsgDisplayer::printStatus(), RTS_timer, RTSsent, RTSvalid, UWSmartOFDM::UWSmartOFDMTimer::schedule(), stateIdle(), hdr_OFDMMAC::usage_carriers, and UWSMARTOFDM_RTS_PKT.

Referenced by stateSendRTS().

Here is the call graph for this function:

◆ updateAckTimeout()

void UWSmartOFDM::updateAckTimeout ( double  rtt)
protectedvirtual

Like updateRTT() function.

References ACK_timeout, updateRTT(), and uwsmartofdm_debug.

Referenced by stateRxAck().

Here is the call graph for this function:

◆ updateInterfTable()

void UWSmartOFDM::updateInterfTable ( Packet *  p)
protected

References fullBand, interf_table, mac_ncarriers, msgDisp, nouse_carriers, and MsgDisplayer::printStatus().

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ updateLastDataIdRx()

virtual void UWSmartOFDM::updateLastDataIdRx ( int  id)
inlineprotectedvirtual

It updates the sequence number of the last data packet rx.

Parameters
idis an integer data type.

References last_data_id_rx.

◆ updateOccupancy()

void UWSmartOFDM::updateOccupancy ( int *  busyCar,
int  ntslots 
)
protected

updates occupancy table

Parameters
busyCarcarriers to update in occupancy table
ntslotsnumber of timeslots that will be reserved

References data_car, occupancy_table, oTableIndex, otabmtx, printOccTable(), and timeslots.

Referenced by Phy2MacEndRx(), stateRxCTS(), and txCTS().

Here is the call graph for this function:

◆ updateRTT()

void UWSmartOFDM::updateRTT ( double  rtt)
protectedvirtual

Update the Round Trip Time (RTT) which is necessary to compute the acknowledgement duration as well as backoff duration.

Parameters
rttis a double data type.

References ACK_timeout, alpha_, rttsamples, srtt, sumrtt, and sumrtt2.

Referenced by updateAckTimeout().

◆ waitForUser()

void UWSmartOFDM::waitForUser ( )
protectedvirtual

Member Data Documentation

◆ ack_mode

UWSMARTOFDM_ACK_MODES UWSmartOFDM::ack_mode
protected

Enum variable. It tells the node whether to use ARQ technique or not.

Referenced by command(), Phy2MacEndTx(), stateRxData(), txCTS(), and txData().

◆ ACK_size

int UWSmartOFDM::ACK_size
protected

Size of the ACK, if the node uses ARQ technique

Referenced by computeTxTime(), initPkt(), and UWSmartOFDM().

◆ ACK_timeout

double UWSmartOFDM::ACK_timeout
protected

ACK timeout for the initial packet

Referenced by getBackoffTime(), stateWaitAck(), updateAckTimeout(), updateRTT(), and UWSmartOFDM().

◆ ack_timer

AckTimer UWSmartOFDM::ack_timer
protected

An object of the AckTimer class

Referenced by putAckTimerInMap(), and stateRxData().

◆ ackToSend

bool UWSmartOFDM::ackToSend
protected

◆ alpha_

double UWSmartOFDM::alpha_
protected

This variable is used to tune the RTT

Referenced by updateRTT(), and UWSmartOFDM().

◆ assignment_timer

AssignmentTimer UWSmartOFDM::assignment_timer
protected

An object of the assignment timer class

Referenced by clearOccTable(), and init_macofdm_node().

◆ assignment_valid_timer

AssignmentValidTimer UWSmartOFDM::assignment_valid_timer
protected

An object of the assignment valid timer class

Referenced by stateRxCTS().

◆ backoff_timer

BackOffTimer UWSmartOFDM::backoff_timer
protected

◆ backoff_tuner

double UWSmartOFDM::backoff_tuner
protected

Tunes the backoff duration.

Referenced by getBackoffTime(), and UWSmartOFDM().

◆ batch_sending

bool UWSmartOFDM::batch_sending
protected

Referenced by batchSending().

◆ bitrateCar

double UWSmartOFDM::bitrateCar
protected

Referenced by txCTS(), and UWSmartOFDM().

◆ buffer_pkts

int UWSmartOFDM::buffer_pkts
protected

Number of packets a node can store in the container

Referenced by recvFromUpperLayers(), and UWSmartOFDM().

◆ car_assigned

bool UWSmartOFDM::car_assigned = 0
protected

◆ cLevel

criticalLevel UWSmartOFDM::cLevel = LOW
protected

◆ clevel_info

map<criticalLevel, string> UWSmartOFDM::clevel_info
staticprotected

Container which stores all the packet type information of UWSmartOFDM

◆ coordinator

bool UWSmartOFDM::coordinator
protected

◆ ctrl_car

int UWSmartOFDM::ctrl_car
protected

◆ CTS_size

int UWSmartOFDM::CTS_size
protected

Size of the ACK, if the node uses SMARTOFDM

Referenced by initPkt(), and UWSmartOFDM().

◆ CTS_timer

CTSTimer UWSmartOFDM::CTS_timer
protected

An object of the CTS timer class

Referenced by exitCTSBackoff(), stateBackoffCTS(), stateCheckCTSBackoffExpired(), and stateRxCTS().

◆ CTSsent

int UWSmartOFDM::CTSsent = 0
protected

Referenced by getCTSsent(), and txCTS().

◆ curr_data_pkt

Packet* UWSmartOFDM::curr_data_pkt
protected

Pointer of the latest selected data packet.

Referenced by stateSendRTS(), stateTxData(), and txData().

◆ curr_pkt_batch

int UWSmartOFDM::curr_pkt_batch
protected

◆ curr_rts_tries

int UWSmartOFDM::curr_rts_tries
protected

◆ curr_state

◆ curr_tx_rounds

int UWSmartOFDM::curr_tx_rounds
protected

How many times a packet is transmitted

Referenced by incrCurrTxRounds(), resetCurrTxRounds(), and stateTxData().

◆ current_macDA

int UWSmartOFDM::current_macDA
protected

◆ current_rcvs

std::atomic<int> UWSmartOFDM::current_rcvs
protected

◆ current_timeslot

int UWSmartOFDM::current_timeslot
protected

◆ data_car

◆ DATA_size

int UWSmartOFDM::DATA_size
protected

Size of the DATA packet, if the node uses SMARTOFDM

Referenced by initPkt(), stateSendCTS(), and UWSmartOFDM().

◆ DATA_timer

DATATimer UWSmartOFDM::DATA_timer
protected

An object of the DATA timer class

Referenced by stateRxData(), and stateWaitData().

◆ fout

ofstream UWSmartOFDM::fout
protected

An object of ofstream class

Referenced by command().

◆ fullBand

bool UWSmartOFDM::fullBand
protected

◆ has_buffer_queue

bool UWSmartOFDM::has_buffer_queue
protected

Whether the node has buffer to store data or not

Referenced by recvFromUpperLayers(), and UWSmartOFDM().

◆ HDR_size

int UWSmartOFDM::HDR_size
protected

Size of the HDR if any

Referenced by computeTxTime(), initPkt(), stateRxData(), and UWSmartOFDM().

◆ high_prio_pkt_recv

int UWSmartOFDM::high_prio_pkt_recv = 0
protected

Referenced by getHighPrioPktsRecv().

◆ high_prio_pkt_sent

int UWSmartOFDM::high_prio_pkt_sent = 0
protected

Referenced by getHighPrioPktsSent().

◆ initialized

bool UWSmartOFDM::initialized = false
staticprotected

It checks whether UWSmartOFDM protocol is initialized or not. If FALSE means, not initialized and if TRUE means it is initialized

Referenced by command(), and initInfo().

◆ interf_table

std::vector<std::vector<double> > UWSmartOFDM::interf_table
protected

◆ last_data_id_rx

int UWSmartOFDM::last_data_id_rx
protected

The sequence number of last received packet

Referenced by updateLastDataIdRx().

◆ last_reason

UWSMARTOFDM_REASON_STATUS UWSmartOFDM::last_reason
protected

Enum variable which stores the last reason why a node changes its state

Referenced by printStateInfo(), and refreshReason().

◆ last_sent_data_id

int UWSmartOFDM::last_sent_data_id
protected

sequence number of the last sent packet

Referenced by stateTxData().

◆ mac_carMod

std::vector<string> UWSmartOFDM::mac_carMod
protected

Referenced by init_macofdm_node(), and initPkt().

◆ mac_carrierSize

double UWSmartOFDM::mac_carrierSize
protected

Referenced by init_macofdm_node(), and initPkt().

◆ mac_carVec

std::vector<int> UWSmartOFDM::mac_carVec
protected

◆ mac_ncarriers

int UWSmartOFDM::mac_ncarriers
protected

◆ mac_prioVec

std::vector<char> UWSmartOFDM::mac_prioVec
protected

◆ mapAckTimer

map<pktSeqNum, AckTimer> UWSmartOFDM::mapAckTimer
protected

Container where acknowledgement timer(s) is stored

Referenced by eraseItemFrommapAckTimer(), putAckTimerInMap(), stateCheckAckExpired(), stateIdle(), stateRxAck(), stateTxData(), and stateWaitAck().

◆ mapPacket

map<pktSeqNum, Packet *> UWSmartOFDM::mapPacket
protected

◆ max_aval_car

int UWSmartOFDM::max_aval_car
protected

◆ max_backoff_counter

double UWSmartOFDM::max_backoff_counter
protected

Maximum number of backoff it will consider while it increases the backoff exponentially

Referenced by getBackoffTime(), and UWSmartOFDM().

◆ max_burst_size

int UWSmartOFDM::max_burst_size
protected

Referenced by initPkt(), and UWSmartOFDM().

◆ max_car_reserved

int UWSmartOFDM::max_car_reserved
protected

Referenced by matchCarriers(), and UWSmartOFDM().

◆ max_payload

int UWSmartOFDM::max_payload
protected

Maximum number of payload in a packet.

Referenced by computeTxTime(), and UWSmartOFDM().

◆ max_rts_tries

int UWSmartOFDM::max_rts_tries
protected

Referenced by stateSendRTS(), and UWSmartOFDM().

◆ max_tx_tries

int UWSmartOFDM::max_tx_tries
protected

Maximum number of retransmissions attempt.

Referenced by stateTxData(), and UWSmartOFDM().

◆ msgDisp

◆ nextAssignment

double UWSmartOFDM::nextAssignment
protected

Referenced by stateRxCTS().

◆ nextFreeTime

double UWSmartOFDM::nextFreeTime
protected

Referenced by Phy2MacEndRx(), stateRxCTS(), txCTS(), and txRTS().

◆ nextRTS

Packet* UWSmartOFDM::nextRTS
protected

Referenced by Phy2MacEndRx(), stateIdle(), and txCTS().

◆ nextRTSts

double UWSmartOFDM::nextRTSts
protected

Referenced by Phy2MacEndRx(), and stateIdle().

◆ nodeNum

int UWSmartOFDM::nodeNum
protected

Referenced by carToBeUsed(), and UWSmartOFDM().

◆ nouse_carriers

std::vector<int> UWSmartOFDM::nouse_carriers
protected

◆ occupancy_table

std::vector<std::vector<int> > UWSmartOFDM::occupancy_table
protected

◆ oTableIndex

int UWSmartOFDM::oTableIndex
protected

◆ otabmtx

std::mutex UWSmartOFDM::otabmtx
protected

◆ pkt_to_ack

Packet* UWSmartOFDM::pkt_to_ack
protected

Referenced by Phy2MacEndRx(), and stateRxData().

◆ pkt_type_info

map< UWSmartOFDM::UWSMARTOFDM_PKT_TYPE, string > UWSmartOFDM::pkt_type_info
staticprotected

Container which stores all the packet type information of UWSmartOFDM

Referenced by initInfo(), and initPkt().

◆ prev_prev_state

UWSMARTOFDM_STATUS UWSmartOFDM::prev_prev_state
protected

Enum variable. It stores the previous to previous state of a node

Referenced by refreshState().

◆ prev_state

UWSMARTOFDM_STATUS UWSmartOFDM::prev_state
protected

Enum variable. It stores the previous state of a node

Referenced by Phy2MacEndTx(), printStateInfo(), and refreshState().

◆ print_transitions

◆ prop_speed

const double UWSmartOFDM::prop_speed = 1500.0
staticprotected

Speed of the sound signal

Referenced by Phy2MacEndRx().

◆ reason_info

map< UWSmartOFDM::UWSMARTOFDM_REASON_STATUS, string > UWSmartOFDM::reason_info
staticprotected

Container which stores all the reason information

Referenced by initInfo(), and printStateInfo().

◆ recv_data_id

int UWSmartOFDM::recv_data_id
protected

The sequence number of the packet which is received

Referenced by initPkt(), and stateRxData().

◆ req_tslots

int UWSmartOFDM::req_tslots
protected

Referenced by UWSmartOFDM().

◆ RTS_size

int UWSmartOFDM::RTS_size
protected

Size of the ACK, if the node uses SMARTOFDM

Referenced by initPkt(), and UWSmartOFDM().

◆ RTS_timer

RTSTimer UWSmartOFDM::RTS_timer
protected

An object of the RTS timer class

Referenced by txRTS().

◆ RTSsent

int UWSmartOFDM::RTSsent = 0
protected

Referenced by getRTSsent(), and txRTS().

◆ RTSvalid

bool UWSmartOFDM::RTSvalid
protected

◆ rttsamples

int UWSmartOFDM::rttsamples
protected

Number of RTT samples

Referenced by getRTT(), and updateRTT().

◆ srtt

double UWSmartOFDM::srtt
protected

Smoothed Round Trip Time, calculated as for TCP

Referenced by updateRTT().

◆ start_tx_time

double UWSmartOFDM::start_tx_time
protected

Time when a packet start transmitting

Referenced by stateRxAck(), and stateTxData().

◆ status_info

map< UWSmartOFDM::UWSMARTOFDM_STATUS, string > UWSmartOFDM::status_info
staticprotected

◆ sumrtt

double UWSmartOFDM::sumrtt
protected

Sum of RTT samples

Referenced by getRTT(), and updateRTT().

◆ sumrtt2

double UWSmartOFDM::sumrtt2
protected

Sum of (RTT^2)

Referenced by updateRTT().

◆ timeslot_length

double UWSmartOFDM::timeslot_length
protected

◆ timeslots

int UWSmartOFDM::timeslots
protected

◆ txsn

int UWSmartOFDM::txsn
protected

Sequence number of the packet which is transmitted

◆ uwsmartofdm_debug

◆ wait_constant

double UWSmartOFDM::wait_constant
protected

This fixed time is used to componsate different time variations.

Referenced by stateWaitAck(), and UWSmartOFDM().

◆ waitPkt

int UWSmartOFDM::waitPkt
protected

Referenced by stateRxData(), and stateSendCTS().


The documentation for this class was generated from the following files: