DESERT 4.0.0
UWAloha Class Reference

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

#include <uwaloha.h>

Inheritance diagram for UWAloha:
Inheritance graph
Collaboration diagram for UWAloha:
Collaboration graph

Classes

class  AckTimer
 
class  BackOffTimer
 
class  UWAlohaTimer
 

Public Member Functions

 UWAloha ()
 
virtual ~UWAloha ()
 
virtual int command (int argc, const char *const *argv)
 

Protected Types

enum  UWALOHA_STATUS {
  UWALOHA_STATE_IDLE = 1 , UWALOHA_STATE_BACKOFF , UWALOHA_STATE_TX_DATA , UWALOHA_STATE_TX_ACK ,
  UWALOHA_STATE_WAIT_ACK , UWALOHA_STATE_DATA_RX , UWALOHA_STATE_ACK_RX , UWALOHA_STATE_NOT_SET ,
  UWALOHA_STATE_CHK_ACK_TIMEOUT , UWALOHA_STATE_RX_IDLE , UWALOHA_STATE_RX_WAIT_ACK , UWALOHA_STATE_CHK_BACKOFF_TIMEOUT ,
  UWALOHA_STATE_RX_BACKOFF , UWALOHA_STATE_WRONG_PKT_RX
}
 
enum  UWALOHA_REASON_STATUS {
  UWALOHA_REASON_DATA_PENDING , UWALOHA_REASON_DATA_RX , UWALOHA_REASON_DATA_TX , UWALOHA_REASON_ACK_TX ,
  UWALOHA_REASON_ACK_RX , UWALOHA_REASON_ACK_TIMEOUT , UWALOHA_REASON_DATA_EMPTY , UWALOHA_REASON_NOT_SET ,
  UWALOHA_REASON_MAX_TX_TRIES , UWALOHA_REASON_START_RX , UWALOHA_REASON_PKT_NOT_FOR_ME , UWALOHA_REASON_WAIT_ACK_PENDING ,
  UWALOHA_REASON_PKT_ERROR , UWALOHA_REASON_BACKOFF_TIMEOUT , UWALOHA_REASON_BACKOFF_PENDING
}
 
enum  UWALOHA_PKT_TYPE { UWALOHA_ACK_PKT = 1 , UWALOHA_DATA_PKT , UWALOHA_DATAMAX_PKT }
 
enum  UWALOHA_ACK_MODES { UWALOHA_ACK_MODE = 1 , UWALOHA_NO_ACK_MODE }
 
enum  UWALOHA_TIMER_STATUS { UWALOHA_IDLE = 1 , UWALOHA_RUNNING , UWALOHA_FROZEN , UWALOHA_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 (UWALOHA_PKT_TYPE type)
 
virtual void initPkt (Packet *p, UWALOHA_PKT_TYPE pkt_type, int dest_addr=0)
 
virtual double getBackoffTime ()
 
virtual void txData ()
 
virtual void txAck (int dest_addr)
 
virtual void stateIdle ()
 
virtual void stateRxIdle ()
 
virtual void stateTxData ()
 
virtual void stateTxAck (int dest_addr)
 
virtual void stateWaitAck ()
 
virtual void stateRxWaitAck ()
 
virtual void stateBackoff ()
 
virtual void stateRxBackoff ()
 
virtual void stateCheckAckExpired ()
 
virtual void stateCheckBackoffExpired ()
 
virtual void stateRxData (Packet *p)
 
virtual void stateRxAck (Packet *p)
 
virtual void exitBackoff ()
 
virtual void printStateInfo (double delay=0)
 
virtual void initInfo ()
 
virtual void refreshState (UWALOHA_STATUS state)
 
virtual void refreshReason (UWALOHA_REASON_STATUS reason)
 
virtual void incrCurrTxRounds ()
 
virtual void resetCurrTxRounds ()
 
virtual void updateRTT (double rtt)
 
virtual double getRTT ()
 
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 ()
 

Protected Attributes

int max_tx_tries
 
double wait_constant
 
double backoff_tuner
 
int max_payload
 
int HDR_size
 
int ACK_size
 
double ACK_timeout
 
int buffer_pkts
 
double alpha_
 
int max_backoff_counter
 
int uwaloha_debug
 
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 curr_tx_rounds
 
int last_data_id_rx
 
int recv_data_id
 
Packet * curr_data_pkt
 
int txsn
 
AckTimer ack_timer
 
BackOffTimer backoff_timer
 
UWALOHA_REASON_STATUS last_reason
 
UWALOHA_STATUS curr_state
 
UWALOHA_STATUS prev_state
 
UWALOHA_STATUS prev_prev_state
 
UWALOHA_ACK_MODES ack_mode
 
map< pktSeqNum, Packet * > mapPacket
 
map< pktSeqNum, AckTimermapAckTimer
 
ofstream fout
 

Static Protected Attributes

static bool initialized = false
 
static const double prop_speed = 1500.0
 
static map< UWALOHA_STATUS, string > status_info
 
static map< UWALOHA_REASON_STATUS, string > reason_info
 
static map< UWALOHA_PKT_TYPE, string > pkt_type_info
 

Detailed Description

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

Member Enumeration Documentation

◆ UWALOHA_ACK_MODES

Enumeration class of UWAloha 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
UWALOHA_ACK_MODE 
UWALOHA_NO_ACK_MODE 

◆ UWALOHA_PKT_TYPE

enum UWAloha::UWALOHA_PKT_TYPE
protected

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

  1. Three kinds of packets are supported by UWAloha protocol.
Enumerator
UWALOHA_ACK_PKT 
UWALOHA_DATA_PKT 
UWALOHA_DATAMAX_PKT 

◆ UWALOHA_REASON_STATUS

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

Enumerator
UWALOHA_REASON_DATA_PENDING 
UWALOHA_REASON_DATA_RX 
UWALOHA_REASON_DATA_TX 
UWALOHA_REASON_ACK_TX 
UWALOHA_REASON_ACK_RX 
UWALOHA_REASON_ACK_TIMEOUT 
UWALOHA_REASON_DATA_EMPTY 
UWALOHA_REASON_NOT_SET 
UWALOHA_REASON_MAX_TX_TRIES 
UWALOHA_REASON_START_RX 
UWALOHA_REASON_PKT_NOT_FOR_ME 
UWALOHA_REASON_WAIT_ACK_PENDING 
UWALOHA_REASON_PKT_ERROR 
UWALOHA_REASON_BACKOFF_TIMEOUT 
UWALOHA_REASON_BACKOFF_PENDING 

◆ UWALOHA_STATUS

enum UWAloha::UWALOHA_STATUS
protected

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

Enumerator
UWALOHA_STATE_IDLE 
UWALOHA_STATE_BACKOFF 
UWALOHA_STATE_TX_DATA 
UWALOHA_STATE_TX_ACK 
UWALOHA_STATE_WAIT_ACK 
UWALOHA_STATE_DATA_RX 
UWALOHA_STATE_ACK_RX 
UWALOHA_STATE_NOT_SET 
UWALOHA_STATE_CHK_ACK_TIMEOUT 
UWALOHA_STATE_RX_IDLE 
UWALOHA_STATE_RX_WAIT_ACK 
UWALOHA_STATE_CHK_BACKOFF_TIMEOUT 
UWALOHA_STATE_RX_BACKOFF 
UWALOHA_STATE_WRONG_PKT_RX 

◆ UWALOHA_TIMER_STATUS

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

  1. It is employed to know the current status of a timer.
Enumerator
UWALOHA_IDLE 
UWALOHA_RUNNING 
UWALOHA_FROZEN 
UWALOHA_EXPIRED 

Constructor & Destructor Documentation

◆ UWAloha()

◆ ~UWAloha()

UWAloha::~UWAloha ( )
virtual

Destructor of UWAloha Class

Member Function Documentation

◆ command()

int UWAloha::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, fout, getUpLayersDataPktsRx(), initialized, initInfo(), mapPacket, print_transitions, UWALOHA_ACK_MODE, and UWALOHA_NO_ACK_MODE.

Here is the call graph for this function:

◆ computeTxTime()

double UWAloha::computeTxTime ( UWALOHA_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 UWALOHA_PKT_TYPE
Returns
tranmission time of a packet which is a double data type.

References ACK_size, HDR_size, mapPacket, max_payload, UWALOHA_ACK_PKT, and UWALOHA_DATA_PKT.

◆ eraseItemFrommapAckTimer()

void UWAloha::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 UWAloha::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(), stateTxData(), and txData().

◆ exitBackoff()

void UWAloha::exitBackoff ( )
protectedvirtual

It stops the backoff timer.

References backoff_timer, and UWAloha::UWAlohaTimer::stop().

Referenced by stateCheckBackoffExpired().

Here is the call graph for this function:

◆ getBackoffTime()

double UWAloha::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, UWAloha::UWAlohaTimer::getCounter(), UWAloha::UWAlohaTimer::incrCounter(), max_backoff_counter, and uwaloha_debug.

Referenced by stateBackoff().

Here is the call graph for this function:

◆ getPktSeqNum()

int UWAloha::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(), stateTxData(), and txData().

◆ getRemainingPkts()

virtual int UWAloha::getRemainingPkts ( )
inlineprotectedvirtual

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

Returns
an integer value.

References mapPacket.

◆ getRTT()

virtual double UWAloha::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 UWAloha::getUpLayersDataPktsRx ( )
inlineprotected

Referenced by command().

◆ incrCurrTxRounds()

virtual void UWAloha::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 UWAloha::incrUpperDataRx ( )
inlineprotectedvirtual

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

Referenced by recvFromUpperLayers().

◆ initInfo()

◆ initPkt()

void UWAloha::initPkt ( Packet *  p,
UWALOHA_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 UWAloha 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 UWALOHA_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_size, PT_MMAC_ACK, recv_data_id, UWALOHA_ACK_PKT, and UWALOHA_DATA_PKT.

Referenced by recvFromUpperLayers(), and txAck().

◆ Mac2PhyStartTx()

void UWAloha::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

It informs that a packet transmission started.

Parameters
Packetpointer

References uwaloha_debug.

Referenced by txAck(), and txData().

◆ Phy2MacEndRx()

void UWAloha::Phy2MacEndRx ( Packet *  p)
protectedvirtual

PHY layer informs the MAC layer that the reception of the packet is over.

Parameters
Packetpointer.

References curr_state, prop_speed, PT_MMAC_ACK, refreshReason(), stateRxAck(), stateRxData(), status_info, uwaloha_debug, UWALOHA_REASON_ACK_RX, UWALOHA_REASON_DATA_RX, UWALOHA_REASON_PKT_ERROR, UWALOHA_REASON_PKT_NOT_FOR_ME, and UWALOHA_STATE_WAIT_ACK.

Here is the call graph for this function:

◆ Phy2MacEndTx()

void UWAloha::Phy2MacEndTx ( const Packet *  p)
protectedvirtual

It infroms that a packet transmission end.

Parameters
Packetpointer

References ack_mode, curr_state, refreshReason(), stateIdle(), stateWaitAck(), status_info, UWALOHA_ACK_MODE, uwaloha_debug, UWALOHA_REASON_ACK_TX, UWALOHA_REASON_DATA_TX, UWALOHA_STATE_IDLE, UWALOHA_STATE_TX_ACK, UWALOHA_STATE_TX_DATA, and UWALOHA_STATE_WAIT_ACK.

Here is the call graph for this function:

◆ Phy2MacStartRx()

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

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

References uwaloha_debug.

◆ printStateInfo()

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

◆ putAckTimerInMap()

void UWAloha::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 UWAloha::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 UWAloha::recvFromUpperLayers ( Packet *  p)
protectedvirtual

This function receives the packet from upper layer and save it in the queue.

Parameters
Packetpointer

References buffer_pkts, curr_state, has_buffer_queue, incrUpperDataRx(), initPkt(), mapPacket, putPktInQueue(), refreshReason(), stateTxData(), UWALOHA_DATA_PKT, UWALOHA_REASON_DATA_PENDING, and UWALOHA_STATE_IDLE.

Here is the call graph for this function:

◆ refreshReason()

virtual void UWAloha::refreshReason ( UWALOHA_REASON_STATUS  reason)
inlineprotectedvirtual

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

Parameters
reasonis an UWALOHA_REASON_STATUS type.

References last_reason.

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateRxAck(), stateRxData(), and stateTxData().

◆ refreshState()

virtual void UWAloha::refreshState ( UWALOHA_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 UWALOHA_STATUS type.

References curr_state, prev_prev_state, and prev_state.

Referenced by stateBackoff(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateIdle(), stateRxAck(), stateRxBackoff(), stateRxData(), stateRxIdle(), stateRxWaitAck(), stateTxAck(), stateTxData(), and stateWaitAck().

◆ resetCurrTxRounds()

virtual void UWAloha::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()

void UWAloha::stateBackoff ( )
protectedvirtual

◆ stateCheckAckExpired()

void UWAloha::stateCheckAckExpired ( )
protectedvirtual

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

References curr_state, mapAckTimer, print_transitions, printStateInfo(), refreshReason(), refreshState(), stateBackoff(), stateIdle(), status_info, uwaloha_debug, UWALOHA_REASON_ACK_TIMEOUT, UWALOHA_REASON_WAIT_ACK_PENDING, UWALOHA_STATE_CHK_ACK_TIMEOUT, and UWALOHA_STATE_WAIT_ACK.

Referenced by stateTxData().

Here is the call graph for this function:

◆ stateCheckBackoffExpired()

void UWAloha::stateCheckBackoffExpired ( )
protectedvirtual

◆ stateIdle()

void UWAloha::stateIdle ( )
protectedvirtual

Node is in Idle state. It only changes its state if it has packet(s) to transmit or it receives a packet.

References backoff_timer, mapAckTimer, mapPacket, print_transitions, printStateInfo(), refreshState(), stateTxData(), UWAloha::UWAlohaTimer::stop(), uwaloha_debug, and UWALOHA_STATE_IDLE.

Referenced by Phy2MacEndTx(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateRxAck(), stateRxData(), and stateTxData().

Here is the call graph for this function:

◆ stateRxAck()

void UWAloha::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 eraseItemFrommapAckTimer(), eraseItemFromPktQueue(), getPktSeqNum(), mapAckTimer, refreshReason(), refreshState(), start_tx_time, stateIdle(), updateAckTimeout(), uwaloha_debug, UWALOHA_REASON_ACK_RX, and UWALOHA_STATE_ACK_RX.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ stateRxBackoff()

void UWAloha::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, UWAloha::UWAlohaTimer::freeze(), print_transitions, printStateInfo(), refreshState(), and UWALOHA_STATE_RX_BACKOFF.

Here is the call graph for this function:

◆ stateRxData()

void UWAloha::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, HDR_size, recv_data_id, refreshReason(), refreshState(), stateIdle(), stateTxAck(), UWAloha::UWAlohaTimer::stop(), UWALOHA_ACK_MODE, uwaloha_debug, UWALOHA_REASON_DATA_RX, and UWALOHA_STATE_DATA_RX.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ stateRxIdle()

void UWAloha::stateRxIdle ( )
protectedvirtual

If a node start receiving a packet in Idle state.

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

Here is the call graph for this function:

◆ stateRxWaitAck()

void UWAloha::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 UWALOHA_STATE_RX_WAIT_ACK.

Here is the call graph for this function:

◆ stateTxAck()

void UWAloha::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 print_transitions, printStateInfo(), refreshState(), txAck(), uwaloha_debug, and UWALOHA_STATE_TX_ACK.

Referenced by stateRxData().

Here is the call graph for this function:

◆ stateTxData()

◆ stateWaitAck()

void UWAloha::stateWaitAck ( )
protectedvirtual

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

References ACK_timeout, mapAckTimer, print_transitions, printStateInfo(), refreshState(), uwaloha_debug, UWALOHA_STATE_WAIT_ACK, and wait_constant.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ txAck()

void UWAloha::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 UWALOHA_ACK_PKT.

Referenced by stateTxAck().

Here is the call graph for this function:

◆ txData()

void UWAloha::txData ( )
protectedvirtual

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

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

Referenced by stateTxData().

Here is the call graph for this function:

◆ updateAckTimeout()

void UWAloha::updateAckTimeout ( double  rtt)
protectedvirtual

Like updateRTT() function.

References ACK_timeout, updateRTT(), and uwaloha_debug.

Referenced by stateRxAck().

Here is the call graph for this function:

◆ updateLastDataIdRx()

virtual void UWAloha::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.

◆ updateRTT()

void UWAloha::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 UWAloha::waitForUser ( )
protectedvirtual

Member Data Documentation

◆ ack_mode

UWALOHA_ACK_MODES UWAloha::ack_mode
protected

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

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

◆ ACK_size

int UWAloha::ACK_size
protected

Size of the ACK, if the node uses ARQ technique

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

◆ ACK_timeout

double UWAloha::ACK_timeout
protected

ACK timeout for the initial packet

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

◆ ack_timer

AckTimer UWAloha::ack_timer
protected

An object of the AckTimer class

Referenced by putAckTimerInMap(), and stateRxData().

◆ alpha_

double UWAloha::alpha_
protected

This variable is used to tune the RTT

Referenced by updateRTT(), and UWAloha().

◆ backoff_timer

BackOffTimer UWAloha::backoff_timer
protected

◆ backoff_tuner

double UWAloha::backoff_tuner
protected

Tunes the backoff duration.

Referenced by getBackoffTime(), and UWAloha().

◆ buffer_pkts

int UWAloha::buffer_pkts
protected

Number of packets a node can store in the container

Referenced by recvFromUpperLayers(), and UWAloha().

◆ curr_data_pkt

Packet* UWAloha::curr_data_pkt
protected

Pointer of the latest selected data packet.

Referenced by stateTxData(), and txData().

◆ curr_state

UWALOHA_STATUS UWAloha::curr_state
protected

Enum variable. It stores the current state of a node

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), recvFromUpperLayers(), refreshState(), stateCheckAckExpired(), and stateCheckBackoffExpired().

◆ curr_tx_rounds

int UWAloha::curr_tx_rounds
protected

How many times a packet is transmitted

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

◆ fout

ofstream UWAloha::fout
protected

An object of ofstream class

Referenced by command(), and printStateInfo().

◆ has_buffer_queue

bool UWAloha::has_buffer_queue
protected

Whether the node has buffer to store data or not

Referenced by recvFromUpperLayers(), and UWAloha().

◆ HDR_size

int UWAloha::HDR_size
protected

Size of the HDR if any

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

◆ initialized

bool UWAloha::initialized = false
staticprotected

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

Referenced by command(), and initInfo().

◆ last_data_id_rx

int UWAloha::last_data_id_rx
protected

The sequence number of last received packet

Referenced by updateLastDataIdRx().

◆ last_reason

UWALOHA_REASON_STATUS UWAloha::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 UWAloha::last_sent_data_id
protected

sequence number of the last sent packet

Referenced by stateTxData().

◆ mapAckTimer

map<pktSeqNum, AckTimer> UWAloha::mapAckTimer
protected

Container where acknowledgement timer(s) is stored

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

◆ mapPacket

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

◆ max_backoff_counter

int UWAloha::max_backoff_counter
protected

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

Referenced by getBackoffTime(), and UWAloha().

◆ max_payload

int UWAloha::max_payload
protected

Maximum number of payload in a packet.

Referenced by computeTxTime(), and UWAloha().

◆ max_tx_tries

int UWAloha::max_tx_tries
protected

Maximum number of transmissions for one packet.

Referenced by stateTxData(), and UWAloha().

◆ pkt_type_info

map< UWAloha::UWALOHA_PKT_TYPE, string > UWAloha::pkt_type_info
staticprotected

Container which stores all the packet type information of UWAloha

Referenced by initInfo().

◆ prev_prev_state

UWALOHA_STATUS UWAloha::prev_prev_state
protected

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

Referenced by refreshState().

◆ prev_state

UWALOHA_STATUS UWAloha::prev_state
protected

Enum variable. It stores the previous state of a node

Referenced by printStateInfo(), and refreshState().

◆ print_transitions

bool UWAloha::print_transitions
protected

◆ prop_speed

const double UWAloha::prop_speed = 1500.0
staticprotected

Speed of the sound signal

Referenced by Phy2MacEndRx().

◆ reason_info

map< UWAloha::UWALOHA_REASON_STATUS, string > UWAloha::reason_info
staticprotected

Container which stores all the reason information

Referenced by initInfo(), and printStateInfo().

◆ recv_data_id

int UWAloha::recv_data_id
protected

The sequence number of the packet which is received

Referenced by initPkt(), and stateRxData().

◆ rttsamples

int UWAloha::rttsamples
protected

Number of RTT samples

Referenced by getRTT(), and updateRTT().

◆ srtt

double UWAloha::srtt
protected

Smoothed Round Trip Time, calculated as for TCP

Referenced by updateRTT().

◆ start_tx_time

double UWAloha::start_tx_time
protected

Time when a packet start transmitting

Referenced by stateRxAck(), and stateTxData().

◆ status_info

map< UWAloha::UWALOHA_STATUS, string > UWAloha::status_info
staticprotected

Container which stores all the status information

Referenced by initInfo(), Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), stateCheckAckExpired(), and stateCheckBackoffExpired().

◆ sumrtt

double UWAloha::sumrtt
protected

Sum of RTT samples

Referenced by getRTT(), and updateRTT().

◆ sumrtt2

double UWAloha::sumrtt2
protected

Sum of (RTT^2)

Referenced by updateRTT().

◆ txsn

int UWAloha::txsn
protected

Sequence number of the packet which is transmitted

◆ uwaloha_debug

◆ wait_constant

double UWAloha::wait_constant
protected

This fixed time is used to componsate different time variations.

Referenced by stateWaitAck(), and UWAloha().


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