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

#include <uw-mac-DACAP-alter.h>

Inheritance diagram for MMacDACAP:
Collaboration diagram for MMacDACAP:

Public Member Functions

 MMacDACAP ()
 
virtual ~MMacDACAP ()
 
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 computeWaitTime (int mode, double distance)
 
virtual double computeTxTime (int type)
 
virtual void initPkt (Packet *p, int pkt_type)
 
virtual double getBackoffTime ()
 
virtual double getRecontendTime ()
 
virtual void txAck ()
 
virtual void txData ()
 
virtual void txRts ()
 
virtual void txCts ()
 
virtual void txWrn ()
 
virtual void rxStateIdle (Packet *p)
 
virtual void rxStateBackoff (Packet *p)
 
virtual void rxStateWaitCTS (Packet *p)
 
virtual void rxStateWaitACK (Packet *p)
 
virtual void rxStateWaitData (Packet *p)
 
virtual void rxStateWaitXCts (Packet *p)
 
virtual void rxStateWaitXData (Packet *p)
 
virtual void rxStateWaitXAck (Packet *p)
 
virtual void rxStateWaitXWarning (Packet *p)
 
virtual void rxStateWaitWarning (Packet *p)
 
virtual void rxStateSendWarning (Packet *p)
 
virtual void rxStateRecontendWindow (Packet *p)
 
virtual void stateIdle ()
 
virtual void stateSendRTS ()
 
virtual void stateBackoff ()
 
virtual void stateWaitCTS ()
 
virtual void stateDeferData ()
 
virtual void stateSendData ()
 
virtual void stateWaitACK ()
 
virtual void stateCTSReceived ()
 
virtual void stateWaitData ()
 
virtual void stateDataReceived (Packet *data_pkt)
 
virtual void stateWaitXCts ()
 
virtual void stateWaitXData ()
 
virtual void stateWaitXAck ()
 
virtual void stateWaitXWarning ()
 
virtual void stateSendAck ()
 
virtual void stateSendCTS ()
 
virtual void stateWaitWarning ()
 
virtual void stateSendWarning ()
 
virtual void stateRecontendWindow ()
 
virtual void printStateInfo (double delay=0)
 
virtual void initInfo ()
 
virtual void refreshState (int state)
 
virtual void setBackoffNodes (double node, double node_b)
 
virtual void exitBackoff ()
 
virtual void exitSleep ()
 
virtual void freezeBackoff ()
 
virtual int getQueueSize ()
 
virtual void queuePop (bool flag=true)
 
virtual void waitForUser ()
 
int getUpLayersDataPktsRx ()
 
virtual void incrWrnPktsTx ()
 
virtual void incrWrnPktsRx ()
 
virtual void incrRtsPktsTx ()
 
virtual void incrRtsPktsRx ()
 
virtual void incrCtsPktsTx ()
 
virtual void incrCtsPktsRx ()
 
virtual void incrTotalDeferTimes ()
 
virtual void resetStats ()
 
virtual int getRemainingPkts ()
 
virtual int getWrnPktsTx ()
 
virtual int getWrnPktsRx ()
 
virtual int getRtsPktsTx ()
 
virtual int getRtsPktsRx ()
 
virtual int getCtsPktsTx ()
 
virtual int getCtsPktsRx ()
 
virtual int getTotalDeferTimes ()
 
virtual void backoffStartTime ()
 
virtual void deferEndTime (double duration)
 
virtual void backoffEndTime ()
 
virtual double getMeanDeferTime ()
 

Protected Attributes

int wrn_pkts_tx
 
int wrn_pkts_rx
 
int rts_pkts_tx
 
int rts_pkts_rx
 
int cts_pkts_tx
 
int cts_pkts_rx
 
double defer_times_no
 
double sum_defer_time
 
double start_tx_time
 
double srtt
 
double sumrtt
 
double sumrtt2
 
int rttsamples
 
std::queue< Packet * > Q
 
bool TxActive
 
bool RxActive
 
bool defer_data
 
bool session_active
 
bool backoff_pending
 
bool warning_sent
 
bool backoff_freeze_mode
 
bool print_transitions
 
bool has_buffer_queue
 
bool multihop_mode
 
int sleep_node_1
 
int sleep_node_2
 
int last_reason
 
double t_min
 
double T_W_min
 
double delta_D
 
double delta_data
 
double max_prop_delay
 
int op_mode
 
double max_tx_tries
 
int buffer_pkts
 
double backoff_tuner
 
double wait_costant
 
int max_payload
 
double max_backoff_counter
 
double alpha_
 
int curr_dest_addr
 
int CTS_size
 
int RTS_size
 
int WRN_size
 
int HDR_size
 
int ACK_size
 
int curr_state
 
int prev_state
 
double RTS_sent_time
 
double session_distance
 
double backoff_start_time
 
double backoff_duration
 
double backoff_remaining
 
double backoff_first_start
 
Packet * curr_data_pkt
 
int last_data_id_tx
 
int last_data_id_rx
 
int u_data_id
 
DACAPTimer timer
 
DACAPBTimer backoff_timer
 
int txsn
 
int backoff_counter
 
ofstream fout
 

Static Protected Attributes

static int u_pkt_id
 
static map< int, string > info
 

Friends

class DACAPTimer
 
class DACAPBTimer
 

Detailed Description

Class that represents a DACAP node.

Definition at line 155 of file uw-mac-DACAP-alter.h.

Constructor & Destructor Documentation

◆ MMacDACAP()

MMacDACAP::MMacDACAP ( )

Costructor of the MMacDACAP class.

Definition at line 359 of file uw-mac-DACAP-alter.cpp.

◆ ~MMacDACAP()

MMacDACAP::~MMacDACAP ( )
virtual

Destructor of the MMacDACAP class.

Definition at line 438 of file uw-mac-DACAP-alter.cpp.

Member Function Documentation

◆ backoffEndTime()

virtual void MMacDACAP::backoffEndTime ( )
inlineprotectedvirtual

calculates the End Time of the backoff timer

Definition at line 714 of file uw-mac-DACAP-alter.h.

◆ backoffStartTime()

virtual void MMacDACAP::backoffStartTime ( )
inlineprotectedvirtual

Sets the start time of the backoff timer to NOW.

Definition at line 695 of file uw-mac-DACAP-alter.h.

◆ command()

int MMacDACAP::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 444 of file uw-mac-DACAP-alter.cpp.

◆ computeTxTime()

double MMacDACAP::computeTxTime ( int  type)
protectedvirtual

Computes the time that is needed to transmit a packet, implementing a CrLayMessage for asking the PHY layer to perform this calculation.

Parameters
typeof the packet
Returns
double the time needed for transmission in seconds

Definition at line 594 of file uw-mac-DACAP-alter.cpp.

◆ computeWaitTime()

double MMacDACAP::computeWaitTime ( int  mode,
double  distance 
)
protectedvirtual

Computes the T_w parameter, that is the minimum time that the sender has to wait between the reception of CTS packet and the effective transmission of data packet.

Parameters
modeindicates whether the ACK mode or no_ACK mode is activated
distancebetween the sender and the receiver
Returns
double the value of T_w

Definition at line 633 of file uw-mac-DACAP-alter.cpp.

◆ crLayCommand()

int MMacDACAP::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 511 of file uw-mac-DACAP-alter.cpp.

◆ deferEndTime()

virtual void MMacDACAP::deferEndTime ( double  duration)
inlineprotectedvirtual

Sets the end time of the defer summing the duration to the actual duration of defer.

Parameters
doubleduration of the defer time

Definition at line 706 of file uw-mac-DACAP-alter.h.

◆ exitBackoff()

void MMacDACAP::exitBackoff ( )
inlineprotectedvirtual

The backoff timer is stopped.

Definition at line 678 of file uw-mac-DACAP-alter.cpp.

◆ exitSleep()

void MMacDACAP::exitSleep ( )
protectedvirtual

This method erase the MAC address of the two nodes that have intiated a handshake procedure if this handshake is done.

Definition at line 694 of file uw-mac-DACAP-alter.cpp.

◆ freezeBackoff()

void MMacDACAP::freezeBackoff ( )
inlineprotectedvirtual

Freezes the Backoff timer.

Definition at line 701 of file uw-mac-DACAP-alter.cpp.

◆ getBackoffTime()

double MMacDACAP::getBackoffTime ( )
protectedvirtual

Calculate the backoff time if the node didn't received the ACK.

Definition at line 748 of file uw-mac-DACAP-alter.cpp.

◆ getCtsPktsRx()

virtual int MMacDACAP::getCtsPktsRx ( )
inlineprotectedvirtual
Returns
number of CTS packets received

Definition at line 679 of file uw-mac-DACAP-alter.h.

◆ getCtsPktsTx()

virtual int MMacDACAP::getCtsPktsTx ( )
inlineprotectedvirtual
Returns
number of CTS packets transmitted

Definition at line 671 of file uw-mac-DACAP-alter.h.

◆ getMeanDeferTime()

virtual double MMacDACAP::getMeanDeferTime ( )
inlineprotectedvirtual
Returns
Mean of all the defer times

Definition at line 723 of file uw-mac-DACAP-alter.h.

◆ getQueueSize()

virtual int MMacDACAP::getQueueSize ( )
inlineprotectedvirtual
Returns
the size of DATA queue at the end of simulation

Definition at line 528 of file uw-mac-DACAP-alter.h.

◆ getRecontendTime()

double MMacDACAP::getRecontendTime ( )
protectedvirtual

Used in multihop mode.

Definition at line 735 of file uw-mac-DACAP-alter.cpp.

◆ getRemainingPkts()

virtual int MMacDACAP::getRemainingPkts ( )
inlineprotectedvirtual
Returns
Number of data packets that are remained in the data queue at the end of simulation

Definition at line 631 of file uw-mac-DACAP-alter.h.

◆ getRtsPktsRx()

virtual int MMacDACAP::getRtsPktsRx ( )
inlineprotectedvirtual
Returns
number of RTS packets received

Definition at line 663 of file uw-mac-DACAP-alter.h.

◆ getRtsPktsTx()

virtual int MMacDACAP::getRtsPktsTx ( )
inlineprotectedvirtual
Returns
number of RTS packets transmitted

Definition at line 655 of file uw-mac-DACAP-alter.h.

◆ getTotalDeferTimes()

virtual int MMacDACAP::getTotalDeferTimes ( )
inlineprotectedvirtual
Returns
number of defers occured

Definition at line 687 of file uw-mac-DACAP-alter.h.

◆ getUpLayersDataPktsRx()

int MMacDACAP::getUpLayersDataPktsRx ( )
inlineprotected

Definition at line 553 of file uw-mac-DACAP-alter.h.

◆ getWrnPktsRx()

virtual int MMacDACAP::getWrnPktsRx ( )
inlineprotectedvirtual
Returns
number of WRN packets received

Definition at line 647 of file uw-mac-DACAP-alter.h.

◆ getWrnPktsTx()

virtual int MMacDACAP::getWrnPktsTx ( )
inlineprotectedvirtual
Returns
number of WRN packets transmitted

Definition at line 639 of file uw-mac-DACAP-alter.h.

◆ incrCtsPktsRx()

virtual void MMacDACAP::incrCtsPktsRx ( )
inlineprotectedvirtual

Increases the counter of CTS packets received.

Definition at line 602 of file uw-mac-DACAP-alter.h.

◆ incrCtsPktsTx()

virtual void MMacDACAP::incrCtsPktsTx ( )
inlineprotectedvirtual

Increases the counter of CTS packets transmitted.

Definition at line 594 of file uw-mac-DACAP-alter.h.

◆ incrRtsPktsRx()

virtual void MMacDACAP::incrRtsPktsRx ( )
inlineprotectedvirtual

Increases the counter of RTS packets received.

Definition at line 586 of file uw-mac-DACAP-alter.h.

◆ incrRtsPktsTx()

virtual void MMacDACAP::incrRtsPktsTx ( )
inlineprotectedvirtual

Increases the counter of RTS packets transmitted.

Definition at line 578 of file uw-mac-DACAP-alter.h.

◆ incrTotalDeferTimes()

virtual void MMacDACAP::incrTotalDeferTimes ( )
inlineprotectedvirtual

Increases the number of times a transmission is deferred.

Definition at line 610 of file uw-mac-DACAP-alter.h.

◆ incrWrnPktsRx()

virtual void MMacDACAP::incrWrnPktsRx ( )
inlineprotectedvirtual

Increases the counter of WRN packets received.

Definition at line 570 of file uw-mac-DACAP-alter.h.

◆ incrWrnPktsTx()

virtual void MMacDACAP::incrWrnPktsTx ( )
inlineprotectedvirtual

Increases the counter of WRN packets transmitted.

Definition at line 562 of file uw-mac-DACAP-alter.h.

◆ initInfo()

void MMacDACAP::initInfo ( )
protectedvirtual

Initializes the protocol at the beginning of the simulation.

This method is called by a command in tcl.

See also
command method

Definition at line 525 of file uw-mac-DACAP-alter.cpp.

◆ initPkt()

void MMacDACAP::initPkt ( Packet *  p,
int  pkt_type 
)
protectedvirtual

Initializes the packet with the correct MAC source address and destination address, the correct type and size.

Parameters
Pointerto the packet that we have to initialize
typeof the packet that we are going to initialize

Definition at line 802 of file uw-mac-DACAP-alter.cpp.

◆ Phy2MacEndRx()

void MMacDACAP::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

Definition at line 962 of file uw-mac-DACAP-alter.cpp.

◆ Phy2MacEndTx()

void MMacDACAP::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

Definition at line 864 of file uw-mac-DACAP-alter.cpp.

◆ Phy2MacStartRx()

void MMacDACAP::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

Definition at line 956 of file uw-mac-DACAP-alter.cpp.

◆ printStateInfo()

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

Prints a file with every state change for debug purposes.

Parameters
delayfrom the call of the method and the effective write process on the file

Definition at line 2281 of file uw-mac-DACAP-alter.cpp.

◆ queuePop()

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

Pop the first element of the queue.

Definition at line 536 of file uw-mac-DACAP-alter.h.

◆ recvFromUpperLayers()

void MMacDACAP::recvFromUpperLayers ( Packet *  p)
protectedvirtual

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

IP)

Parameters
Packet*pointer to the packet received

Definition at line 776 of file uw-mac-DACAP-alter.cpp.

◆ refreshState()

virtual void MMacDACAP::refreshState ( int  state)
inlineprotectedvirtual

Refresh the state of the protocol.

Parameters
intcurrent state of the protcol

Definition at line 499 of file uw-mac-DACAP-alter.h.

◆ resetStats()

virtual void MMacDACAP::resetStats ( )
inlineprotectedvirtual

Resets all the stats counters.

Definition at line 619 of file uw-mac-DACAP-alter.h.

◆ rxStateBackoff()

void MMacDACAP::rxStateBackoff ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in BACKOFF state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1216 of file uw-mac-DACAP-alter.cpp.

◆ rxStateIdle()

void MMacDACAP::rxStateIdle ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in IDLE state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1153 of file uw-mac-DACAP-alter.cpp.

◆ rxStateRecontendWindow()

void MMacDACAP::rxStateRecontendWindow ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in RecontendWindow state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1866 of file uw-mac-DACAP-alter.cpp.

◆ rxStateSendWarning()

void MMacDACAP::rxStateSendWarning ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in SendWarning state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1786 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitACK()

void MMacDACAP::rxStateWaitACK ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitACK state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1380 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitCTS()

void MMacDACAP::rxStateWaitCTS ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitCTS state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1302 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitData()

void MMacDACAP::rxStateWaitData ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitDATA state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1433 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitWarning()

void MMacDACAP::rxStateWaitWarning ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitWarning state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1710 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitXAck()

void MMacDACAP::rxStateWaitXAck ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitXAck state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1608 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitXCts()

void MMacDACAP::rxStateWaitXCts ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitXCts state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1482 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitXData()

void MMacDACAP::rxStateWaitXData ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitXData state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1550 of file uw-mac-DACAP-alter.cpp.

◆ rxStateWaitXWarning()

void MMacDACAP::rxStateWaitXWarning ( Packet *  p)
protectedvirtual

The case of reception while the protocol is in WaitXWarning state is handled.

Parameters
Packet*pointer to the packet is reception

Definition at line 1653 of file uw-mac-DACAP-alter.cpp.

◆ setBackoffNodes()

void MMacDACAP::setBackoffNodes ( double  node,
double  node_b 
)
protectedvirtual

Saves the MAC address of another couple of nodes that is the handshake procedure in order to access the channel.

Definition at line 1064 of file uw-mac-DACAP-alter.cpp.

◆ stateBackoff()

void MMacDACAP::stateBackoff ( )
protectedvirtual

The protocol is in Backoff state.

The node hasn't received the ACK packet and the backoff timer is set up for the re-transmission of the DATA packet

Definition at line 2003 of file uw-mac-DACAP-alter.cpp.

◆ stateCTSReceived()

void MMacDACAP::stateCTSReceived ( )
protectedvirtual

The protocol is in the CTSReceived state.

Definition at line 2210 of file uw-mac-DACAP-alter.cpp.

◆ stateDataReceived()

void MMacDACAP::stateDataReceived ( Packet *  data_pkt)
protectedvirtual

The protocol is in the DataReceived state.

a Data Packet is received

Parameters
Packet*pointer to the data packet received

Definition at line 2224 of file uw-mac-DACAP-alter.cpp.

◆ stateDeferData()

void MMacDACAP::stateDeferData ( )
protectedvirtual

The protocol is in the DeferData state.

The node has received a WRN packet or has received a CTS packet coming from other nodes. The scheduled transmission is deferred

Definition at line 2176 of file uw-mac-DACAP-alter.cpp.

◆ stateIdle()

void MMacDACAP::stateIdle ( )
protectedvirtual

The protocol is in the IDLE state.

All variables and timers are resetted

Definition at line 1947 of file uw-mac-DACAP-alter.cpp.

◆ stateRecontendWindow()

void MMacDACAP::stateRecontendWindow ( )
protectedvirtual

The protocol is in RecontendWindow state.

In multi-hop scenario after a transmission the node enter in a recontention window before return in IDLE state

Definition at line 2269 of file uw-mac-DACAP-alter.cpp.

◆ stateSendAck()

void MMacDACAP::stateSendAck ( )
protectedvirtual

The protocol is in SendAck state.

The node is sending an ACK after the reception of a data packet (if the acknowledgement is active)

Definition at line 2247 of file uw-mac-DACAP-alter.cpp.

◆ stateSendCTS()

void MMacDACAP::stateSendCTS ( )
protectedvirtual

The protocol is in SendCTS state.

The node is sending CTS afeter the reception of a RTS packet

Definition at line 2258 of file uw-mac-DACAP-alter.cpp.

◆ stateSendData()

void MMacDACAP::stateSendData ( )
protectedvirtual

The protocol is in the SendData state.

The handshaking phase is done. The node transmit his data packet

Definition at line 2197 of file uw-mac-DACAP-alter.cpp.

◆ stateSendRTS()

void MMacDACAP::stateSendRTS ( )
protectedvirtual

The protocol is in SendRTS state.

A RTS packet is prepared to be transmitted

Definition at line 1988 of file uw-mac-DACAP-alter.cpp.

◆ stateSendWarning()

void MMacDACAP::stateSendWarning ( )
protectedvirtual

The protocol is in the SendWarning state.

The node has received a CTS or RTS packet from a third node not involved in the transmission. The node is sending the WRN packet to the sender to warning the possibility of a collision is the transmission is occuring

Definition at line 2120 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitACK()

void MMacDACAP::stateWaitACK ( )
protectedvirtual

The protocol is in the WaitACK state.

Definition at line 2164 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitCTS()

void MMacDACAP::stateWaitCTS ( )
protectedvirtual

The protocol is in the WaitCTS state.

The node has just sent a RTS packet and now he's waiting for the answer with a CTS packet

Definition at line 2137 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitData()

void MMacDACAP::stateWaitData ( )
protectedvirtual

The protocol is in the WaitData state.

The exchanging of RTS/CTS packets is done. Now the node is waiting for the data packet

Definition at line 2150 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitWarning()

void MMacDACAP::stateWaitWarning ( )
protectedvirtual

The protocol is in WaitWarning state.

The node has received a CTS or RTS packet from a third node not involved in the transmission. The node is waiting the WRN packet from the receiver

Definition at line 2104 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitXAck()

void MMacDACAP::stateWaitXAck ( )
protectedvirtual

The protocol is in WaitXAck state.

The node has received a data packet coming from a third node that is not involved in the transmission. Now the node is waiting for the ACK packet coming from the destinatay of the data packet (if the acknowledgement is active)

Definition at line 2077 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitXCts()

void MMacDACAP::stateWaitXCts ( )
protectedvirtual

The protocol is in WaitXCts state.

The node has received a RTS packet coming from a third node that is not involved in the transmission. Now the node is waiting for the CTS coming from the node destinatary of the RTS

Definition at line 2054 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitXData()

void MMacDACAP::stateWaitXData ( )
protectedvirtual

The protocol is in WaitXData state.

The node has received a CTS packet coming from a third node that is not involved in the transmission. Now the node is waiting for the data packet coming from the node destinatary of the CTS

Definition at line 2065 of file uw-mac-DACAP-alter.cpp.

◆ stateWaitXWarning()

void MMacDACAP::stateWaitXWarning ( )
protectedvirtual

The protocol is in WaitXWarning state.

The node is waiting for a Warning coming from a third node not involved in the transmission

Definition at line 2088 of file uw-mac-DACAP-alter.cpp.

◆ txAck()

void MMacDACAP::txAck ( )
protectedvirtual

Pass an ACK packet to transmit to the PHY layer.

Definition at line 1079 of file uw-mac-DACAP-alter.cpp.

◆ txCts()

void MMacDACAP::txCts ( )
protectedvirtual

Pass a CTS packet to transmit to the PHY layer.

Definition at line 1129 of file uw-mac-DACAP-alter.cpp.

◆ txData()

void MMacDACAP::txData ( )
protectedvirtual

Pass a DATA packet to transmit to the PHYl layer.

Definition at line 1091 of file uw-mac-DACAP-alter.cpp.

◆ txRts()

void MMacDACAP::txRts ( )
protectedvirtual

Pass a RTS packet to transmit to the PHY layer.

Definition at line 1104 of file uw-mac-DACAP-alter.cpp.

◆ txWrn()

void MMacDACAP::txWrn ( )
protectedvirtual

Pass a WRN packet to transmit to the PHY layer.

Definition at line 1142 of file uw-mac-DACAP-alter.cpp.

◆ waitForUser()

void MMacDACAP::waitForUser ( )
inlineprotectedvirtual

Used for debug purposes.

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

Definition at line 2318 of file uw-mac-DACAP-alter.cpp.

Friends And Related Symbol Documentation

◆ DACAPBTimer

friend class DACAPBTimer
friend

DACAP Backoff timer.

Definition at line 158 of file uw-mac-DACAP-alter.h.

◆ DACAPTimer

friend class DACAPTimer
friend

DACAP ACK timer.

Definition at line 157 of file uw-mac-DACAP-alter.h.

Member Data Documentation

◆ ACK_size

int MMacDACAP::ACK_size
protected

Size (in bytes) of the ACK packet.

Definition at line 804 of file uw-mac-DACAP-alter.h.

◆ alpha_

double MMacDACAP::alpha_
protected

smoothing factor used for statistics using first order IIR filter

Definition at line 794 of file uw-mac-DACAP-alter.h.

◆ backoff_counter

int MMacDACAP::backoff_counter
protected

Number of times a backoff timer is set up.

Definition at line 833 of file uw-mac-DACAP-alter.h.

◆ backoff_duration

double MMacDACAP::backoff_duration
protected

Backoff duration.

Definition at line 814 of file uw-mac-DACAP-alter.h.

◆ backoff_first_start

double MMacDACAP::backoff_first_start
protected

Timestamp at which the backoff timer is started for the first time (if the timer has been freezed many times.

Definition at line 817 of file uw-mac-DACAP-alter.h.

◆ backoff_freeze_mode

bool MMacDACAP::backoff_freeze_mode
protected

true if the backoff-timer is freezed

Definition at line 759 of file uw-mac-DACAP-alter.h.

◆ backoff_pending

bool MMacDACAP::backoff_pending
protected

true if the backoff-timer is active (i.e.

there's a backoff process)

Definition at line 755 of file uw-mac-DACAP-alter.h.

◆ backoff_remaining

double MMacDACAP::backoff_remaining
protected

Backoff time remaining (if the timer is freezed)

Definition at line 815 of file uw-mac-DACAP-alter.h.

◆ backoff_start_time

double MMacDACAP::backoff_start_time
protected

Backoff starting time.

Definition at line 813 of file uw-mac-DACAP-alter.h.

◆ backoff_timer

DACAPBTimer MMacDACAP::backoff_timer
protected

backoff timer

Definition at line 830 of file uw-mac-DACAP-alter.h.

◆ backoff_tuner

double MMacDACAP::backoff_tuner
protected

Multiplicative factor in the calculation of backoff.

Definition at line 787 of file uw-mac-DACAP-alter.h.

◆ buffer_pkts

int MMacDACAP::buffer_pkts
protected

Dimension (in packets) of the buffer queue.

Definition at line 786 of file uw-mac-DACAP-alter.h.

◆ cts_pkts_rx

int MMacDACAP::cts_pkts_rx
protected

Counter of CTS packets RX.

Definition at line 736 of file uw-mac-DACAP-alter.h.

◆ cts_pkts_tx

int MMacDACAP::cts_pkts_tx
protected

Counter of CTS packets TX.

Definition at line 735 of file uw-mac-DACAP-alter.h.

◆ CTS_size

int MMacDACAP::CTS_size
protected

Size (in bytes) of the CTS packet.

Definition at line 800 of file uw-mac-DACAP-alter.h.

◆ curr_data_pkt

Packet* MMacDACAP::curr_data_pkt
protected

Pointer to the current data packet.

Definition at line 821 of file uw-mac-DACAP-alter.h.

◆ curr_dest_addr

int MMacDACAP::curr_dest_addr
protected

MAC address of the current node involved in this session.

Definition at line 797 of file uw-mac-DACAP-alter.h.

◆ curr_state

int MMacDACAP::curr_state
protected

Current state of the protocol.

Definition at line 806 of file uw-mac-DACAP-alter.h.

◆ defer_data

bool MMacDACAP::defer_data
protected

true if a node has to defer the transmission of a data packet

Definition at line 751 of file uw-mac-DACAP-alter.h.

◆ defer_times_no

double MMacDACAP::defer_times_no
protected

Counter of defer times.

Definition at line 737 of file uw-mac-DACAP-alter.h.

◆ delta_D

double MMacDACAP::delta_D
protected

Value (in m) that indicates how far we want the CTS propagates over the sender before initiate the data transmission process (it determines the T_w value)

Definition at line 775 of file uw-mac-DACAP-alter.h.

◆ delta_data

double MMacDACAP::delta_data
protected

Dimension difference (in bytes) among data packets ( 0 if the packets have always the same dimension)

Definition at line 778 of file uw-mac-DACAP-alter.h.

◆ fout

ofstream MMacDACAP::fout
protected

Object that handle the file where the state transitions is written (if the print_transitions option is active)

Definition at line 839 of file uw-mac-DACAP-alter.h.

◆ has_buffer_queue

bool MMacDACAP::has_buffer_queue
protected

true if the node has a buffer queue to store data packets

Definition at line 763 of file uw-mac-DACAP-alter.h.

◆ HDR_size

int MMacDACAP::HDR_size
protected

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

Definition at line 803 of file uw-mac-DACAP-alter.h.

◆ info

map< int, string > MMacDACAP::info
staticprotected

Relationship between the state and its textual description.

Definition at line 835 of file uw-mac-DACAP-alter.h.

◆ last_data_id_rx

int MMacDACAP::last_data_id_rx
protected

Unique ID of the last data packet received.

Definition at line 824 of file uw-mac-DACAP-alter.h.

◆ last_data_id_tx

int MMacDACAP::last_data_id_tx
protected

Unique ID of the last data packet transmitted.

Definition at line 823 of file uw-mac-DACAP-alter.h.

◆ last_reason

int MMacDACAP::last_reason
protected

last reason for the change of state

Definition at line 771 of file uw-mac-DACAP-alter.h.

◆ max_backoff_counter

double MMacDACAP::max_backoff_counter
protected

Number of times a backoff is calculated.

Definition at line 793 of file uw-mac-DACAP-alter.h.

◆ max_payload

int MMacDACAP::max_payload
protected

Dimension of the maximum allowed data paylaod in bytes.

Definition at line 791 of file uw-mac-DACAP-alter.h.

◆ max_prop_delay

double MMacDACAP::max_prop_delay
protected

One way maximum propagation delay (in seconds) in the network.

Definition at line 781 of file uw-mac-DACAP-alter.h.

◆ max_tx_tries

double MMacDACAP::max_tx_tries
protected

Maximum transmission tries for one packet before discarding the packet.

Definition at line 784 of file uw-mac-DACAP-alter.h.

◆ multihop_mode

bool MMacDACAP::multihop_mode
protected

true if the multihop mode is active to simulate a multihop scenario with routing

Definition at line 765 of file uw-mac-DACAP-alter.h.

◆ op_mode

int MMacDACAP::op_mode
protected

Indicates if the ACK_mode or no_ACK_mode is activated.

Definition at line 783 of file uw-mac-DACAP-alter.h.

◆ prev_state

int MMacDACAP::prev_state
protected

Previous state of the protocol.

Definition at line 807 of file uw-mac-DACAP-alter.h.

◆ print_transitions

bool MMacDACAP::print_transitions
protected

true if the state-transitions of the protocol is printed on a file

Definition at line 761 of file uw-mac-DACAP-alter.h.

◆ Q

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

MAC queue used for packet scheduling.

Definition at line 746 of file uw-mac-DACAP-alter.h.

◆ rts_pkts_rx

int MMacDACAP::rts_pkts_rx
protected

Counter of RTS packets RX.

Definition at line 734 of file uw-mac-DACAP-alter.h.

◆ rts_pkts_tx

int MMacDACAP::rts_pkts_tx
protected

Counter of RTS packets TX.

Definition at line 733 of file uw-mac-DACAP-alter.h.

◆ RTS_sent_time

double MMacDACAP::RTS_sent_time
protected

Timestamp at which the RTS packet is sent.

Definition at line 809 of file uw-mac-DACAP-alter.h.

◆ RTS_size

int MMacDACAP::RTS_size
protected

Size (in bytes) of the RTS packet.

Definition at line 801 of file uw-mac-DACAP-alter.h.

◆ rttsamples

int MMacDACAP::rttsamples
protected

num of RTT samples

Definition at line 744 of file uw-mac-DACAP-alter.h.

◆ RxActive

bool MMacDACAP::RxActive
protected

true if a reception process is occuring

Definition at line 749 of file uw-mac-DACAP-alter.h.

◆ session_active

bool MMacDACAP::session_active
protected

true if a session is active (i.e.

an hand-shaking process is occurring

Definition at line 753 of file uw-mac-DACAP-alter.h.

◆ session_distance

double MMacDACAP::session_distance
protected

Distance between sender and receiver in the current session.

Definition at line 810 of file uw-mac-DACAP-alter.h.

◆ sleep_node_1

int MMacDACAP::sleep_node_1
protected

MAC address of sleep_node 1.

Definition at line 768 of file uw-mac-DACAP-alter.h.

◆ sleep_node_2

int MMacDACAP::sleep_node_2
protected

MAC address of sleep_node 2.

Definition at line 769 of file uw-mac-DACAP-alter.h.

◆ srtt

double MMacDACAP::srtt
protected

Smoothed Round Trip Time, calculated as for TCP.

Definition at line 741 of file uw-mac-DACAP-alter.h.

◆ start_tx_time

double MMacDACAP::start_tx_time
protected

Timestamp at which a packet is transmitted.

Definition at line 740 of file uw-mac-DACAP-alter.h.

◆ sum_defer_time

double MMacDACAP::sum_defer_time
protected

Sum of the defer timers.

Definition at line 738 of file uw-mac-DACAP-alter.h.

◆ sumrtt

double MMacDACAP::sumrtt
protected

sum of RTT samples

Definition at line 742 of file uw-mac-DACAP-alter.h.

◆ sumrtt2

double MMacDACAP::sumrtt2
protected

sum of (RTT^2)

Definition at line 743 of file uw-mac-DACAP-alter.h.

◆ t_min

double MMacDACAP::t_min
protected

Minimum time needed to do an hand-shaking.

Definition at line 773 of file uw-mac-DACAP-alter.h.

◆ T_W_min

double MMacDACAP::T_W_min
protected

Minimum Warning Time in sencods.

Definition at line 774 of file uw-mac-DACAP-alter.h.

◆ timer

DACAPTimer MMacDACAP::timer
protected

ACK timer.

Definition at line 829 of file uw-mac-DACAP-alter.h.

◆ TxActive

bool MMacDACAP::TxActive
protected

true if a transmission process is occuring

Definition at line 748 of file uw-mac-DACAP-alter.h.

◆ txsn

int MMacDACAP::txsn
protected

serial number of the DATA packet transmitted

Definition at line 832 of file uw-mac-DACAP-alter.h.

◆ u_data_id

int MMacDACAP::u_data_id
protected

simulation-unique DATA packet ID

Definition at line 827 of file uw-mac-DACAP-alter.h.

◆ u_pkt_id

int MMacDACAP::u_pkt_id
staticprotected

simulation-unique packet ID

Definition at line 826 of file uw-mac-DACAP-alter.h.

◆ wait_costant

double MMacDACAP::wait_costant
protected

Additive factor in the calculation of ACK timer.

Definition at line 789 of file uw-mac-DACAP-alter.h.

◆ warning_sent

bool MMacDACAP::warning_sent
protected

true if a WRN packet has been just sent

Definition at line 757 of file uw-mac-DACAP-alter.h.

◆ wrn_pkts_rx

int MMacDACAP::wrn_pkts_rx
protected

Counter of WRN packets RX.

Definition at line 732 of file uw-mac-DACAP-alter.h.

◆ wrn_pkts_tx

int MMacDACAP::wrn_pkts_tx
protected

Counter of WRN packets TX.

Definition at line 731 of file uw-mac-DACAP-alter.h.

◆ WRN_size

int MMacDACAP::WRN_size
protected

Size (in bytes) of the WRN packet.

Definition at line 802 of file uw-mac-DACAP-alter.h.


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