DESERT 3.5.1
Loading...
Searching...
No Matches
CsmaAloha Class Reference

#include <uw-csma-aloha.h>

Inheritance diagram for CsmaAloha:
Collaboration diagram for CsmaAloha:

Classes

class  AckTimer
 
class  AlohaTimer
 
class  BackOffTimer
 
class  ListenTimer
 

Public Member Functions

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

Protected Types

enum  CSMA_STATUS {
  CSMA_STATE_IDLE = 1 , CSMA_STATE_BACKOFF , CSMA_STATE_TX_DATA , CSMA_STATE_TX_ACK ,
  CSMA_STATE_WAIT_ACK , CSMA_STATE_DATA_RX , CSMA_STATE_ACK_RX , CSMA_STATE_NOT_SET ,
  CSMA_STATE_LISTEN , CSMA_STATE_CHK_ACK_TIMEOUT , CSMA_STATE_CHK_LISTEN_TIMEOUT , CSMA_STATE_CHK_BACKOFF_TIMEOUT ,
  CSMA_STATE_RX_IDLE , CSMA_STATE_RX_LISTEN , CSMA_STATE_RX_BACKOFF , CSMA_STATE_RX_WAIT_ACK ,
  CSMA_STATE_WRONG_PKT_RX
}
 
enum  CSMA_REASON_STATUS {
  CSMA_REASON_DATA_PENDING , CSMA_REASON_DATA_RX , CSMA_REASON_DATA_TX , CSMA_REASON_ACK_TX ,
  CSMA_REASON_ACK_RX , CSMA_REASON_BACKOFF_TIMEOUT , CSMA_REASON_ACK_TIMEOUT , CSMA_REASON_DATA_EMPTY ,
  CSMA_REASON_NOT_SET , CSMA_REASON_MAX_TX_TRIES , CSMA_REASON_BACKOFF_PENDING , CSMA_REASON_LISTEN ,
  CSMA_REASON_LISTEN_TIMEOUT , CSMA_REASON_LISTEN_PENDING , CSMA_REASON_START_RX , CSMA_REASON_PKT_NOT_FOR_ME ,
  CSMA_REASON_WAIT_ACK_PENDING , CSMA_REASON_PKT_ERROR
}
 
enum  CSMA_PKT_TYPE { CSMA_ACK_PKT = 1 , CSMA_DATA_PKT , CSMA_DATAMAX_PKT }
 
enum  CSMA_ACK_MODES { CSMA_ACK_MODE = 1 , CSMA_NO_ACK_MODE }
 
enum  CSMA_TIMER_STATUS { CSMA_IDLE = 1 , CSMA_RUNNING , CSMA_FROZEN , CSMA_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 (CSMA_PKT_TYPE type)
 
virtual void initPkt (Packet *p, CSMA_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 stateBackoff ()
 
virtual void stateRxBackoff ()
 
virtual void stateWaitAck ()
 
virtual void stateRxWaitAck ()
 
virtual void stateListen ()
 
virtual void stateRxListen ()
 
virtual void stateCheckListenExpired ()
 
virtual void stateCheckAckExpired ()
 
virtual void stateCheckBackoffExpired ()
 
virtual void stateRxData (Packet *p)
 
virtual void stateRxAck (Packet *p)
 
virtual void stateRxPacketNotForMe (Packet *p)
 
virtual void printStateInfo (double delay=0)
 
virtual void initInfo ()
 
virtual void refreshState (CSMA_STATUS state)
 
virtual void refreshReason (CSMA_REASON_STATUS reason)
 
virtual void exitBackoff ()
 
virtual void setSessionDistance (double distance)
 
virtual bool keepDataPkt (int serial_number)
 
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 queuePop (bool flag=true)
 
virtual void resetSession ()
 
virtual void waitForUser ()
 
virtual int getRemainingPkts ()
 
virtual void incrUpperDataRx ()
 
virtual int getUpLayersDataPktsRx ()
 

Protected Attributes

int max_tx_tries
 
double backoff_tuner
 
double wait_costant
 
int max_payload
 
int HDR_size
 
int ACK_size
 
double ACK_timeout
 
int buffer_pkts
 
double alpha_
 
int max_backoff_counter
 
double listen_time
 
std::queue< Packet * > Q
 
std::queue< int > data_sn_queue
 
int u_data_id
 
int last_sent_data_id
 
bool TxActive
 
bool RxActive
 
bool session_active
 
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
 
Packet * curr_data_pkt
 
double session_distance
 
AckTimer ack_timer
 
BackOffTimer backoff_timer
 
ListenTimer listen_timer
 
CSMA_REASON_STATUS last_reason
 
CSMA_STATUS curr_state
 
CSMA_STATUS prev_state
 
CSMA_STATUS prev_prev_state
 
CSMA_ACK_MODES ack_mode
 
ofstream fout
 

Static Protected Attributes

static const double prop_speed = 1500.0
 
static bool initialized = false
 
static int u_pkt_id
 
static map< CSMA_STATUS, string > status_info
 
static map< CSMA_REASON_STATUS, string > reason_info
 
static map< CSMA_PKT_TYPE, string > pkt_type_info
 

Detailed Description

Class that describes a CsmaAloha module.

Definition at line 68 of file uw-csma-aloha.h.

Member Enumeration Documentation

◆ CSMA_ACK_MODES

enum CsmaAloha::CSMA_ACK_MODES
protected
Enumerator
CSMA_ACK_MODE 
CSMA_NO_ACK_MODE 

Definition at line 150 of file uw-csma-aloha.h.

◆ CSMA_PKT_TYPE

enum CsmaAloha::CSMA_PKT_TYPE
protected
Enumerator
CSMA_ACK_PKT 
CSMA_DATA_PKT 
CSMA_DATAMAX_PKT 

Definition at line 147 of file uw-csma-aloha.h.

◆ CSMA_REASON_STATUS

Enumerator
CSMA_REASON_DATA_PENDING 
CSMA_REASON_DATA_RX 
CSMA_REASON_DATA_TX 
CSMA_REASON_ACK_TX 
CSMA_REASON_ACK_RX 
CSMA_REASON_BACKOFF_TIMEOUT 
CSMA_REASON_ACK_TIMEOUT 
CSMA_REASON_DATA_EMPTY 
CSMA_REASON_NOT_SET 
CSMA_REASON_MAX_TX_TRIES 
CSMA_REASON_BACKOFF_PENDING 
CSMA_REASON_LISTEN 
CSMA_REASON_LISTEN_TIMEOUT 
CSMA_REASON_LISTEN_PENDING 
CSMA_REASON_START_RX 
CSMA_REASON_PKT_NOT_FOR_ME 
CSMA_REASON_WAIT_ACK_PENDING 
CSMA_REASON_PKT_ERROR 

Definition at line 125 of file uw-csma-aloha.h.

◆ CSMA_STATUS

enum CsmaAloha::CSMA_STATUS
protected
Enumerator
CSMA_STATE_IDLE 
CSMA_STATE_BACKOFF 
CSMA_STATE_TX_DATA 
CSMA_STATE_TX_ACK 
CSMA_STATE_WAIT_ACK 
CSMA_STATE_DATA_RX 
CSMA_STATE_ACK_RX 
CSMA_STATE_NOT_SET 
CSMA_STATE_LISTEN 
CSMA_STATE_CHK_ACK_TIMEOUT 
CSMA_STATE_CHK_LISTEN_TIMEOUT 
CSMA_STATE_CHK_BACKOFF_TIMEOUT 
CSMA_STATE_RX_IDLE 
CSMA_STATE_RX_LISTEN 
CSMA_STATE_RX_BACKOFF 
CSMA_STATE_RX_WAIT_ACK 
CSMA_STATE_WRONG_PKT_RX 

Definition at line 104 of file uw-csma-aloha.h.

◆ CSMA_TIMER_STATUS

Enumerator
CSMA_IDLE 
CSMA_RUNNING 
CSMA_FROZEN 
CSMA_EXPIRED 

Definition at line 153 of file uw-csma-aloha.h.

Constructor & Destructor Documentation

◆ CsmaAloha()

CsmaAloha::CsmaAloha ( )

Constructor of the CsmaAloha class.

Definition at line 149 of file uw-csma-aloha.cpp.

◆ ~CsmaAloha()

CsmaAloha::~CsmaAloha ( )
virtual

Destructor of the CsmaAloha class.

Definition at line 199 of file uw-csma-aloha.cpp.

Member Function Documentation

◆ command()

int CsmaAloha::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.

Definition at line 205 of file uw-csma-aloha.cpp.

◆ computeTxTime()

double CsmaAloha::computeTxTime ( CSMA_PKT_TYPE  type)
protectedvirtual

Compute the time needed to transmit the packet (using a CrLayerMessage to ask the PHY to perform the computation)

Parameters
CMSA_PKT_TYPEType of the packet

Definition at line 345 of file uw-csma-aloha.cpp.

◆ crLayCommand()

int CsmaAloha::crLayCommand ( ClMessage *  m)
virtual

Cross-Layer messages interpreter.

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

Definition at line 244 of file uw-csma-aloha.cpp.

◆ exitBackoff()

void CsmaAloha::exitBackoff ( )
protectedvirtual

Method called when the Backoff timer is expired.

Definition at line 371 of file uw-csma-aloha.cpp.

◆ getBackoffTime()

double CsmaAloha::getBackoffTime ( )
protectedvirtual

compute the BackOff time as backoff = backoff_tuner*random*2*ACK_timeout*2^(counter) where counter is a value incremented each time this method is called and backoff_tuner is a multiplier factor chosen by the user

Definition at line 377 of file uw-csma-aloha.cpp.

◆ getRemainingPkts()

virtual int CsmaAloha::getRemainingPkts ( )
inlineprotectedvirtual

Return the number of packets not transmitted (remained in the protocol queue) at the end of the simulation.

Returns
the size of the queue at the end of the simulation

Definition at line 709 of file uw-csma-aloha.h.

◆ getRTT()

virtual double CsmaAloha::getRTT ( )
inlineprotectedvirtual

get the value of RTT as mean of all the rttsamples

Returns
RTT value

Definition at line 658 of file uw-csma-aloha.h.

◆ getUpLayersDataPktsRx()

virtual int CsmaAloha::getUpLayersDataPktsRx ( )
inlineprotectedvirtual

Definition at line 724 of file uw-csma-aloha.h.

◆ incrCurrTxRounds()

virtual void CsmaAloha::incrCurrTxRounds ( )
inlineprotectedvirtual

Increases the number of times a packet is re-transmitted.

Definition at line 631 of file uw-csma-aloha.h.

◆ incrUpperDataRx()

virtual void CsmaAloha::incrUpperDataRx ( )
inlineprotectedvirtual

Increase the number of Data packet Received from the Upper layers.

Definition at line 718 of file uw-csma-aloha.h.

◆ initInfo()

void CsmaAloha::initInfo ( )
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

Definition at line 254 of file uw-csma-aloha.cpp.

◆ initPkt()

void CsmaAloha::initPkt ( Packet *  p,
CSMA_PKT_TYPE  pkt_type,
int  dest_addr = 0 
)
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

Definition at line 420 of file uw-csma-aloha.cpp.

◆ keepDataPkt()

bool CsmaAloha::keepDataPkt ( int  serial_number)
protectedvirtual

Checks if the data packet received is a double packet (using the serial number of the packet)

Parameters
intserial number of the received packet
Returns
true if the serial number of the last data pacekt received is greater than the serial number of the last data packet received. false otherwise

Definition at line 333 of file uw-csma-aloha.cpp.

◆ Mac2PhyStartTx()

void CsmaAloha::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

Pass the packet to the PHY layer.

Parameters
Packet*Pointer to an object of type Packet that represent the Packet to transmit

Definition at line 447 of file uw-csma-aloha.cpp.

◆ Phy2MacEndRx()

void CsmaAloha::Phy2MacEndRx ( Packet *  p)
protectedvirtual

Method called when the Phy Layer finish to receive a Packet.

Parameters
Packet*Pointer to an object of type Packet that represent the Packet received

Definition at line 580 of file uw-csma-aloha.cpp.

◆ Phy2MacEndTx()

void CsmaAloha::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 represent the Packet transmitted

Definition at line 457 of file uw-csma-aloha.cpp.

◆ Phy2MacStartRx()

void CsmaAloha::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 represent the Packet that is in reception

Definition at line 544 of file uw-csma-aloha.cpp.

◆ printStateInfo()

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

Prints in a file the textual information of the current state and the transitions reasons.

Parameters
doubletime lapse from the call of the method and the effective write process in the file (setted to zero by default)

Definition at line 1057 of file uw-csma-aloha.cpp.

◆ queuePop()

virtual void CsmaAloha::queuePop ( bool  flag = true)
inlineprotectedvirtual

Pop the first element of the data packet queue.

Definition at line 683 of file uw-csma-aloha.h.

◆ recvFromUpperLayers()

void CsmaAloha::recvFromUpperLayers ( Packet *  p)
protectedvirtual

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

IP)

Parameters
Packet*pointer to the packet received

Definition at line 400 of file uw-csma-aloha.cpp.

◆ refreshReason()

virtual void CsmaAloha::refreshReason ( CSMA_REASON_STATUS  reason)
inlineprotectedvirtual

Refresh the reason for the change of state.

Definition at line 599 of file uw-csma-aloha.h.

◆ refreshState()

virtual void CsmaAloha::refreshState ( CSMA_STATUS  state)
inlineprotectedvirtual

Refresh the State of the protocol.

Definition at line 588 of file uw-csma-aloha.h.

◆ resetCurrTxRounds()

virtual void CsmaAloha::resetCurrTxRounds ( )
inlineprotectedvirtual

Reset the number of times a data pacekt is re-transmitted.

Definition at line 640 of file uw-csma-aloha.h.

◆ resetSession()

void CsmaAloha::resetSession ( )
protectedvirtual

Resets the current session (e.g.

the session distance)

Definition at line 306 of file uw-csma-aloha.cpp.

◆ setSessionDistance()

virtual void CsmaAloha::setSessionDistance ( double  distance)
inlineprotectedvirtual

Set the distance between the sender and the receiver.

Parameters
doubleDistance between the sender and the receiver

Definition at line 613 of file uw-csma-aloha.h.

◆ stateBackoff()

void CsmaAloha::stateBackoff ( )
protectedvirtual

BackOff STATE.

An ACK packet is lost. A backoff timer is set up. When the timer expire the protocol will re-send the data packet

Definition at line 843 of file uw-csma-aloha.cpp.

◆ stateCheckAckExpired()

void CsmaAloha::stateCheckAckExpired ( )
protectedvirtual

Checks if the ACK reception timer is expired.

Definition at line 730 of file uw-csma-aloha.cpp.

◆ stateCheckBackoffExpired()

void CsmaAloha::stateCheckBackoffExpired ( )
protectedvirtual

Checks if the Backoff period is expired.

Definition at line 755 of file uw-csma-aloha.cpp.

◆ stateCheckListenExpired()

void CsmaAloha::stateCheckListenExpired ( )
protectedvirtual

Checks if the Listen period is expired.

Definition at line 699 of file uw-csma-aloha.cpp.

◆ stateIdle()

void CsmaAloha::stateIdle ( )
protectedvirtual

IDLE state.

Each variable is resetted

Definition at line 781 of file uw-csma-aloha.cpp.

◆ stateListen()

void CsmaAloha::stateListen ( )
protectedvirtual

State in which the node is listening the channel.

Definition at line 813 of file uw-csma-aloha.cpp.

◆ stateRxAck()

void CsmaAloha::stateRxAck ( Packet *  p)
protectedvirtual

state in which an ACK packet is received

Definition at line 1016 of file uw-csma-aloha.cpp.

◆ stateRxBackoff()

void CsmaAloha::stateRxBackoff ( )
protectedvirtual

State in which a reception is occurring while the protocol is in the backoff state.

Definition at line 859 of file uw-csma-aloha.cpp.

◆ stateRxData()

void CsmaAloha::stateRxData ( Packet *  p)
protectedvirtual

State in which a DATA packet is received.

Definition at line 947 of file uw-csma-aloha.cpp.

◆ stateRxIdle()

void CsmaAloha::stateRxIdle ( )
protectedvirtual

A reception is occuring while the protocol is in IDLE state.

Definition at line 804 of file uw-csma-aloha.cpp.

◆ stateRxListen()

void CsmaAloha::stateRxListen ( )
protectedvirtual

State in which a reception is occuring while the node is listening the channel.

Definition at line 834 of file uw-csma-aloha.cpp.

◆ stateRxPacketNotForMe()

void CsmaAloha::stateRxPacketNotForMe ( Packet *  p)
protectedvirtual

state in which a wrong Packet is received

Definition at line 660 of file uw-csma-aloha.cpp.

◆ stateRxWaitAck()

void CsmaAloha::stateRxWaitAck ( )
protectedvirtual

State in which a reception is occuring while the node is waiting an ACK.

Definition at line 924 of file uw-csma-aloha.cpp.

◆ stateTxAck()

void CsmaAloha::stateTxAck ( int  dest_addr)
protectedvirtual

State in which the protocol set-up the ACK packet to transmit.

Parameters
intMAC address of the destination of the ACK packet

Definition at line 933 of file uw-csma-aloha.cpp.

◆ stateTxData()

void CsmaAloha::stateTxData ( )
protectedvirtual

State in which the protocol allows the node to transmit a data packet.

Definition at line 869 of file uw-csma-aloha.cpp.

◆ stateWaitAck()

void CsmaAloha::stateWaitAck ( )
protectedvirtual

State in which a DATA packet is sent.

The time-out for receiving a ACK is set-up

Definition at line 909 of file uw-csma-aloha.cpp.

◆ txAck()

void CsmaAloha::txAck ( int  dest_addr)
protectedvirtual

Transmits the ACK packet (calling Mac2PhyStartTx) and increment the counter of transmitted ACK packets.

Parameters
inMAC address of the destination of ACK packet

Definition at line 650 of file uw-csma-aloha.cpp.

◆ txData()

void CsmaAloha::txData ( )
protectedvirtual

Transmits the DATA packet (calling Mac2PhyStartTx) and increment the counter of transmitted data packets.

Definition at line 636 of file uw-csma-aloha.cpp.

◆ updateAckTimeout()

void CsmaAloha::updateAckTimeout ( double  rtt)
protectedvirtual

Updates the AckTimeout calling getRTT, where the ACK timeout is computed as srtt/rttsamples using the smooth RTT.

See also
updateRTT
Parameters
doubleRTT value

Definition at line 322 of file uw-csma-aloha.cpp.

◆ updateLastDataIdRx()

virtual void CsmaAloha::updateLastDataIdRx ( int  id)
inlineprotectedvirtual

Updates the ID of the last DATA packet received.

Definition at line 674 of file uw-csma-aloha.h.

◆ updateRTT()

void CsmaAloha::updateRTT ( double  rtt)
protectedvirtual

Update the RTT increasing the number of RTT samples and calculating the smoothed RTT using the formula srtt = alpha*srtt + (1-alpha) * curr_rtt where alpha is a value chosen by the user.

Parameters
doublecurrent value of RTT

Definition at line 312 of file uw-csma-aloha.cpp.

◆ waitForUser()

void CsmaAloha::waitForUser ( )
protectedvirtual

Used for debug purposes.

(Permit to have a "step by step" behavior of the protocol)

Definition at line 1082 of file uw-csma-aloha.cpp.

Member Data Documentation

◆ ack_mode

CSMA_ACK_MODES CsmaAloha::ack_mode
protected

Variable that indicates if the protocol is in ACK or NO_ACK mode.

Definition at line 794 of file uw-csma-aloha.h.

◆ ACK_size

int CsmaAloha::ACK_size
protected

Size of the ACK message.

Definition at line 737 of file uw-csma-aloha.h.

◆ ACK_timeout

double CsmaAloha::ACK_timeout
protected

Duration of the ACK waiting time.

Definition at line 738 of file uw-csma-aloha.h.

◆ ack_timer

AckTimer CsmaAloha::ack_timer
protected

Object that represents the ack timer.

Definition at line 785 of file uw-csma-aloha.h.

◆ alpha_

double CsmaAloha::alpha_
protected

smooth factor in the calculation of the RTT

Definition at line 740 of file uw-csma-aloha.h.

◆ backoff_timer

BackOffTimer CsmaAloha::backoff_timer
protected

Object that represents the backoff timer.

Definition at line 786 of file uw-csma-aloha.h.

◆ backoff_tuner

double CsmaAloha::backoff_tuner
protected

Multiplier factor in the calculation of the backoff.

Definition at line 731 of file uw-csma-aloha.h.

◆ buffer_pkts

int CsmaAloha::buffer_pkts
protected

Length of the data buffer in number of packets.

Definition at line 739 of file uw-csma-aloha.h.

◆ curr_data_pkt

Packet* CsmaAloha::curr_data_pkt
protected

Pointer to the current data packet.

Definition at line 780 of file uw-csma-aloha.h.

◆ curr_state

CSMA_STATUS CsmaAloha::curr_state
protected

Current state of the protocol.

Definition at line 790 of file uw-csma-aloha.h.

◆ curr_tx_rounds

int CsmaAloha::curr_tx_rounds
protected

Number of current transmission of the same packet.

Definition at line 776 of file uw-csma-aloha.h.

◆ data_sn_queue

std::queue<int> CsmaAloha::data_sn_queue
protected

Queue of the sequence number of the packets.

Definition at line 747 of file uw-csma-aloha.h.

◆ fout

ofstream CsmaAloha::fout
protected

Object that handles the output file where the protocol writes the state transistions.

Definition at line 805 of file uw-csma-aloha.h.

◆ has_buffer_queue

bool CsmaAloha::has_buffer_queue
protected

flag that indicates if a node has a buffer where store DATA packets

Definition at line 766 of file uw-csma-aloha.h.

◆ HDR_size

int CsmaAloha::HDR_size
protected

Size (in bytes) of the header added by the protocol.

Definition at line 736 of file uw-csma-aloha.h.

◆ initialized

bool CsmaAloha::initialized = false
staticprotected

true if the protocol is initialized

Definition at line 749 of file uw-csma-aloha.h.

◆ last_data_id_rx

int CsmaAloha::last_data_id_rx
protected

ID of the last DATA packet received.

Definition at line 778 of file uw-csma-aloha.h.

◆ last_reason

CSMA_REASON_STATUS CsmaAloha::last_reason
protected

Reason for the state transitions.

Definition at line 789 of file uw-csma-aloha.h.

◆ last_sent_data_id

int CsmaAloha::last_sent_data_id
protected

ID of the last sent packet.

Definition at line 753 of file uw-csma-aloha.h.

◆ listen_time

double CsmaAloha::listen_time
protected

Time in which the node sense the channel.

Definition at line 742 of file uw-csma-aloha.h.

◆ listen_timer

ListenTimer CsmaAloha::listen_timer
protected

Object that represents the listen timer.

Definition at line 787 of file uw-csma-aloha.h.

◆ max_backoff_counter

int CsmaAloha::max_backoff_counter
protected

Number of times a backoff is calculated.

Definition at line 741 of file uw-csma-aloha.h.

◆ max_payload

int CsmaAloha::max_payload
protected

Maximum dimension of the data payload in bytes.

Definition at line 735 of file uw-csma-aloha.h.

◆ max_tx_tries

int CsmaAloha::max_tx_tries
protected

Maximum number of transmissions for one packet.

Definition at line 730 of file uw-csma-aloha.h.

◆ pkt_type_info

map< CsmaAloha::CSMA_PKT_TYPE, string > CsmaAloha::pkt_type_info
staticprotected

Textual description of the packet type.

Definition at line 803 of file uw-csma-aloha.h.

◆ prev_prev_state

CSMA_STATUS CsmaAloha::prev_prev_state
protected

Previous previous state of the protocol.

Definition at line 792 of file uw-csma-aloha.h.

◆ prev_state

CSMA_STATUS CsmaAloha::prev_state
protected

Previous state of the protocol.

Definition at line 791 of file uw-csma-aloha.h.

◆ print_transitions

bool CsmaAloha::print_transitions
protected

flag that indicates if the protocol is enabled to print its state transitions on a file

Definition at line 762 of file uw-csma-aloha.h.

◆ prop_speed

const double CsmaAloha::prop_speed = 1500.0
staticprotected

Typical sound propagation speed in underwater enviroment.

Variable that represent the status of the protocol machine state

Definition at line 100 of file uw-csma-aloha.h.

◆ Q

std::queue<Packet *> CsmaAloha::Q
protected

Packet queue.

Definition at line 745 of file uw-csma-aloha.h.

◆ reason_info

map< CsmaAloha::CSMA_REASON_STATUS, string > CsmaAloha::reason_info
staticprotected

Textual description of the protocol reason for the change of the state.

Definition at line 800 of file uw-csma-aloha.h.

◆ rttsamples

int CsmaAloha::rttsamples
protected

num of RTT samples

Definition at line 774 of file uw-csma-aloha.h.

◆ RxActive

bool CsmaAloha::RxActive
protected

flag that indicates if a reception is occuring

Definition at line 756 of file uw-csma-aloha.h.

◆ session_active

bool CsmaAloha::session_active
protected

flag that indicates if a session (i.e.

a transmission/reception activity is occuring) between two nodes

Definition at line 758 of file uw-csma-aloha.h.

◆ session_distance

double CsmaAloha::session_distance
protected

Distance between sender and the receiver involved in the current session.

Definition at line 782 of file uw-csma-aloha.h.

◆ srtt

double CsmaAloha::srtt
protected

Smoothed Round Trip Time, calculated as for TCP.

Definition at line 771 of file uw-csma-aloha.h.

◆ start_tx_time

double CsmaAloha::start_tx_time
protected

timestamp in which the node stars to transmit a packet

Definition at line 769 of file uw-csma-aloha.h.

◆ status_info

map< CsmaAloha::CSMA_STATUS, string > CsmaAloha::status_info
staticprotected

Textual description of the protocol states.

Definition at line 798 of file uw-csma-aloha.h.

◆ sumrtt

double CsmaAloha::sumrtt
protected

sum of RTT samples

Definition at line 772 of file uw-csma-aloha.h.

◆ sumrtt2

double CsmaAloha::sumrtt2
protected

sum of (RTT^2)

Definition at line 773 of file uw-csma-aloha.h.

◆ TxActive

bool CsmaAloha::TxActive
protected

flag that indicates if a transmission is occuring

Definition at line 755 of file uw-csma-aloha.h.

◆ u_data_id

int CsmaAloha::u_data_id
protected

DATA packete ID.

Definition at line 752 of file uw-csma-aloha.h.

◆ u_pkt_id

int CsmaAloha::u_pkt_id
staticprotected

simulation-unique packet ID

Definition at line 751 of file uw-csma-aloha.h.

◆ wait_costant

double CsmaAloha::wait_costant
protected

Adding factor in the calculation of the listen time.

Definition at line 733 of file uw-csma-aloha.h.


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