DESERT 4.0.0
Uwpolling_AUV Class Reference

#include <uwpolling_AUV.h>

Inheritance diagram for Uwpolling_AUV:
Inheritance graph
Collaboration diagram for Uwpolling_AUV:
Collaboration graph

Classes

class  AckTimer
 
class  DataTimer
 
class  PollTimer
 
class  ProbeTimer
 
class  Uwpolling_AUV_Timer
 

Public Member Functions

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

Protected Types

enum  UWPOLLING_AUV_STATUS {
  UWPOLLING_AUV_STATUS_IDLE = 1 , UWPOLLING_AUV_STATUS_TX_TRIGGER , UWPOLLING_AUV_STATUS_RX_PROBES , UWPOLLING_AUV_STATUS_RX_DATA ,
  UWPOLLING_AUV_STATUS_RX_ACK , UWPOLLING_AUV_STATUS_TX_POLL , UWPOLLING_AUV_STATUS_TX_DATA , UWPOLLING_AUV_STATUS_WAIT_PROBE ,
  UWPOLLING_AUV_STATUS_WAIT_DATA , UWPOLLING_AUV_STATUS_WAIT_ACK
}
 
enum  UWPOLLING_AUV_REASON {
  UWPOLLING_AUV_REASON_DATA_RX = 1 , UWPOLLING_AUV_REASON_TX_TRIGGER , UWPOLLING_AUV_REASON_TX_POLL , UWPOLLING_AUV_REASON_PROBE_RECEIVED ,
  UWPOLLING_AUV_REASON_RX_DATA_TO , UWPOLLING_AUV_REASON_PACKET_ERROR , UWPOLLING_AUV_REASON_LAST_PACKET_RECEIVED , UWPOLLING_AUV_REASON_MAX_PROBE_RECEIVED ,
  UWPOLLING_AUV_REASON_LAST_POLLED_NODE , UWPOLLING_AUV_REASON_PROBE_TO_EXPIRED
}
 
enum  UWPOLLING_PKT_TYPE { UWPOLLING_DATA_PKT = 1 , UWPOLLING_POLL_PKT , UWPOLLING_TRIGGER_PKT , UWPOLLING_PROBE_PKT }
 
enum  UWPOLLING_TIMER_STATUS { UWPOLLING_IDLE = 1 , UWPOLLING_RUNNING , UWPOLLING_FROZEN , UWPOLLING_EXPIRED }
 

Protected Member Functions

double getMaxBackoffTime ()
 
virtual double linearInterpolator (double x, double x1, double x2, double y1, double y2)
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
void incrTriggerTx ()
 
void incrProbeRx ()
 
void incrAckRx ()
 
void incrWrongNodeDataSent ()
 
void incrDroppedProbePkts ()
 
void incrDroppedAckPkts ()
 
void incrDroppedProbeWrongState ()
 
void incrPollTx ()
 
int getTriggerTx ()
 
int getProbeRx ()
 
int getAckRx ()
 
int getWrongNodeDataSent ()
 
int getPollSent ()
 
int getDroppedProbePkts ()
 
int getDroppedAckPkts ()
 
int getDroppedProbeWrongState ()
 
virtual void refreshReason (UWPOLLING_AUV_REASON reason)
 
virtual void refreshState (UWPOLLING_AUV_STATUS state)
 
virtual void stateRxProbe ()
 
virtual void stateRxData ()
 
virtual void stateWaitProbe ()
 
virtual void stateWaitData ()
 
virtual void stateIdle ()
 
virtual void stateTxTrigger ()
 
virtual void stateTxPoll ()
 
virtual void DataTOExpired ()
 
virtual void ProbeTOExpired ()
 
virtual void initInfo ()
 
virtual void TxTrigger ()
 
virtual void TxPoll ()
 
virtual void SortNode2Poll ()
 
virtual void ChangeNodePolled ()
 
virtual double GetDataTimerValue ()
 
virtual void computeTxTime (UWPOLLING_PKT_TYPE pkt)
 
virtual void UpdateRTT ()
 
virtual void stop_count_time ()
 
double GetTotalReceivingTime ()
 
virtual void waitForUser ()
 
unsigned long int getEpoch ()
 
virtual void recvFromUpperLayers (Packet *p)
 
virtual void stateTx ()
 
virtual void stateTxData ()
 
virtual void txData ()
 
virtual void stateWaitAck ()
 
virtual void ackTOExpired ()
 
virtual void stateAckRx ()
 
virtual void handleAck ()
 
virtual void handleNoAck ()
 
virtual void handleProbeAck ()
 
virtual void addNode2List ()
 
virtual void addSink2List ()
 
virtual uint16_t getPollTime ()
 
virtual uint getRxPkts (int mac_addr)
 
bool initBackoffLUT ()
 

Protected Attributes

DataTimer data_timer
 
ProbeTimer probe_timer
 
PollTimer poll_timer
 
AckTimer ack_timer
 
std::vector< probbed_nodelist_probbed_node
 
probbed_node probbed_sink
 
int polling_index
 
bool sink_inserted
 
Packet * curr_trigger_packet
 
Packet * curr_poll_packet
 
Packet * curr_data_packet
 
Packet * curr_probe_packet
 
Packet * curr_tx_data_packet
 
Packet * curr_ack_packet
 
double T_probe
 
double T_probe_guard
 
double T_ack_timer
 
int max_payload
 
double T_min
 
double T_max
 
double T_guard
 
int max_polled_node
 
int sea_trial_
 
int print_stats_
 
int modem_data_bit_rate
 
int DATA_POLL_guard_time_
 
int n_run
 
UWPOLLING_AUV_STATUS curr_state
 
UWPOLLING_AUV_STATUS prev_state
 
UWPOLLING_AUV_REASON reason
 
UWPOLLING_AUV_REASON last_reason
 
bool RxDataEnabled
 
bool RxProbeEnabled
 
bool TxEnabled
 
double distance
 
int N_expected_pkt
 
int packet_index
 
int curr_polled_node_address
 
uint curr_node_id
 
double curr_RTT
 
double curr_Tmeasured
 
double probe_rtt
 
int wrong_node_data_sent
 
double initial_time
 
int n_trigger_tx
 
uint n_probe_rx
 
int n_ack_rx
 
int n_poll_tx
 
bool begin
 
double stop_time
 
double pkt_time
 
double total_time
 
double Tdata
 
double Tprobe
 
double Ttrigger
 
double Tpoll
 
uint TRIGGER_uid
 
uint POLL_uid
 
int N_dropped_probe_pkts
 
int n_dropped_ack_pkts
 
int N_dropped_probe_wrong_state
 
std::ofstream fout
 
std::ofstream out_file_stats
 
std::deque< Packet * > tx_buffer
 
std::deque< Packet * > temp_buffer
 
uint max_buffer_size
 
uint16_t uid_tx_pkt
 
bool curr_is_sink
 
uint max_tx_pkts
 
uint n_pkts_to_tx
 
uint n_tx_pkts
 
uint16_t last_pkt_uid
 
bool enableAckRx
 
bool acked
 
int ack_enabled
 
std::map< int, uint > rx_pkts_map
 
bool enable_adaptive_backoff
 
std::string backoff_LUT_file
 
char lut_token_separator
 
std::map< double, double > backoff_LUT
 
probe_cicle_counters probe_counters
 
int full_knowledge
 
int last_probe_lost
 

Static Protected Attributes

static std::map< UWPOLLING_PKT_TYPE, std::string > pkt_type_info
 
static std::map< UWPOLLING_AUV_STATUS, std::string > status_info
 
static std::map< UWPOLLING_AUV_REASON, std::string > reason_info
 
static bool initialized = false
 

Detailed Description

Class used to represent the UWPOLLING MAC layer of the AUV

Member Enumeration Documentation

◆ UWPOLLING_AUV_REASON

Enumerator
UWPOLLING_AUV_REASON_DATA_RX 
UWPOLLING_AUV_REASON_TX_TRIGGER 
UWPOLLING_AUV_REASON_TX_POLL 
UWPOLLING_AUV_REASON_PROBE_RECEIVED 
UWPOLLING_AUV_REASON_RX_DATA_TO 
UWPOLLING_AUV_REASON_PACKET_ERROR 
UWPOLLING_AUV_REASON_LAST_PACKET_RECEIVED 
UWPOLLING_AUV_REASON_MAX_PROBE_RECEIVED 
UWPOLLING_AUV_REASON_LAST_POLLED_NODE 
UWPOLLING_AUV_REASON_PROBE_TO_EXPIRED 

◆ UWPOLLING_AUV_STATUS

< Variable that rapresent the status of the protocol machine state

Enumerator
UWPOLLING_AUV_STATUS_IDLE 
UWPOLLING_AUV_STATUS_TX_TRIGGER 
UWPOLLING_AUV_STATUS_RX_PROBES 
UWPOLLING_AUV_STATUS_RX_DATA 
UWPOLLING_AUV_STATUS_RX_ACK 
UWPOLLING_AUV_STATUS_TX_POLL 
UWPOLLING_AUV_STATUS_TX_DATA 
UWPOLLING_AUV_STATUS_WAIT_PROBE 
UWPOLLING_AUV_STATUS_WAIT_DATA 
UWPOLLING_AUV_STATUS_WAIT_ACK 

◆ UWPOLLING_PKT_TYPE

Enumerator
UWPOLLING_DATA_PKT 
UWPOLLING_POLL_PKT 
UWPOLLING_TRIGGER_PKT 
UWPOLLING_PROBE_PKT 

◆ UWPOLLING_TIMER_STATUS

Enumerator
UWPOLLING_IDLE 
UWPOLLING_RUNNING 
UWPOLLING_FROZEN 
UWPOLLING_EXPIRED 

Constructor & Destructor Documentation

◆ Uwpolling_AUV()

◆ ~Uwpolling_AUV()

Uwpolling_AUV::~Uwpolling_AUV ( )
virtual

Destructor of the Uwpolling_AUV class

Member Function Documentation

◆ ackTOExpired()

void Uwpolling_AUV::ackTOExpired ( )
protectedvirtual

ACK TIMER is Expired. In this method the reception of ACK is disabled and the protocol is moved to StateIdle

References acked, ChangeNodePolled(), and enableAckRx.

Here is the call graph for this function:

◆ addNode2List()

void Uwpolling_AUV::addNode2List ( )
protectedvirtual

◆ addSink2List()

void Uwpolling_AUV::addSink2List ( )
protectedvirtual

◆ ChangeNodePolled()

void Uwpolling_AUV::ChangeNodePolled ( )
protectedvirtual

The first element of the list of nodes is trimmed and the next node is polled.

References getEpoch(), list_probbed_node, polling_index, refreshReason(), RxDataEnabled, stateIdle(), stateTx(), TxEnabled, and UWPOLLING_AUV_REASON_LAST_POLLED_NODE.

Referenced by ackTOExpired(), DataTOExpired(), Phy2MacEndTx(), stateAckRx(), stateRxData(), and stateTx().

Here is the call graph for this function:

◆ command()

int Uwpolling_AUV::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 backoff_LUT_file, getDroppedProbePkts(), getDroppedProbeWrongState(), getPollSent(), getProbeRx(), getRxPkts(), GetTotalReceivingTime(), getTriggerTx(), getWrongNodeDataSent(), initBackoffLUT(), initialized, initInfo(), lut_token_separator, stateIdle(), and stop_count_time().

Here is the call graph for this function:

◆ computeTxTime()

void Uwpolling_AUV::computeTxTime ( UWPOLLING_PKT_TYPE  pkt)
protectedvirtual

Compute the Transmission Time for various type of packet using a CrossLayer Message to ask the PHY to compute the transmission time

Parameters
UWPOLLING_PKT_TYPEthe type of the packet
Returns
the transmission time

References max_payload, polling_index, Tdata, Tpoll, Tprobe, Ttrigger, UWPOLLING_DATA_PKT, UWPOLLING_POLL_PKT, UWPOLLING_PROBE_PKT, and UWPOLLING_TRIGGER_PKT.

Referenced by GetDataTimerValue(), getPollTime(), and stateTx().

◆ crLayCommand()

int Uwpolling_AUV::crLayCommand ( ClMessage *  m)
virtual

Cross-Layer messages interpreter

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

◆ DataTOExpired()

void Uwpolling_AUV::DataTOExpired ( )
protectedvirtual

DATA TIMER is Expired. In this method the reception of DATA is disabled.

References ChangeNodePolled(), refreshReason(), RxDataEnabled, and UWPOLLING_AUV_REASON_RX_DATA_TO.

Here is the call graph for this function:

◆ getAckRx()

int Uwpolling_AUV::getAckRx ( )
inlineprotected

Returns the number of ACK received during the simulation

Returns
int n_probe_rx the number of PROBE received

References n_ack_rx.

◆ GetDataTimerValue()

double Uwpolling_AUV::GetDataTimerValue ( )
protectedvirtual

Calculation of DATA TIMER value based on the number of packet that a node need to transmit, the packet time and the RTT between the node and the AUV

Returns
the duration of the timer.

References computeTxTime(), curr_RTT, getEpoch(), max_payload, modem_data_bit_rate, N_expected_pkt, sea_trial_, T_guard, Tdata, UpdateRTT(), and UWPOLLING_DATA_PKT.

Referenced by stateWaitData().

Here is the call graph for this function:

◆ getDroppedAckPkts()

int Uwpolling_AUV::getDroppedAckPkts ( )
inlineprotected

Return the number of PROBE packets discarded because of wrong CRC

Returns
int N_dropped_probe_pkts number of PROBE pkts dropped

References n_dropped_ack_pkts.

◆ getDroppedProbePkts()

int Uwpolling_AUV::getDroppedProbePkts ( )
inlineprotected

Return the number of PROBE packets discarded because of wrong CRC

Returns
int N_dropped_probe_pkts number of PROBE pkts dropped

References N_dropped_probe_pkts.

Referenced by command().

◆ getDroppedProbeWrongState()

int Uwpolling_AUV::getDroppedProbeWrongState ( )
inlineprotected

Return the number of PROBE packets discarded because sent after the maximum time allowed

Returns
int N_dropped_probe_wrong_state number of PROBE packets discarded because sent after the maximum time allowed

References N_dropped_probe_wrong_state.

Referenced by command().

◆ getEpoch()

◆ getMaxBackoffTime()

◆ getPollSent()

int Uwpolling_AUV::getPollSent ( )
inlineprotected

Return the number of POLL packets sent during the simulation

Returns
int n_poll_tx number of POLL packets sent during the simulation

References n_poll_tx.

Referenced by command().

◆ getPollTime()

uint16_t Uwpolling_AUV::getPollTime ( )
protectedvirtual

Estimate the time needed by the AUV to POLL all the remaining node in the probbed node list

Returns
poll time

References computeTxTime(), list_probbed_node, max_payload, max_tx_pkts, modem_data_bit_rate, sea_trial_, T_guard, Tdata, temp_buffer, tx_buffer, and UWPOLLING_DATA_PKT.

Referenced by stateTxPoll().

Here is the call graph for this function:

◆ getProbeRx()

int Uwpolling_AUV::getProbeRx ( )
inlineprotected

Returns the number of PROBE received during the simulation

Returns
int n_probe_rx the number of PROBE received

References n_probe_rx.

Referenced by command().

◆ getRxPkts()

uint Uwpolling_AUV::getRxPkts ( int  mac_addr)
protectedvirtual

Get the packets received from the node with the given mac address

References rx_pkts_map.

Referenced by command().

◆ GetTotalReceivingTime()

double Uwpolling_AUV::GetTotalReceivingTime ( )
inlineprotected

Permits to retrieve the total time in which the AUV has received DATA packets.

Returns
the amount of time

References total_time.

Referenced by command().

◆ getTriggerTx()

int Uwpolling_AUV::getTriggerTx ( )
inlineprotected

Returns the number of TRIGGER sent during the simulation

Returns
int n_trigger_tx the number of TRIGGER packet sent

References n_trigger_tx.

Referenced by command().

◆ getWrongNodeDataSent()

int Uwpolling_AUV::getWrongNodeDataSent ( )
inlineprotected

Returns the number of Data Packet sent by Nodes not polled (used for debug purposes)

Returns
int wrong_node_data_sent

References wrong_node_data_sent.

Referenced by command().

◆ handleAck()

void Uwpolling_AUV::handleAck ( )
protectedvirtual

Handle a received ack, reinserting in the buffer the packet not received by the sink.

References curr_ack_packet, getEpoch(), hdr_ACK_SINK::id_ack(), hdr_AUV_MULE::pkt_uid(), temp_buffer, and tx_buffer.

Referenced by stateAckRx().

Here is the call graph for this function:

◆ handleNoAck()

void Uwpolling_AUV::handleNoAck ( )
protectedvirtual

Handle case with no ack received. Reinsert packets in the tx buffer

References getEpoch(), temp_buffer, and tx_buffer.

Referenced by stateTx().

Here is the call graph for this function:

◆ handleProbeAck()

void Uwpolling_AUV::handleProbeAck ( )
protectedvirtual

Handle the ack received in the probe packet tx by the sink.

References curr_probe_packet, getEpoch(), hdr_PROBE_SINK::id_ack(), hdr_AUV_MULE::pkt_uid(), temp_buffer, and tx_buffer.

Referenced by stateRxProbe().

Here is the call graph for this function:

◆ incrAckRx()

void Uwpolling_AUV::incrAckRx ( )
inlineprotected

Increases the number of Ack packets received. Used for statistical purposes

References n_ack_rx.

Referenced by Phy2MacEndRx().

◆ incrDroppedAckPkts()

void Uwpolling_AUV::incrDroppedAckPkts ( )
inlineprotected

Increases the number of wrong ACK packet received. Used for statistical purposes

References n_dropped_ack_pkts.

Referenced by Phy2MacEndRx().

◆ incrDroppedProbePkts()

void Uwpolling_AUV::incrDroppedProbePkts ( )
inlineprotected

Increases the number of wrong PROBE packet received. Used for statistical purposes

References N_dropped_probe_pkts.

Referenced by Phy2MacEndRx().

◆ incrDroppedProbeWrongState()

void Uwpolling_AUV::incrDroppedProbeWrongState ( )
inlineprotected

Increase the number of PROBEs packets dropped because the AUV was not in the RX_PROBE state. This probes are sent from sensors after the maximum time allowed for PROBE transmission.

References N_dropped_probe_wrong_state.

Referenced by stateRxProbe().

◆ incrPollTx()

void Uwpolling_AUV::incrPollTx ( )
inlineprotected

Incrase the number of POLL transmitted

References n_poll_tx.

Referenced by TxPoll().

◆ incrProbeRx()

void Uwpolling_AUV::incrProbeRx ( )
inlineprotected

Increases the number of PROBE packets received. Used for statistical purposes

References n_probe_rx.

Referenced by stateRxProbe().

◆ incrTriggerTx()

void Uwpolling_AUV::incrTriggerTx ( )
inlineprotected

Increases the number of TRIGGER packets sent. Used for statistical purposes

Parameters
Packet*

References n_trigger_tx.

Referenced by TxTrigger().

◆ incrWrongNodeDataSent()

void Uwpolling_AUV::incrWrongNodeDataSent ( )
inlineprotected

Increases the number of DATA packets received from node that are not POLLED anymore (i.e. they transmit a data packet when the DataTimer is expired. Used for statistical purposes.

References wrong_node_data_sent.

Referenced by stateRxData().

◆ initBackoffLUT()

bool Uwpolling_AUV::initBackoffLUT ( )
protected

Initialize the backoff LUT. Erase it an re initialize it if already populated return false if file not found

References backoff_LUT, backoff_LUT_file, enable_adaptive_backoff, and lut_token_separator.

Referenced by command().

◆ initInfo()

◆ linearInterpolator()

double Uwpolling_AUV::linearInterpolator ( double  x,
double  x1,
double  x2,
double  y1,
double  y2 
)
protectedvirtual

Calculate the linear interpolation between two 2-D points

Parameters
xx-coordinate of which we need to finde the value.
x1x-coordinate of the first point
x2x-coordinate of the second point
y1y-coordinate of the first point
y2y-coordinate of the second point
Returns
the value assumed by y obtained by linear interpolation

References q.

Referenced by getMaxBackoffTime().

◆ Mac2PhyStartTx()

void Uwpolling_AUV::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

Pass the packet to the PHY layer

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

Referenced by txData(), TxPoll(), and TxTrigger().

◆ Phy2MacEndRx()

void Uwpolling_AUV::Phy2MacEndRx ( Packet *  p)
protectedvirtual

◆ Phy2MacEndTx()

void Uwpolling_AUV::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_enabled, ChangeNodePolled(), getEpoch(), n_pkts_to_tx, n_tx_pkts, PT_POLL, PT_TRIGGER, refreshReason(), stateTxData(), stateWaitAck(), stateWaitData(), stateWaitProbe(), and UWPOLLING_AUV_REASON_TX_TRIGGER.

Here is the call graph for this function:

◆ Phy2MacStartRx()

void Uwpolling_AUV::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 getEpoch(), PT_ACK_SINK, PT_PROBE, and PT_PROBE_SINK.

Here is the call graph for this function:

◆ ProbeTOExpired()

void Uwpolling_AUV::ProbeTOExpired ( )
protectedvirtual

PROBE TIMER is Expired. In this method the reception of PROBE is disabled

References getEpoch(), polling_index, refreshReason(), RxProbeEnabled, stateIdle(), stateTx(), TxEnabled, and UWPOLLING_AUV_REASON_PROBE_TO_EXPIRED.

Here is the call graph for this function:

◆ recvFromUpperLayers()

void Uwpolling_AUV::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Handle a packet coming from upper layers

Parameters
ppointer to the packet

References getEpoch(), max_buffer_size, out_file_stats, hdr_AUV_MULE::pkt_uid(), print_stats_, sea_trial_, hdr_uwcbr::sn_, temp_buffer, tx_buffer, and uid_tx_pkt.

Here is the call graph for this function:

◆ refreshReason()

virtual void Uwpolling_AUV::refreshReason ( UWPOLLING_AUV_REASON  reason)
inlineprotectedvirtual

Refresh the reason for the changing of the state

Parameters
UWPOLLING_AUV_REASONThe reason of the change of the state

References last_reason, and reason.

Referenced by ChangeNodePolled(), DataTOExpired(), Phy2MacEndRx(), Phy2MacEndTx(), ProbeTOExpired(), stateRxData(), stateRxProbe(), and stateTxTrigger().

◆ refreshState()

virtual void Uwpolling_AUV::refreshState ( UWPOLLING_AUV_STATUS  state)
inlineprotectedvirtual

Refresh the state of the protocol

Parameters
UWPOLLING_AUV_STATUScurrent state of the protcol

References curr_state, and prev_state.

Referenced by stateAckRx(), stateIdle(), stateRxData(), stateRxProbe(), stateTxData(), stateTxPoll(), stateTxTrigger(), stateWaitAck(), stateWaitData(), and stateWaitProbe().

◆ SortNode2Poll()

void Uwpolling_AUV::SortNode2Poll ( )
protectedvirtual

Method in which the node that has sent correctly the PROBE packet is sorted in order to give the priority to the nodes that has the most recent data packet.

ELEMENTS SHOULD BE ORDERED, ONLY NEED TO INSERT SINK IN THE RIGHT POSITION

References curr_is_sink, curr_node_id, curr_polled_node_address, curr_Tmeasured, getEpoch(), list_probbed_node, max_tx_pkts, N_expected_pkt, probbed_sink, sink_inserted, temp_buffer, and tx_buffer.

Referenced by stateTx().

Here is the call graph for this function:

◆ stateAckRx()

void Uwpolling_AUV::stateAckRx ( )
protectedvirtual

Handle the recption of an ACK from the sink

References ack_timer, acked, ChangeNodePolled(), curr_ack_packet, enableAckRx, getEpoch(), handleAck(), refreshState(), and UWPOLLING_AUV_STATUS_RX_ACK.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

◆ stateIdle()

void Uwpolling_AUV::stateIdle ( )
protectedvirtual

IDLE state. Each variable is resetted

References data_timer, getEpoch(), n_tx_pkts, polling_index, probe_timer, refreshState(), stateTxTrigger(), TxEnabled, and UWPOLLING_AUV_STATUS_IDLE.

Referenced by ChangeNodePolled(), command(), ProbeTOExpired(), and stateTxPoll().

Here is the call graph for this function:

◆ stateRxData()

◆ stateRxProbe()

◆ stateTx()

void Uwpolling_AUV::stateTx ( )
protectedvirtual

◆ stateTxData()

void Uwpolling_AUV::stateTxData ( )
protectedvirtual

Handle the data transmission after poll reception.

References curr_tx_data_packet, last_pkt_uid, hdr_AUV_MULE::last_pkt_uid(), n_tx_pkts, refreshState(), temp_buffer, tx_buffer, txData(), TxEnabled, and UWPOLLING_AUV_STATUS_TX_DATA.

Referenced by Phy2MacEndTx(), and stateTx().

Here is the call graph for this function:

◆ stateTxPoll()

void Uwpolling_AUV::stateTxPoll ( )
protectedvirtual

◆ stateTxTrigger()

void Uwpolling_AUV::stateTxTrigger ( )
protectedvirtual

◆ stateWaitAck()

void Uwpolling_AUV::stateWaitAck ( )
protectedvirtual

State of the protcol in which the ACK timer is set up

References enableAckRx, getEpoch(), refreshState(), TxEnabled, and UWPOLLING_AUV_STATUS_WAIT_ACK.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateWaitData()

void Uwpolling_AUV::stateWaitData ( )
protectedvirtual

State of the protocol in which the DATA timer is set up

References data_timer, GetDataTimerValue(), getEpoch(), packet_index, refreshState(), RxDataEnabled, Uwpolling_AUV::Uwpolling_AUV_Timer::schedule(), and UWPOLLING_AUV_STATUS_WAIT_DATA.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stateWaitProbe()

void Uwpolling_AUV::stateWaitProbe ( )
protectedvirtual

State of the protocol in which the PROBE timer is set up.

References getEpoch(), probe_timer, refreshState(), RxProbeEnabled, Uwpolling_AUV::Uwpolling_AUV_Timer::schedule(), T_probe, and UWPOLLING_AUV_STATUS_WAIT_PROBE.

Referenced by Phy2MacEndTx().

Here is the call graph for this function:

◆ stop_count_time()

void Uwpolling_AUV::stop_count_time ( )
protectedvirtual

Informs the protocol to stop counting the time in which the AUV receive DATA packets from the nodes It is used to compute the throughput at MAC layer.

References initial_time, pkt_time, stop_time, and total_time.

Referenced by command().

◆ txData()

void Uwpolling_AUV::txData ( )
protectedvirtual

Transmit data transmission after poll reception.

References curr_tx_data_packet, getEpoch(), and Mac2PhyStartTx().

Referenced by stateTxData().

Here is the call graph for this function:

◆ TxPoll()

void Uwpolling_AUV::TxPoll ( )
protectedvirtual

Transmisssion of the POLL packet

References curr_poll_packet, getEpoch(), incrPollTx(), and Mac2PhyStartTx().

Referenced by stateTxPoll().

Here is the call graph for this function:

◆ TxTrigger()

void Uwpolling_AUV::TxTrigger ( )
protectedvirtual

Transmission of the TRIGGER packet

References curr_trigger_packet, getEpoch(), incrTriggerTx(), and Mac2PhyStartTx().

Referenced by stateTxTrigger().

Here is the call graph for this function:

◆ UpdateRTT()

void Uwpolling_AUV::UpdateRTT ( )
protectedvirtual

Update the RTT between a node and the AUV based on the time elapsed between the transmisison of the TRIGGER and the reception of the PROBE

References curr_RTT, curr_Tmeasured, and getEpoch().

Referenced by GetDataTimerValue().

Here is the call graph for this function:

◆ waitForUser()

void Uwpolling_AUV::waitForUser ( )
protectedvirtual

Used for debug purposes. (Permit to have a "step by step" behaviour of the protocol)

Member Data Documentation

◆ ack_enabled

int Uwpolling_AUV::ack_enabled
protected

True if ack is enabled, false if disabled, default true

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), stateTx(), and Uwpolling_AUV().

◆ ack_timer

AckTimer Uwpolling_AUV::ack_timer
protected

ACK Timer

Referenced by stateAckRx(), and stateTx().

◆ acked

bool Uwpolling_AUV::acked
protected

True if an ack has been received

Referenced by ackTOExpired(), stateAckRx(), stateRxProbe(), and stateTx().

◆ backoff_LUT

std::map<double, double> Uwpolling_AUV::backoff_LUT
protected

Map with the backoff LUT

Referenced by getMaxBackoffTime(), and initBackoffLUT().

◆ backoff_LUT_file

std::string Uwpolling_AUV::backoff_LUT_file
protected

File name of the backoff LUT

Referenced by command(), and initBackoffLUT().

◆ begin

bool Uwpolling_AUV::begin
protected

indicate the first PROBE received

Referenced by Phy2MacEndRx().

◆ curr_ack_packet

Packet* Uwpolling_AUV::curr_ack_packet
protected

Pointer to the current ACK packet

Referenced by handleAck(), Phy2MacEndRx(), and stateAckRx().

◆ curr_data_packet

Packet* Uwpolling_AUV::curr_data_packet
protected

Pointer to the current DATA packet

Referenced by Phy2MacEndRx(), and stateRxData().

◆ curr_is_sink

bool Uwpolling_AUV::curr_is_sink
protected

True if the current node of the list is a sink.

Referenced by SortNode2Poll(), and stateTx().

◆ curr_node_id

uint Uwpolling_AUV::curr_node_id
protected

ID of the node polled

Referenced by SortNode2Poll(), and stateTxPoll().

◆ curr_poll_packet

Packet* Uwpolling_AUV::curr_poll_packet
protected

Pointer to the current POLL packet

Referenced by stateTxPoll(), and TxPoll().

◆ curr_polled_node_address

int Uwpolling_AUV::curr_polled_node_address
protected

MAC address of the node polled

Referenced by SortNode2Poll(), and stateRxData().

◆ curr_probe_packet

Packet* Uwpolling_AUV::curr_probe_packet
protected

Pointer to the current PROBE packet

Referenced by addNode2List(), addSink2List(), handleProbeAck(), Phy2MacEndRx(), and stateRxProbe().

◆ curr_RTT

double Uwpolling_AUV::curr_RTT
protected

Round Trip time of the node polled

Referenced by GetDataTimerValue(), and UpdateRTT().

◆ curr_state

UWPOLLING_AUV_STATUS Uwpolling_AUV::curr_state
protected

◆ curr_Tmeasured

double Uwpolling_AUV::curr_Tmeasured
protected

Time elapsed between the transmission of the TRIGGER and the reception of the PROBE packet by the polled node

Referenced by SortNode2Poll(), stateTx(), and UpdateRTT().

◆ curr_trigger_packet

Packet* Uwpolling_AUV::curr_trigger_packet
protected

true if the sink has been inserted in the list Pointer to the current TRIGGER packet

Referenced by stateTxTrigger(), and TxTrigger().

◆ curr_tx_data_packet

Packet* Uwpolling_AUV::curr_tx_data_packet
protected

Pointer to the current DATA packet

Referenced by stateTxData(), and txData().

◆ DATA_POLL_guard_time_

int Uwpolling_AUV::DATA_POLL_guard_time_
protected

Guard time between the reception of the last data and the transmission of the following POLL

Referenced by stateRxData(), and Uwpolling_AUV().

◆ data_timer

DataTimer Uwpolling_AUV::data_timer
protected

Data timer

Referenced by stateIdle(), stateRxData(), and stateWaitData().

◆ distance

double Uwpolling_AUV::distance
protected

Distance between the AUV and the current node

◆ enable_adaptive_backoff

bool Uwpolling_AUV::enable_adaptive_backoff
protected

Set to true if backoff is chosen adaptively

Referenced by getMaxBackoffTime(), and initBackoffLUT().

◆ enableAckRx

bool Uwpolling_AUV::enableAckRx
protected

True if the ack reception is enabled

Referenced by ackTOExpired(), stateAckRx(), and stateWaitAck().

◆ fout

std::ofstream Uwpolling_AUV::fout
protected

Variable that handle the file in which the protocol write the state transition for debug purposes

◆ full_knowledge

int Uwpolling_AUV::full_knowledge
protected

Set to a number != 0 means we have full_knowledge about the estimate of neighbors

Referenced by getMaxBackoffTime(), and Uwpolling_AUV().

◆ initial_time

double Uwpolling_AUV::initial_time
protected

Timestamp in which the AUV receive the first data packet

Referenced by Phy2MacEndRx(), and stop_count_time().

◆ initialized

bool Uwpolling_AUV::initialized = false
staticprotected

Map the UWPOLLING_AUV_REASON to the description of each reason Indicate if the protocol has been initialized or not

Referenced by command(), and initInfo().

◆ last_pkt_uid

uint16_t Uwpolling_AUV::last_pkt_uid
protected

ID of the last packet transmitted in the round

Referenced by stateTx(), and stateTxData().

◆ last_probe_lost

int Uwpolling_AUV::last_probe_lost
protected

Referenced by getMaxBackoffTime().

◆ last_reason

UWPOLLING_AUV_REASON Uwpolling_AUV::last_reason
protected

Current and previous reason for the change of the state

Referenced by refreshReason().

◆ list_probbed_node

std::vector<probbed_node> Uwpolling_AUV::list_probbed_node
protected

list of nodes that have sent correctly the PROBE

Referenced by addNode2List(), ChangeNodePolled(), getPollTime(), and SortNode2Poll().

◆ lut_token_separator

char Uwpolling_AUV::lut_token_separator
protected

LUT token separator

Referenced by command(), and initBackoffLUT().

◆ max_buffer_size

uint Uwpolling_AUV::max_buffer_size
protected

Temp buffer where packets are insert waiting for an ACK Max size for the transmission buffer

Referenced by recvFromUpperLayers(), and Uwpolling_AUV().

◆ max_payload

int Uwpolling_AUV::max_payload
protected

Duration of ACK_TIMER Dimension of the DATA payload

Referenced by computeTxTime(), GetDataTimerValue(), getPollTime(), stateTx(), and Uwpolling_AUV().

◆ max_polled_node

int Uwpolling_AUV::max_polled_node
protected

Maximum number of node that the AUV can poll each time.

Referenced by stateRxProbe(), and Uwpolling_AUV().

◆ max_tx_pkts

uint Uwpolling_AUV::max_tx_pkts
protected

Max number of packets can be transmitted by the AUV during a TxData session

Referenced by getPollTime(), SortNode2Poll(), stateTx(), and Uwpolling_AUV().

◆ modem_data_bit_rate

int Uwpolling_AUV::modem_data_bit_rate
protected

Bit rate of the modem used

Referenced by GetDataTimerValue(), getPollTime(), stateTx(), and Uwpolling_AUV().

◆ n_ack_rx

int Uwpolling_AUV::n_ack_rx
protected

Number of ack packets received

Referenced by getAckRx(), and incrAckRx().

◆ n_dropped_ack_pkts

int Uwpolling_AUV::n_dropped_ack_pkts
protected

Number of ACK dropped pkts

Referenced by getDroppedAckPkts(), and incrDroppedAckPkts().

◆ N_dropped_probe_pkts

int Uwpolling_AUV::N_dropped_probe_pkts
protected

Number of PROBE dropped because of CRC error

Referenced by getDroppedProbePkts(), and incrDroppedProbePkts().

◆ N_dropped_probe_wrong_state

int Uwpolling_AUV::N_dropped_probe_wrong_state
protected

Number of PROBE dropped because the AUV was not in RX_PROBE mode

Referenced by getDroppedProbeWrongState(), and incrDroppedProbeWrongState().

◆ N_expected_pkt

int Uwpolling_AUV::N_expected_pkt
protected

Number of packets that the node polled wish to transmit to the AUV

Referenced by GetDataTimerValue(), SortNode2Poll(), and stateRxData().

◆ n_pkts_to_tx

uint Uwpolling_AUV::n_pkts_to_tx
protected

Number of packets to transmit during a TxData session

Referenced by Phy2MacEndTx(), and stateTx().

◆ n_poll_tx

int Uwpolling_AUV::n_poll_tx
protected

Number of POLL packets sent

Referenced by getPollSent(), and incrPollTx().

◆ n_probe_rx

uint Uwpolling_AUV::n_probe_rx
protected

Number of PROBE packets received

Referenced by getProbeRx(), and incrProbeRx().

◆ n_run

int Uwpolling_AUV::n_run
protected

Referenced by initInfo(), and Uwpolling_AUV().

◆ n_trigger_tx

int Uwpolling_AUV::n_trigger_tx
protected

Number of TRIGGER packets sent

Referenced by getTriggerTx(), and incrTriggerTx().

◆ n_tx_pkts

uint Uwpolling_AUV::n_tx_pkts
protected

Number of packets transmitted by the AUV during a TxData session

Referenced by Phy2MacEndTx(), stateIdle(), and stateTxData().

◆ out_file_stats

std::ofstream Uwpolling_AUV::out_file_stats
protected

Variable that handle the file in which the protocol write the statistics

Referenced by initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxData(), stateRxProbe(), stateTxPoll(), and stateTxTrigger().

◆ packet_index

int Uwpolling_AUV::packet_index
protected

Variable that indicate the number of the packet that has been just received by the AUV

Referenced by stateRxData(), and stateWaitData().

◆ pkt_time

double Uwpolling_AUV::pkt_time
protected

Time needed to transmit a data packet

Referenced by Phy2MacEndRx(), and stop_count_time().

◆ pkt_type_info

std::map< Uwpolling_AUV::UWPOLLING_PKT_TYPE, std::string > Uwpolling_AUV::pkt_type_info
staticprotected

Map the UWPOLLING_PKT_TYPE to the description of each type of packet

Referenced by initInfo().

◆ poll_timer

PollTimer Uwpolling_AUV::poll_timer
protected

POLL Timer

Referenced by stateRxData().

◆ POLL_uid

uint Uwpolling_AUV::POLL_uid
protected

POLL Unique ID

Referenced by stateTxPoll().

◆ polling_index

int Uwpolling_AUV::polling_index
protected

Index of the node that the AUV is polling

Referenced by addNode2List(), addSink2List(), ChangeNodePolled(), computeTxTime(), ProbeTOExpired(), stateIdle(), stateRxProbe(), and stateTxPoll().

◆ prev_state

UWPOLLING_AUV_STATUS Uwpolling_AUV::prev_state
protected

Current and previous state variable

Referenced by refreshState().

◆ print_stats_

int Uwpolling_AUV::print_stats_
protected

Print protocol's statistics of the protocol

Referenced by initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxData(), stateRxProbe(), stateTxPoll(), stateTxTrigger(), and Uwpolling_AUV().

◆ probbed_sink

probbed_node Uwpolling_AUV::probbed_sink
protected

Element with sink probe data

Referenced by addSink2List(), and SortNode2Poll().

◆ probe_counters

probe_cicle_counters Uwpolling_AUV::probe_counters
protected

Number of probe detected in a round (i.e., prehamble received)

Referenced by getMaxBackoffTime(), Phy2MacEndRx(), stateTxTrigger(), and Uwpolling_AUV().

◆ probe_rtt

double Uwpolling_AUV::probe_rtt
protected

RTT calculation between AUV and NODE based on the time of PROBE transmission and reception

Referenced by addNode2List(), addSink2List(), and Phy2MacEndRx().

◆ probe_timer

ProbeTimer Uwpolling_AUV::probe_timer
protected

PROBE Timer

Referenced by stateIdle(), stateRxProbe(), and stateWaitProbe().

◆ reason

UWPOLLING_AUV_REASON Uwpolling_AUV::reason
protected

Referenced by refreshReason().

◆ reason_info

std::map< Uwpolling_AUV::UWPOLLING_AUV_REASON, std::string > Uwpolling_AUV::reason_info
staticprotected

Map the UWPOLLING_AUV_STATUS to the description of each state

Referenced by initInfo().

◆ rx_pkts_map

std::map<int, uint> Uwpolling_AUV::rx_pkts_map
protected

Map (mac_addr,rx_pkts) with the received packets for each node

Referenced by addNode2List(), getRxPkts(), and stateRxData().

◆ RxDataEnabled

bool Uwpolling_AUV::RxDataEnabled
protected

true if the AUV is enabled to receive DATA packets, false otherwise

Referenced by ChangeNodePolled(), DataTOExpired(), stateRxData(), and stateWaitData().

◆ RxProbeEnabled

bool Uwpolling_AUV::RxProbeEnabled
protected

true if the AUV is enabled to receive PROBE packets, false otherwise

Referenced by ProbeTOExpired(), stateRxProbe(), and stateWaitProbe().

◆ sea_trial_

int Uwpolling_AUV::sea_trial_
protected

Sea Trial flag: To activate if the protocol is going to be tested at the sea

Referenced by GetDataTimerValue(), getPollTime(), initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxData(), stateRxProbe(), stateTx(), stateTxPoll(), stateTxTrigger(), and Uwpolling_AUV().

◆ sink_inserted

bool Uwpolling_AUV::sink_inserted
protected

Referenced by addSink2List(), and SortNode2Poll().

◆ status_info

std::map< Uwpolling_AUV::UWPOLLING_AUV_STATUS, std::string > Uwpolling_AUV::status_info
staticprotected

◆ stop_time

double Uwpolling_AUV::stop_time
protected

Time stamp in which the AUV finish to receive data packets

Referenced by stop_count_time().

◆ T_ack_timer

double Uwpolling_AUV::T_ack_timer
protected

Referenced by stateTx(), and Uwpolling_AUV().

◆ T_guard

double Uwpolling_AUV::T_guard
protected

Guard time added to the calculation of the RTT

Referenced by GetDataTimerValue(), getPollTime(), stateTx(), and Uwpolling_AUV().

◆ T_max

double Uwpolling_AUV::T_max
protected

Maximum value in which the node can choose his backoff time

Referenced by getMaxBackoffTime(), stateTxTrigger(), and Uwpolling_AUV().

◆ T_min

double Uwpolling_AUV::T_min
protected

Minimum value in which the node can choose his backoff time

Referenced by stateTxTrigger(), and Uwpolling_AUV().

◆ T_probe

double Uwpolling_AUV::T_probe
protected

Duration of PROBE TIMER

Referenced by getMaxBackoffTime(), stateWaitProbe(), and Uwpolling_AUV().

◆ T_probe_guard

double Uwpolling_AUV::T_probe_guard
protected

Guard time for PROBE packet: T_probe=T_max+T_probe_guard

Referenced by getMaxBackoffTime(), and Uwpolling_AUV().

◆ Tdata

double Uwpolling_AUV::Tdata
protected

Time needed to transmit a DATA packet

Referenced by computeTxTime(), GetDataTimerValue(), getPollTime(), and stateTx().

◆ temp_buffer

std::deque<Packet *> Uwpolling_AUV::temp_buffer
protected

◆ total_time

double Uwpolling_AUV::total_time
protected

Total time in which the AUV has received data packets

Referenced by GetTotalReceivingTime(), and stop_count_time().

◆ Tpoll

double Uwpolling_AUV::Tpoll
protected

Time needed to transmit a POLL packet

Referenced by computeTxTime().

◆ Tprobe

double Uwpolling_AUV::Tprobe
protected

Time needed to transmit a PROBE packet

Referenced by computeTxTime().

◆ TRIGGER_uid

uint Uwpolling_AUV::TRIGGER_uid
protected

TRIGGER Unique ID

Referenced by stateTxTrigger().

◆ Ttrigger

double Uwpolling_AUV::Ttrigger
protected

Time needed to transmit a TRIGGER packet

Referenced by computeTxTime().

◆ tx_buffer

std::deque<Packet *> Uwpolling_AUV::tx_buffer
protected

◆ TxEnabled

bool Uwpolling_AUV::TxEnabled
protected

true if the AUV is enabled to receive POLL packets, false otherwise

Referenced by ChangeNodePolled(), ProbeTOExpired(), stateIdle(), stateRxProbe(), stateTx(), stateTxData(), stateTxPoll(), and stateWaitAck().

◆ uid_tx_pkt

uint16_t Uwpolling_AUV::uid_tx_pkt
protected

Unique ID of the transmitted packets

Referenced by recvFromUpperLayers().

◆ wrong_node_data_sent

int Uwpolling_AUV::wrong_node_data_sent
protected

Number of data sent by a node that isn't polled anymore

Referenced by getWrongNodeDataSent(), and incrWrongNodeDataSent().


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