DESERT 4.0.0
MMacTLOHI Class Reference

#include <uw-mac-TLohi.h>

Inheritance diagram for MMacTLOHI:
Inheritance graph
Collaboration diagram for MMacTLOHI:
Collaboration graph

Public Member Functions

 MMacTLOHI ()
 
virtual ~MMacTLOHI ()
 
virtual int command (int argc, const char *const *argv)
 
virtual int crLayCommand (ClMessage *m)
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual double computeTxTime (TLOHI_PKT_TYPE type)
 
virtual void initPkt (Packet *p, TLOHI_PKT_TYPE pkt_type)
 
virtual void getBackoffTime ()
 
virtual double getCRduration ()
 
virtual void checkDataPhy ()
 
virtual int countContenders (double time)
 
virtual void txTone ()
 
virtual void txData ()
 
virtual void txAck ()
 
virtual void rxTone (Packet *p)
 
virtual void rxAck (Packet *p)
 
virtual void rxElse (Packet *p)
 
virtual void stateIdle ()
 
virtual void stateBackoff ()
 
virtual void stateStartContention ()
 
virtual void stateWaitEndContention ()
 
virtual void stateCountContenders ()
 
virtual void stateTxData ()
 
virtual void stateSleep ()
 
virtual void stateWaitAck ()
 
virtual void stateWaitXAck ()
 
virtual void stateDataReceived (Packet *data_pkt)
 
virtual void stateTxAck ()
 
virtual void stateRecontendWindow ()
 
virtual void stateWaitCR ()
 
virtual void printStateInfo (double delay=0)
 
virtual void initInfo ()
 
virtual void initData ()
 
virtual void initMphyIds ()
 
virtual void refreshState (TLOHI_STATUS state)
 
virtual void refreshReason (TLOHI_REASON_STATUS reason)
 
virtual void exitBackoff ()
 
virtual void setDestAddr (int mac_addr)
 
virtual void setSessionDistance (double distance)
 
virtual void checkPhyInit ()
 
virtual void incrCurrTxRounds ()
 
virtual void resetSession ()
 
virtual void queuePop (bool flag)
 
virtual void waitForUser ()
 
virtual void incrTonePktsTx ()
 
virtual void incrTonePktsRx ()
 
virtual void incrCurrTxTries ()
 
virtual void resetStats ()
 
virtual int getRemainingPkts ()
 
virtual int getTonePktsTx ()
 
virtual int getTonePktsRx ()
 
virtual int getUpLayersDataPktsRx ()
 

Protected Attributes

int tone_pkts_tx
 
int tone_pkts_rx
 
double max_prop_delay
 
int max_tx_rounds
 
double max_tx_tries
 
double backoff_tuner
 
double wait_costant
 
int max_payload
 
int HDR_size
 
int ACK_size
 
double sleep_timeout
 
double DATA_listen_timeout
 
double ACK_timeout
 
double recontend_time
 
double tone_data_delay
 
int buffer_pkts
 
queue< Packet * > Q
 
bool TxActive
 
bool session_active
 
bool backoff_pending
 
bool tone_transmitted
 
bool print_transitions
 
bool mphy_ids_initialized
 
bool has_buffer_queue
 
TLOHI_ACK_MODE ack_mode
 
TLOHI_MODE op_mode
 
int tone_phy_id
 
int data_phy_id
 
double CR_duration
 
int curr_dest_addr
 
int last_data_id_tx
 
int last_data_id_rx
 
Packet * curr_data_pkt
 
int curr_contenders
 
int curr_tx_rounds
 
int curr_tx_tries
 
TLOHI_REASON_STATUS last_reason
 
TLOHI_STATUS curr_state
 
TLOHI_STATUS prev_state
 
double session_distance
 
double backoff_start_time
 
double backoff_duration
 
double backoff_remaining
 
int u_data_id
 
int txsn
 
string tcl_modulation
 
Timer timer
 
DataTimer data_phy_timer
 
ofstream fout
 

Static Protected Attributes

static bool initialized = false
 
static int u_pkt_id
 
static map< TLOHI_STATUS, string > status_info
 
static map< TLOHI_REASON_STATUS, string > reason_info
 
static map< TLOHI_PKT_TYPE, string > pkt_type_info
 

Friends

class Timer
 
class DataTimer
 

Detailed Description

Class that represents the T-LOHI MAC protocol for a node

Constructor & Destructor Documentation

◆ MMacTLOHI()

◆ ~MMacTLOHI()

MMacTLOHI::~MMacTLOHI ( )
virtual

Destructor of the class

Member Function Documentation

◆ checkDataPhy()

void MMacTLOHI::checkDataPhy ( )
protectedvirtual

Checks if the PHY layer for Data is active. If not, actives it for a fixed amout of time

References DATA_listen_timeout, data_phy_id, data_phy_timer, and wait_costant.

Referenced by rxTone().

◆ checkPhyInit()

void MMacTLOHI::checkPhyInit ( )
protectedvirtual

Checks if the PHY layers (for DATA and TONE) are initialized

References initialized, and mphy_ids_initialized.

Referenced by command().

◆ command()

int MMacTLOHI::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 successfully or not.

References ACK_MODE, ack_mode, AGGRESSIVE_UNSYNC_MODE, checkPhyInit(), computeTxTime(), CONSERVATIVE_UNSYNC_MODE, CR_duration, data_phy_id, fout, getCRduration(), getTonePktsRx(), getTonePktsTx(), getUpLayersDataPktsRx(), initData(), initialized, initInfo(), initMphyIds(), max_prop_delay, NO_ACK_MODE, op_mode, print_transitions, Q, tcl_modulation, tone_phy_id, and TONE_PKT.

Here is the call graph for this function:

◆ computeTxTime()

double MMacTLOHI::computeTxTime ( TLOHI_PKT_TYPE  type)
protectedvirtual

Computes the Transmission Time of a Packet using a CrLayer Message to ask the PHY to perform this calculation

Parameters
TLOHI_PKT_TYPEtype of the packet

References ACK_PKT, ACK_size, data_phy_id, DATA_PKT, HDR_size, max_payload, PT_WKUP, Q, tone_phy_id, and TONE_PKT.

Referenced by command(), countContenders(), initData(), rxTone(), and stateWaitXAck().

◆ countContenders()

int MMacTLOHI::countContenders ( double  time)
protectedvirtual

Returns the number of Contenders in this Contention Round based on the number of tones received

Parameters
doubletime interval at which count the contenders
Returns
the number of contenders

References computeTxTime(), and TONE_PKT.

Referenced by rxTone().

Here is the call graph for this function:

◆ crLayCommand()

int MMacTLOHI::crLayCommand ( ClMessage *  m)
virtual

Cross-Layer messages interpreter

Parameters
ClMessage*an instance of ClMessage that represent the message received
Returns
0 if successful.

◆ exitBackoff()

void MMacTLOHI::exitBackoff ( )
protectedvirtual

Reset the timer for Backoff (i.e. after the reception of an ACK packet

References backoff_duration, backoff_pending, backoff_remaining, backoff_start_time, NOT_SET, and timer.

◆ getBackoffTime()

void MMacTLOHI::getBackoffTime ( )
protectedvirtual

Performs the calculation of the Backoff timer

References backoff_duration, CR_duration, and curr_contenders.

Referenced by stateBackoff().

◆ getCRduration()

virtual double MMacTLOHI::getCRduration ( )
inlineprotectedvirtual

Returns the duration of the Contention Round, where the nodes contend the channel

Returns
CR_duration

References CR_duration.

Referenced by command().

◆ getRemainingPkts()

virtual int MMacTLOHI::getRemainingPkts ( )
inlineprotectedvirtual

returns the number of Packet remained in the queue at the end of the simulation

Returns
number of packet remained in the queue

References Q.

◆ getTonePktsRx()

virtual int MMacTLOHI::getTonePktsRx ( )
inlineprotectedvirtual

returns the number of tones received in the simulation

Returns
number of tones received

References tone_pkts_rx.

Referenced by command().

◆ getTonePktsTx()

virtual int MMacTLOHI::getTonePktsTx ( )
inlineprotectedvirtual

returns the number of tones transmitted in the simulation

Returns
number of tones transmitted

References tone_pkts_tx.

Referenced by command().

◆ getUpLayersDataPktsRx()

virtual int MMacTLOHI::getUpLayersDataPktsRx ( )
inlineprotectedvirtual

Referenced by command().

◆ incrCurrTxRounds()

virtual void MMacTLOHI::incrCurrTxRounds ( )
inlineprotectedvirtual

Increments the number of times a packet has been transmitted

References curr_tx_rounds.

Referenced by txData().

◆ incrCurrTxTries()

virtual void MMacTLOHI::incrCurrTxTries ( )
inlineprotectedvirtual

Increments the number of tries for the transmission of a packet

References curr_tx_tries.

Referenced by txData().

◆ incrTonePktsRx()

virtual void MMacTLOHI::incrTonePktsRx ( )
inlineprotectedvirtual

Increments the number of the TONE received

References tone_pkts_rx.

Referenced by rxTone().

◆ incrTonePktsTx()

virtual void MMacTLOHI::incrTonePktsTx ( )
inlineprotectedvirtual

Increments the number of the TONE sended

References tone_pkts_tx.

Referenced by txTone().

◆ initData()

void MMacTLOHI::initData ( )
protectedvirtual

Initializes the information of the protocol related to the data PHY layers (i.e. the duration of the timers, the length of the buffers for data packets)

References ACK_MODE, ack_mode, ACK_PKT, ACK_timeout, buffer_pkts, computeTxTime(), DATA_listen_timeout, DATA_PKT, has_buffer_queue, max_prop_delay, max_tx_tries, sleep_timeout, TONE_PKT, and wait_costant.

Referenced by command(), and initMphyIds().

Here is the call graph for this function:

◆ initInfo()

◆ initMphyIds()

void MMacTLOHI::initMphyIds ( )
protectedvirtual

Initializes the ID of the PHY layer for tone and Data

References data_phy_id, initData(), mphy_ids_initialized, tcl_modulation, and tone_phy_id.

Referenced by command().

Here is the call graph for this function:

◆ initPkt()

void MMacTLOHI::initPkt ( Packet *  p,
TLOHI_PKT_TYPE  pkt_type 
)
protectedvirtual

Init the packet with the MAC address of the receiver and the sender, the size of the packet and the type

Parameters
UWPOLLING_PKT_TYPEthe type of the packet

References ACK_PKT, ACK_size, curr_dest_addr, DATA_PKT, hdr_tlohi::data_sn, HDR_size, hdr_tlohi::orig_type, hdr_tlohi::pkt_type, PT_TLOHI, PT_WKUP, hdr_tlohi::sn, TONE_PKT, hdr_tlohi::ts, txsn, u_data_id, and u_pkt_id.

Referenced by recvFromUpperLayers(), txAck(), and txTone().

◆ Phy2MacEndRx()

void MMacTLOHI::Phy2MacEndRx ( Packet *  p)
protectedvirtual

Method called when the Phy Layer finish to receive a Packet

Parameters
constPacket* Pointer to an object of type Packet that rapresent the packet received

References ACK_MODE, ack_mode, ACK_PKT, curr_dest_addr, curr_state, DATA_PKT, hdr_tlohi::pkt_type, pkt_type_info, PT_TLOHI, PT_WKUP, queuePop(), REASON_ACK_RX, REASON_XACK_RX, REASON_XDATA_RX, refreshReason(), rxTone(), setDestAddr(), STATE_IDLE, STATE_SLEEP, STATE_WAIT_ACK, STATE_WAIT_XACK, stateDataReceived(), stateIdle(), stateRecontendWindow(), stateWaitXAck(), and status_info.

Here is the call graph for this function:

◆ Phy2MacEndTx()

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

Method called when the PHY layer finish to transmit the packet.

Parameters
Packet*Pointer to an object of type Packet that rapresent the Packet transmitted

References ACK_MODE, ack_mode, curr_state, REASON_ACK_TX, REASON_DATA_TX, REASON_TONE_TX, refreshReason(), STATE_IDLE, STATE_RECONTEND_WINDOW, STATE_START_CONTENTION, STATE_TX_ACK, STATE_TX_DATA, STATE_WAIT_ACK, STATE_WAIT_END_CONTENTION, stateIdle(), stateRecontendWindow(), stateWaitAck(), stateWaitEndContention(), status_info, tone_transmitted, txAck(), TxActive, and txData().

Here is the call graph for this function:

◆ Phy2MacStartRx()

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

Method called when the Phy Layer start to receive a Packet

Parameters
constPacket* Pointer to an object of type Packet that rapresent the Packet that is in reception

References ACK_PKT, data_phy_timer, DATA_PKT, PT_TLOHI, and wait_costant.

◆ printStateInfo()

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

Initializes the protocol at the beginning of the simulation. This method is called by a command in tcl.

Parameters
doubledelay
See also
command method

References curr_state, fout, last_reason, prev_state, reason_info, STATE_BACKOFF, and status_info.

Referenced by stateBackoff(), stateCountContenders(), stateDataReceived(), stateIdle(), stateRecontendWindow(), stateSleep(), stateStartContention(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCR(), stateWaitEndContention(), and stateWaitXAck().

◆ queuePop()

virtual void MMacTLOHI::queuePop ( bool  flag)
inlineprotectedvirtual

Pop the first element of the data packets queue

References Q.

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

◆ recvFromUpperLayers()

void MMacTLOHI::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Receives the packet from the upper layer (e.g. IP)

Parameters
Packet*pointer to the packet received

References buffer_pkts, curr_state, DATA_PKT, has_buffer_queue, initPkt(), last_reason, Q, REASON_DATA_PENDING, session_active, STATE_IDLE, and stateStartContention().

Here is the call graph for this function:

◆ refreshReason()

virtual void MMacTLOHI::refreshReason ( TLOHI_REASON_STATUS  reason)
inlineprotectedvirtual

Refresh the reason for the change of state of the protocol

References last_reason.

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), rxTone(), stateCountContenders(), stateDataReceived(), stateIdle(), and stateRecontendWindow().

◆ refreshState()

virtual void MMacTLOHI::refreshState ( TLOHI_STATUS  state)
inlineprotectedvirtual

◆ resetSession()

void MMacTLOHI::resetSession ( )
protectedvirtual

Resets the variable related to the Session (i.e. the distance between transmitter and receiver, the MAC address of the destination

References curr_contenders, curr_dest_addr, curr_tx_rounds, NOT_SET, session_distance, and SESSION_DISTANCE_NOT_SET.

Referenced by stateIdle().

◆ resetStats()

virtual void MMacTLOHI::resetStats ( )
inlineprotectedvirtual

Resets the variables related to the Statiscal computation

References tone_pkts_rx, and tone_pkts_tx.

◆ rxAck()

void MMacTLOHI::rxAck ( Packet *  p)
protectedvirtual

Method that receive an ACK packet

Parameters
Packet*pointer to the ACK packet received

◆ rxElse()

void MMacTLOHI::rxElse ( Packet *  p)
protectedvirtual

Receives other types of packets

Parameters
Packet*pointer to packet received

◆ rxTone()

void MMacTLOHI::rxTone ( Packet *  p)
protectedvirtual

◆ setDestAddr()

virtual void MMacTLOHI::setDestAddr ( int  mac_addr)
inlineprotectedvirtual

Store the MAC address of the destination for this session

References curr_dest_addr.

Referenced by Phy2MacEndRx().

◆ setSessionDistance()

virtual void MMacTLOHI::setSessionDistance ( double  distance)
inlineprotectedvirtual

Set the distance between transmitter and receiver for this session

References session_distance.

◆ stateBackoff()

void MMacTLOHI::stateBackoff ( )
protectedvirtual

The node is in Backoff state

References backoff_duration, backoff_pending, backoff_start_time, getBackoffTime(), print_transitions, printStateInfo(), refreshState(), STATE_BACKOFF, and timer.

Referenced by stateCountContenders().

Here is the call graph for this function:

◆ stateCountContenders()

void MMacTLOHI::stateCountContenders ( )
protectedvirtual

The node counts the contenders in the CR

References curr_contenders, print_transitions, printStateInfo(), REASON_CONTENDERS, REASON_NO_CONTENDERS, refreshReason(), refreshState(), STATE_COUNT_CONTENDERS, stateBackoff(), stateTxData(), and timer.

Here is the call graph for this function:

◆ stateDataReceived()

void MMacTLOHI::stateDataReceived ( Packet *  data_pkt)
protectedvirtual

◆ stateIdle()

◆ stateRecontendWindow()

void MMacTLOHI::stateRecontendWindow ( )
protectedvirtual

Calculate the duration of the RecontendWindow

References print_transitions, printStateInfo(), Q, REASON_DATA_EMPTY, recontend_time, refreshReason(), refreshState(), STATE_RECONTEND_WINDOW, stateIdle(), and timer.

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), and stateDataReceived().

Here is the call graph for this function:

◆ stateSleep()

void MMacTLOHI::stateSleep ( )
protectedvirtual

Simulate the sleep modality of the PHY layer of the node, while the node is waiting for the DATA

References print_transitions, printStateInfo(), refreshState(), sleep_timeout, STATE_SLEEP, and timer.

Referenced by rxTone().

Here is the call graph for this function:

◆ stateStartContention()

void MMacTLOHI::stateStartContention ( )
protectedvirtual

The node starts the Contention sending a Tone

References curr_data_pkt, curr_dest_addr, print_transitions, printStateInfo(), Q, refreshState(), session_active, STATE_START_CONTENTION, timer, and txTone().

Referenced by recvFromUpperLayers(), and stateIdle().

Here is the call graph for this function:

◆ stateTxAck()

void MMacTLOHI::stateTxAck ( )
protectedvirtual

The node transmit the ACK packet for a received DATA packet (in ACK_MODE modality)

References print_transitions, printStateInfo(), refreshState(), STATE_TX_ACK, timer, tone_transmitted, and txAck().

Referenced by stateDataReceived().

Here is the call graph for this function:

◆ stateTxData()

void MMacTLOHI::stateTxData ( )
protectedvirtual

The node has won the CR. He can now sends a DATA packet

References print_transitions, printStateInfo(), refreshState(), STATE_TX_DATA, timer, and txTone().

Referenced by stateCountContenders().

Here is the call graph for this function:

◆ stateWaitAck()

void MMacTLOHI::stateWaitAck ( )
protectedvirtual

The node has just sent a DATA packet. Now he's waiting for the ACK (in ACK_MODE modality)

References ACK_timeout, print_transitions, printStateInfo(), refreshState(), STATE_WAIT_ACK, timer, and wait_costant.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateWaitCR()

void MMacTLOHI::stateWaitCR ( )
protectedvirtual

Set the duration of the timer of the duration of the Contention Round

References CR_duration, print_transitions, printStateInfo(), refreshState(), STATE_WAIT_END_CR, and timer.

Here is the call graph for this function:

◆ stateWaitEndContention()

void MMacTLOHI::stateWaitEndContention ( )
protectedvirtual

The nodes waits the end of Contention listening the channel for possible contenders

References CR_duration, print_transitions, printStateInfo(), refreshState(), STATE_WAIT_END_CONTENTION, and timer.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateWaitXAck()

void MMacTLOHI::stateWaitXAck ( )
protectedvirtual

The node has just received a DATA packet intended for another node. Now he's waiting for the ACK from the receiver of the DATA packet (in ACK_MODE modality)

References ACK_PKT, computeTxTime(), max_prop_delay, print_transitions, printStateInfo(), refreshState(), STATE_WAIT_XACK, timer, TONE_PKT, and wait_costant.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ txAck()

void MMacTLOHI::txAck ( )
protectedvirtual

Send a ACK packet of the data PHY layer

References ACK_PKT, data_phy_id, initPkt(), and TxActive.

Referenced by Phy2MacEndTx(), and stateTxAck().

Here is the call graph for this function:

◆ txData()

void MMacTLOHI::txData ( )
protectedvirtual

Send a DATA packet to the data PHY layer

References ack_mode, curr_data_pkt, data_phy_id, incrCurrTxRounds(), incrCurrTxTries(), NO_ACK_MODE, queuePop(), and TxActive.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ txTone()

void MMacTLOHI::txTone ( )
protectedvirtual

Send the Tone to the tone PHY layer

References incrTonePktsTx(), initPkt(), tone_phy_id, TONE_PKT, tone_transmitted, and TxActive.

Referenced by stateStartContention(), and stateTxData().

Here is the call graph for this function:

◆ waitForUser()

void MMacTLOHI::waitForUser ( )
protectedvirtual

Used for debug purposes (permits a step-by-step behaviour of the protocol

Friends And Related Symbol Documentation

◆ DataTimer

friend class DataTimer
friend

DataTimer class

◆ Timer

friend class Timer
friend

Timer class

Member Data Documentation

◆ ack_mode

TLOHI_ACK_MODE MMacTLOHI::ack_mode
protected

ACK mode of the protocol

Referenced by command(), initData(), Phy2MacEndRx(), Phy2MacEndTx(), stateDataReceived(), and txData().

◆ ACK_size

int MMacTLOHI::ACK_size
protected

Size of the ACK packet in bytes

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

◆ ACK_timeout

double MMacTLOHI::ACK_timeout
protected

Time needed for the reception of a ACK packet

Referenced by initData(), and stateWaitAck().

◆ backoff_duration

double MMacTLOHI::backoff_duration
protected

Duration of the backoff timer

Referenced by exitBackoff(), getBackoffTime(), and stateBackoff().

◆ backoff_pending

bool MMacTLOHI::backoff_pending
protected

Flag that indicates if a backoff timer is pending

Referenced by exitBackoff(), and stateBackoff().

◆ backoff_remaining

double MMacTLOHI::backoff_remaining
protected

Remaining time of the backoff (if the timer has been freezed)

Referenced by exitBackoff().

◆ backoff_start_time

double MMacTLOHI::backoff_start_time
protected

Timestamp of the backoff start time

Referenced by exitBackoff(), and stateBackoff().

◆ backoff_tuner

double MMacTLOHI::backoff_tuner
protected

Multiplier factor in the calculation of the backoff

◆ buffer_pkts

int MMacTLOHI::buffer_pkts
protected

Buffer capacity in number of packets

Referenced by initData(), MMacTLOHI(), and recvFromUpperLayers().

◆ CR_duration

double MMacTLOHI::CR_duration
protected

Contention Round Duration

Referenced by command(), getBackoffTime(), getCRduration(), stateWaitCR(), and stateWaitEndContention().

◆ curr_contenders

int MMacTLOHI::curr_contenders
protected

Number of contenders in current Contention Round

Referenced by getBackoffTime(), resetSession(), rxTone(), and stateCountContenders().

◆ curr_data_pkt

Packet* MMacTLOHI::curr_data_pkt
protected

Pointer to the current data packet

Referenced by stateStartContention(), and txData().

◆ curr_dest_addr

int MMacTLOHI::curr_dest_addr
protected

Current destination MAC address

Referenced by initPkt(), Phy2MacEndRx(), resetSession(), setDestAddr(), and stateStartContention().

◆ curr_state

TLOHI_STATUS MMacTLOHI::curr_state
protected

Current state of the protocol

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

◆ curr_tx_rounds

int MMacTLOHI::curr_tx_rounds
protected

Number of current transmission round

Referenced by incrCurrTxRounds(), and resetSession().

◆ curr_tx_tries

int MMacTLOHI::curr_tx_tries
protected

Number of current transmission tries

Referenced by incrCurrTxTries(), and stateIdle().

◆ DATA_listen_timeout

double MMacTLOHI::DATA_listen_timeout
protected

Time needed for the reception of a DATA packet

Referenced by checkDataPhy(), and initData().

◆ data_phy_id

int MMacTLOHI::data_phy_id
protected

ID of the DATA PHY layer

Referenced by checkDataPhy(), command(), computeTxTime(), initMphyIds(), txAck(), and txData().

◆ data_phy_timer

DataTimer MMacTLOHI::data_phy_timer
protected

Timer that describe the time needed to receive the packet (i.e. the data PHY layer wake up for the duration of the reception, then go to sleep again

Referenced by checkDataPhy(), and Phy2MacStartRx().

◆ fout

ofstream MMacTLOHI::fout
protected

Object that handle the output file for the state transition of the protocol

Referenced by command(), and printStateInfo().

◆ has_buffer_queue

bool MMacTLOHI::has_buffer_queue
protected

Flag that indicates whether the node has a buffer queue

Referenced by initData(), MMacTLOHI(), and recvFromUpperLayers().

◆ HDR_size

int MMacTLOHI::HDR_size
protected

Dimension of the header added by T-LOHI in bytes

Referenced by computeTxTime(), initPkt(), MMacTLOHI(), and stateDataReceived().

◆ initialized

bool MMacTLOHI::initialized = false
staticprotected

Flag that indicates if the protocol is initialized

Referenced by checkPhyInit(), command(), and initInfo().

◆ last_data_id_rx

int MMacTLOHI::last_data_id_rx
protected

Last data packet transmitted ID

◆ last_data_id_tx

int MMacTLOHI::last_data_id_tx
protected

Last data packet received ID

Referenced by stateIdle().

◆ last_reason

TLOHI_REASON_STATUS MMacTLOHI::last_reason
protected

Last reason for state transition of the protocol

Referenced by printStateInfo(), recvFromUpperLayers(), and refreshReason().

◆ max_payload

int MMacTLOHI::max_payload
protected

Maximum Data payload dimension in number of bytes

Referenced by computeTxTime(), and MMacTLOHI().

◆ max_prop_delay

double MMacTLOHI::max_prop_delay
protected

Maximum propagation delay in the network

Referenced by command(), initData(), MMacTLOHI(), and stateWaitXAck().

◆ max_tx_rounds

int MMacTLOHI::max_tx_rounds
protected

Maximum transmission round for one packet

Referenced by MMacTLOHI().

◆ max_tx_tries

double MMacTLOHI::max_tx_tries
protected

Maximum transmission tries for one packet

Referenced by initData(), MMacTLOHI(), and stateIdle().

◆ mphy_ids_initialized

bool MMacTLOHI::mphy_ids_initialized
protected

Flag that indicates if the IDs of the PHY layers is stored

Referenced by checkPhyInit(), and initMphyIds().

◆ op_mode

TLOHI_MODE MMacTLOHI::op_mode
protected

Operational mode of the protocol

Referenced by command().

◆ pkt_type_info

map< TLOHI_PKT_TYPE, string > MMacTLOHI::pkt_type_info
staticprotected

Map between the pkt-type and the description of the packet

Referenced by initInfo(), and Phy2MacEndRx().

◆ prev_state

TLOHI_STATUS MMacTLOHI::prev_state
protected

Previous state of the protocol

Referenced by printStateInfo(), and refreshState().

◆ print_transitions

bool MMacTLOHI::print_transitions
protected

Flat that indicates if the modality in which the protocol write in a file the state transitions is active

Referenced by command(), initInfo(), stateBackoff(), stateCountContenders(), stateDataReceived(), stateIdle(), stateRecontendWindow(), stateSleep(), stateStartContention(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCR(), stateWaitEndContention(), and stateWaitXAck().

◆ Q

queue<Packet *> MMacTLOHI::Q
protected

◆ reason_info

map< TLOHI_REASON_STATUS, string > MMacTLOHI::reason_info
staticprotected

Map between the reason for state transitions and the description of this reason

Referenced by initInfo(), and printStateInfo().

◆ recontend_time

double MMacTLOHI::recontend_time
protected

Time needed for the recontention

Referenced by MMacTLOHI(), and stateRecontendWindow().

◆ session_active

bool MMacTLOHI::session_active
protected

Flag that indicates if a Session is active

Referenced by recvFromUpperLayers(), stateIdle(), and stateStartContention().

◆ session_distance

double MMacTLOHI::session_distance
protected

Distance between transmitter and receiver in this session

Referenced by resetSession(), setSessionDistance(), and stateIdle().

◆ sleep_timeout

double MMacTLOHI::sleep_timeout
protected

Duration of the sleep phase for the PHY layer

Referenced by initData(), and stateSleep().

◆ status_info

map< TLOHI_STATUS, string > MMacTLOHI::status_info
staticprotected

Map between the state and the textual description of the state

Referenced by initInfo(), Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), and rxTone().

◆ tcl_modulation

string MMacTLOHI::tcl_modulation
protected

Type of modulation adopted for data PHY layer

Referenced by command(), initMphyIds(), and MMacTLOHI().

◆ timer

◆ tone_data_delay

double MMacTLOHI::tone_data_delay
protected

Not used anymore

Referenced by MMacTLOHI().

◆ tone_phy_id

int MMacTLOHI::tone_phy_id
protected

ID of the tone PHY layer

Referenced by command(), computeTxTime(), initMphyIds(), and txTone().

◆ tone_pkts_rx

int MMacTLOHI::tone_pkts_rx
protected

Number of tone received

Referenced by getTonePktsRx(), incrTonePktsRx(), and resetStats().

◆ tone_pkts_tx

int MMacTLOHI::tone_pkts_tx
protected

Number of tone transmitted

Referenced by getTonePktsTx(), incrTonePktsTx(), and resetStats().

◆ tone_transmitted

bool MMacTLOHI::tone_transmitted
protected

Flag that indicates if a tone has been transmitted

Referenced by Phy2MacEndTx(), stateTxAck(), and txTone().

◆ TxActive

bool MMacTLOHI::TxActive
protected

Flag that indicates if a transmission is occuring

Referenced by Phy2MacEndTx(), txAck(), txData(), and txTone().

◆ txsn

int MMacTLOHI::txsn
protected

Transmitted data serial number

Referenced by initPkt().

◆ u_data_id

int MMacTLOHI::u_data_id
protected

simulation-unique data packet ID

Referenced by initPkt().

◆ u_pkt_id

int MMacTLOHI::u_pkt_id
staticprotected

simulation-unique packet ID

Referenced by initPkt(), and MMacTLOHI().

◆ wait_costant

double MMacTLOHI::wait_costant
protected

Additive factor in the calculation of ACK timer

Referenced by checkDataPhy(), initData(), MMacTLOHI(), Phy2MacStartRx(), stateWaitAck(), and stateWaitXAck().


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