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

#include <uwpolling_AUV.h>

Inheritance diagram for Uwpolling_AUV:
Collaboration diagram for Uwpolling_AUV:

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.

Definition at line 181 of file uwpolling_AUV.h.

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 

Definition at line 233 of file uwpolling_AUV.h.

◆ 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 

Definition at line 219 of file uwpolling_AUV.h.

◆ UWPOLLING_PKT_TYPE

Enumerator
UWPOLLING_DATA_PKT 
UWPOLLING_POLL_PKT 
UWPOLLING_TRIGGER_PKT 
UWPOLLING_PROBE_PKT 

Definition at line 247 of file uwpolling_AUV.h.

◆ UWPOLLING_TIMER_STATUS

Enumerator
UWPOLLING_IDLE 
UWPOLLING_RUNNING 
UWPOLLING_FROZEN 
UWPOLLING_EXPIRED 

Definition at line 255 of file uwpolling_AUV.h.

Constructor & Destructor Documentation

◆ Uwpolling_AUV()

Uwpolling_AUV::Uwpolling_AUV ( )

Constructor of the Uwpolling_AUV class.

Definition at line 89 of file uwpolling_AUV.cpp.

◆ ~Uwpolling_AUV()

Uwpolling_AUV::~Uwpolling_AUV ( )
virtual

Destructor of the Uwpolling_AUV class.

Definition at line 76 of file uwpolling_AUV.cpp.

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

Definition at line 424 of file uwpolling_AUV.cpp.

◆ addNode2List()

void Uwpolling_AUV::addNode2List ( )
protectedvirtual

Add a node to the list of probbed nodes.

Definition at line 1317 of file uwpolling_AUV.cpp.

◆ addSink2List()

void Uwpolling_AUV::addSink2List ( )
protectedvirtual

Add a sink node to the list of probbed nodes.

Definition at line 1347 of file uwpolling_AUV.cpp.

◆ ChangeNodePolled()

void Uwpolling_AUV::ChangeNodePolled ( )
protectedvirtual

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

Definition at line 799 of file uwpolling_AUV.cpp.

◆ 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.

Definition at line 185 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 685 of file uwpolling_AUV.cpp.

◆ 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.

Definition at line 348 of file uwpolling_AUV.cpp.

◆ DataTOExpired()

void Uwpolling_AUV::DataTOExpired ( )
protectedvirtual

DATA TIMER is Expired.

In this method the reception of DATA is disabled.

Definition at line 399 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 718 of file uwpolling_AUV.h.

◆ 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.

Definition at line 540 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 759 of file uwpolling_AUV.h.

◆ 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

Definition at line 749 of file uwpolling_AUV.h.

◆ 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

Definition at line 772 of file uwpolling_AUV.h.

◆ getEpoch()

unsigned long int Uwpolling_AUV::getEpoch ( )
inlineprotected

Calculate the epoch of the event.

Used in sea-trial mode

Returns
the epoch of the system

Definition at line 915 of file uwpolling_AUV.h.

◆ getMaxBackoffTime()

double Uwpolling_AUV::getMaxBackoffTime ( )
protected

Reference to the backoff_time variable.

Definition at line 271 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 739 of file uwpolling_AUV.h.

◆ 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

Definition at line 1362 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 708 of file uwpolling_AUV.h.

◆ getRxPkts()

uint Uwpolling_AUV::getRxPkts ( int  mac_addr)
protectedvirtual

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

Definition at line 1384 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 901 of file uwpolling_AUV.h.

◆ 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

Definition at line 698 of file uwpolling_AUV.h.

◆ 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

Definition at line 729 of file uwpolling_AUV.h.

◆ handleAck()

void Uwpolling_AUV::handleAck ( )
protectedvirtual

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

Definition at line 1230 of file uwpolling_AUV.cpp.

◆ handleNoAck()

void Uwpolling_AUV::handleNoAck ( )
protectedvirtual

Handle case with no ack received.

Reinsert packets in the tx buffer

Definition at line 1267 of file uwpolling_AUV.cpp.

◆ handleProbeAck()

void Uwpolling_AUV::handleProbeAck ( )
protectedvirtual

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

Definition at line 1280 of file uwpolling_AUV.cpp.

◆ incrAckRx()

void Uwpolling_AUV::incrAckRx ( )
inlineprotected

Increases the number of Ack packets received.

Used for statistical purposes

Definition at line 635 of file uwpolling_AUV.h.

◆ incrDroppedAckPkts()

void Uwpolling_AUV::incrDroppedAckPkts ( )
inlineprotected

Increases the number of wrong ACK packet received.

Used for statistical purposes

Definition at line 667 of file uwpolling_AUV.h.

◆ incrDroppedProbePkts()

void Uwpolling_AUV::incrDroppedProbePkts ( )
inlineprotected

Increases the number of wrong PROBE packet received.

Used for statistical purposes

Definition at line 657 of file uwpolling_AUV.h.

◆ 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.

Definition at line 679 of file uwpolling_AUV.h.

◆ incrPollTx()

void Uwpolling_AUV::incrPollTx ( )
inlineprotected

Incrase the number of POLL transmitted.

Definition at line 688 of file uwpolling_AUV.h.

◆ incrProbeRx()

void Uwpolling_AUV::incrProbeRx ( )
inlineprotected

Increases the number of PROBE packets received.

Used for statistical purposes

Definition at line 625 of file uwpolling_AUV.h.

◆ incrTriggerTx()

void Uwpolling_AUV::incrTriggerTx ( )
inlineprotected

Increases the number of TRIGGER packets sent.

Used for statistical purposes

Parameters
Packet*

Definition at line 615 of file uwpolling_AUV.h.

◆ 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.

Definition at line 647 of file uwpolling_AUV.h.

◆ 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

Definition at line 247 of file uwpolling_AUV.cpp.

◆ initInfo()

void Uwpolling_AUV::initInfo ( )
protectedvirtual

Prints a file with every state change for debug purposes.

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

Definition at line 998 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 339 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 432 of file uwpolling_AUV.cpp.

◆ Phy2MacEndRx()

void Uwpolling_AUV::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 582 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 481 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 563 of file uwpolling_AUV.cpp.

◆ ProbeTOExpired()

void Uwpolling_AUV::ProbeTOExpired ( )
protectedvirtual

PROBE TIMER is Expired.

In this method the reception of PROBE is disabled

Definition at line 407 of file uwpolling_AUV.cpp.

◆ recvFromUpperLayers()

void Uwpolling_AUV::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Handle a packet coming from upper layers.

Parameters
ppointer to the packet

Definition at line 1061 of file uwpolling_AUV.cpp.

◆ 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

Definition at line 782 of file uwpolling_AUV.h.

◆ 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

Definition at line 792 of file uwpolling_AUV.h.

◆ 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

Definition at line 953 of file uwpolling_AUV.cpp.

◆ stateAckRx()

void Uwpolling_AUV::stateAckRx ( )
protectedvirtual

Handle the recption of an ACK from the sink.

Definition at line 1212 of file uwpolling_AUV.cpp.

◆ stateIdle()

void Uwpolling_AUV::stateIdle ( )
protectedvirtual

IDLE state.

Each variable is resetted

Definition at line 983 of file uwpolling_AUV.cpp.

◆ stateRxData()

void Uwpolling_AUV::stateRxData ( )
protectedvirtual

State of the protocol in which there's a reception of a DATA packet.

Definition at line 733 of file uwpolling_AUV.cpp.

◆ stateRxProbe()

void Uwpolling_AUV::stateRxProbe ( )
protectedvirtual

State of the protocol in which there's a reception of a PROBE packet.

Parameters
UWPOLLING_AUV_STATUSstate

Definition at line 818 of file uwpolling_AUV.cpp.

◆ stateTx()

void Uwpolling_AUV::stateTx ( )
protectedvirtual

Handle the transmission after poll reception.

Decide if transmit data to the sink or to trnasmit poll to other nodes in the list

Definition at line 1095 of file uwpolling_AUV.cpp.

◆ stateTxData()

void Uwpolling_AUV::stateTxData ( )
protectedvirtual

Handle the data transmission after poll reception.

Definition at line 1173 of file uwpolling_AUV.cpp.

◆ stateTxPoll()

void Uwpolling_AUV::stateTxPoll ( )
protectedvirtual

State of the protocol in which a POLL packet is initialized.

Definition at line 895 of file uwpolling_AUV.cpp.

◆ stateTxTrigger()

void Uwpolling_AUV::stateTxTrigger ( )
protectedvirtual

State of the protocol in which a TRIGGER packet is initialized.

Definition at line 438 of file uwpolling_AUV.cpp.

◆ stateWaitAck()

void Uwpolling_AUV::stateWaitAck ( )
protectedvirtual

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

Definition at line 1201 of file uwpolling_AUV.cpp.

◆ stateWaitData()

void Uwpolling_AUV::stateWaitData ( )
protectedvirtual

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

Definition at line 526 of file uwpolling_AUV.cpp.

◆ stateWaitProbe()

void Uwpolling_AUV::stateWaitProbe ( )
protectedvirtual

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

Definition at line 510 of file uwpolling_AUV.cpp.

◆ 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.

Definition at line 1052 of file uwpolling_AUV.cpp.

◆ txData()

void Uwpolling_AUV::txData ( )
protectedvirtual

Transmit data transmission after poll reception.

Definition at line 1191 of file uwpolling_AUV.cpp.

◆ TxPoll()

void Uwpolling_AUV::TxPoll ( )
protectedvirtual

Transmisssion of the POLL packet.

Definition at line 942 of file uwpolling_AUV.cpp.

◆ TxTrigger()

void Uwpolling_AUV::TxTrigger ( )
protectedvirtual

Transmission of the TRIGGER packet.

Definition at line 470 of file uwpolling_AUV.cpp.

◆ 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.

Definition at line 724 of file uwpolling_AUV.cpp.

◆ waitForUser()

void Uwpolling_AUV::waitForUser ( )
protectedvirtual

Used for debug purposes.

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

Definition at line 1044 of file uwpolling_AUV.cpp.

Member Data Documentation

◆ ack_enabled

int Uwpolling_AUV::ack_enabled
protected

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

Definition at line 1154 of file uwpolling_AUV.h.

◆ ack_timer

AckTimer Uwpolling_AUV::ack_timer
protected

ACK Timer.

Definition at line 1011 of file uwpolling_AUV.h.

◆ acked

bool Uwpolling_AUV::acked
protected

True if an ack has been received.

Definition at line 1152 of file uwpolling_AUV.h.

◆ backoff_LUT

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

Map with the backoff LUT.

Definition at line 1161 of file uwpolling_AUV.h.

◆ backoff_LUT_file

std::string Uwpolling_AUV::backoff_LUT_file
protected

File name of the backoff LUT.

Definition at line 1159 of file uwpolling_AUV.h.

◆ begin

bool Uwpolling_AUV::begin
protected

indicate the first PROBE received

Definition at line 1110 of file uwpolling_AUV.h.

◆ curr_ack_packet

Packet* Uwpolling_AUV::curr_ack_packet
protected

Pointer to the current ACK packet.

Definition at line 1025 of file uwpolling_AUV.h.

◆ curr_data_packet

Packet* Uwpolling_AUV::curr_data_packet
protected

Pointer to the current DATA packet.

Definition at line 1022 of file uwpolling_AUV.h.

◆ curr_is_sink

bool Uwpolling_AUV::curr_is_sink
protected

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

Definition at line 1142 of file uwpolling_AUV.h.

◆ curr_node_id

uint Uwpolling_AUV::curr_node_id
protected

ID of the node polled.

Definition at line 1091 of file uwpolling_AUV.h.

◆ curr_poll_packet

Packet* Uwpolling_AUV::curr_poll_packet
protected

Pointer to the current POLL packet.

Definition at line 1021 of file uwpolling_AUV.h.

◆ curr_polled_node_address

int Uwpolling_AUV::curr_polled_node_address
protected

MAC address of the node polled.

Definition at line 1089 of file uwpolling_AUV.h.

◆ curr_probe_packet

Packet* Uwpolling_AUV::curr_probe_packet
protected

Pointer to the current PROBE packet.

Definition at line 1023 of file uwpolling_AUV.h.

◆ curr_RTT

double Uwpolling_AUV::curr_RTT
protected

Round Trip time of the node polled.

Definition at line 1096 of file uwpolling_AUV.h.

◆ curr_state

UWPOLLING_AUV_STATUS Uwpolling_AUV::curr_state
protected

Definition at line 1053 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1097 of file uwpolling_AUV.h.

◆ 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

Definition at line 1020 of file uwpolling_AUV.h.

◆ curr_tx_data_packet

Packet* Uwpolling_AUV::curr_tx_data_packet
protected

Pointer to the current DATA packet.

Definition at line 1024 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1047 of file uwpolling_AUV.h.

◆ data_timer

DataTimer Uwpolling_AUV::data_timer
protected

Data timer.

Definition at line 1008 of file uwpolling_AUV.h.

◆ distance

double Uwpolling_AUV::distance
protected

Distance between the AUV and the current node.

Definition at line 1083 of file uwpolling_AUV.h.

◆ enable_adaptive_backoff

bool Uwpolling_AUV::enable_adaptive_backoff
protected

Set to true if backoff is chosen adaptively.

Definition at line 1158 of file uwpolling_AUV.h.

◆ enableAckRx

bool Uwpolling_AUV::enableAckRx
protected

True if the ack reception is enabled.

Definition at line 1151 of file uwpolling_AUV.h.

◆ fout

std::ofstream Uwpolling_AUV::fout
protected

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

Definition at line 1130 of file uwpolling_AUV.h.

◆ full_knowledge

int Uwpolling_AUV::full_knowledge
protected

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

Definition at line 1163 of file uwpolling_AUV.h.

◆ initial_time

double Uwpolling_AUV::initial_time
protected

Timestamp in which the AUV receive the first data packet.

Definition at line 1104 of file uwpolling_AUV.h.

◆ 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

Definition at line 1073 of file uwpolling_AUV.h.

◆ last_pkt_uid

uint16_t Uwpolling_AUV::last_pkt_uid
protected

ID of the last packet transmitted in the round.

Definition at line 1149 of file uwpolling_AUV.h.

◆ last_probe_lost

int Uwpolling_AUV::last_probe_lost
protected

Definition at line 1165 of file uwpolling_AUV.h.

◆ last_reason

UWPOLLING_AUV_REASON Uwpolling_AUV::last_reason
protected

Current and previous reason for the change of the state.

Definition at line 1055 of file uwpolling_AUV.h.

◆ list_probbed_node

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

list of nodes that have sent correctly the PROBE

Definition at line 1014 of file uwpolling_AUV.h.

◆ lut_token_separator

char Uwpolling_AUV::lut_token_separator
protected

LUT token separator.

Definition at line 1160 of file uwpolling_AUV.h.

◆ 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

Definition at line 1139 of file uwpolling_AUV.h.

◆ max_payload

int Uwpolling_AUV::max_payload
protected

Duration of ACK_TIMER.

Dimension of the DATA payload

Definition at line 1032 of file uwpolling_AUV.h.

◆ max_polled_node

int Uwpolling_AUV::max_polled_node
protected

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

Definition at line 1039 of file uwpolling_AUV.h.

◆ max_tx_pkts

uint Uwpolling_AUV::max_tx_pkts
protected

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

Definition at line 1143 of file uwpolling_AUV.h.

◆ modem_data_bit_rate

int Uwpolling_AUV::modem_data_bit_rate
protected

Bit rate of the modem used.

Definition at line 1045 of file uwpolling_AUV.h.

◆ n_ack_rx

int Uwpolling_AUV::n_ack_rx
protected

Number of ack packets received.

Definition at line 1108 of file uwpolling_AUV.h.

◆ n_dropped_ack_pkts

int Uwpolling_AUV::n_dropped_ack_pkts
protected

Number of ACK dropped pkts.

Definition at line 1125 of file uwpolling_AUV.h.

◆ N_dropped_probe_pkts

int Uwpolling_AUV::N_dropped_probe_pkts
protected

Number of PROBE dropped because of CRC error.

Definition at line 1123 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1126 of file uwpolling_AUV.h.

◆ N_expected_pkt

int Uwpolling_AUV::N_expected_pkt
protected

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

Definition at line 1084 of file uwpolling_AUV.h.

◆ n_pkts_to_tx

uint Uwpolling_AUV::n_pkts_to_tx
protected

Number of packets to transmit during a TxData session.

Definition at line 1145 of file uwpolling_AUV.h.

◆ n_poll_tx

int Uwpolling_AUV::n_poll_tx
protected

Number of POLL packets sent.

Definition at line 1109 of file uwpolling_AUV.h.

◆ n_probe_rx

uint Uwpolling_AUV::n_probe_rx
protected

Number of PROBE packets received.

Definition at line 1107 of file uwpolling_AUV.h.

◆ n_run

int Uwpolling_AUV::n_run
protected

Definition at line 1050 of file uwpolling_AUV.h.

◆ n_trigger_tx

int Uwpolling_AUV::n_trigger_tx
protected

Number of TRIGGER packets sent.

Definition at line 1106 of file uwpolling_AUV.h.

◆ n_tx_pkts

uint Uwpolling_AUV::n_tx_pkts
protected

Number of packets transmitted by the AUV during a TxData session.

Definition at line 1147 of file uwpolling_AUV.h.

◆ out_file_stats

std::ofstream Uwpolling_AUV::out_file_stats
protected

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

Definition at line 1133 of file uwpolling_AUV.h.

◆ packet_index

int Uwpolling_AUV::packet_index
protected

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

Definition at line 1087 of file uwpolling_AUV.h.

◆ pkt_time

double Uwpolling_AUV::pkt_time
protected

Time needed to transmit a data packet.

Definition at line 1113 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1061 of file uwpolling_AUV.h.

◆ poll_timer

PollTimer Uwpolling_AUV::poll_timer
protected

POLL Timer.

Definition at line 1010 of file uwpolling_AUV.h.

◆ POLL_uid

uint Uwpolling_AUV::POLL_uid
protected

POLL Unique ID.

Definition at line 1121 of file uwpolling_AUV.h.

◆ polling_index

int Uwpolling_AUV::polling_index
protected

Index of the node that the AUV is polling.

Definition at line 1017 of file uwpolling_AUV.h.

◆ prev_state

UWPOLLING_AUV_STATUS Uwpolling_AUV::prev_state
protected

Current and previous state variable.

Definition at line 1054 of file uwpolling_AUV.h.

◆ print_stats_

int Uwpolling_AUV::print_stats_
protected

Print protocol's statistics of the protocol.

Definition at line 1044 of file uwpolling_AUV.h.

◆ probbed_sink

probbed_node Uwpolling_AUV::probbed_sink
protected

Element with sink probe data.

Definition at line 1016 of file uwpolling_AUV.h.

◆ probe_counters

probe_cicle_counters Uwpolling_AUV::probe_counters
protected

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

Definition at line 1162 of file uwpolling_AUV.h.

◆ probe_rtt

double Uwpolling_AUV::probe_rtt
protected

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

Definition at line 1100 of file uwpolling_AUV.h.

◆ probe_timer

ProbeTimer Uwpolling_AUV::probe_timer
protected

PROBE Timer.

Definition at line 1009 of file uwpolling_AUV.h.

◆ reason

UWPOLLING_AUV_REASON Uwpolling_AUV::reason
protected

Definition at line 1055 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1069 of file uwpolling_AUV.h.

◆ 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.

Definition at line 1156 of file uwpolling_AUV.h.

◆ RxDataEnabled

bool Uwpolling_AUV::RxDataEnabled
protected

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

Definition at line 1076 of file uwpolling_AUV.h.

◆ RxProbeEnabled

bool Uwpolling_AUV::RxProbeEnabled
protected

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

Definition at line 1079 of file uwpolling_AUV.h.

◆ sea_trial_

int Uwpolling_AUV::sea_trial_
protected

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

Definition at line 1042 of file uwpolling_AUV.h.

◆ sink_inserted

bool Uwpolling_AUV::sink_inserted
protected

Definition at line 1018 of file uwpolling_AUV.h.

◆ status_info

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

Definition at line 1065 of file uwpolling_AUV.h.

◆ stop_time

double Uwpolling_AUV::stop_time
protected

Time stamp in which the AUV finish to receive data packets.

Definition at line 1111 of file uwpolling_AUV.h.

◆ T_ack_timer

double Uwpolling_AUV::T_ack_timer
protected

Definition at line 1031 of file uwpolling_AUV.h.

◆ T_guard

double Uwpolling_AUV::T_guard
protected

Guard time added to the calculation of the RTT.

Definition at line 1037 of file uwpolling_AUV.h.

◆ T_max

double Uwpolling_AUV::T_max
protected

Maximum value in which the node can choose his backoff time.

Definition at line 1035 of file uwpolling_AUV.h.

◆ T_min

double Uwpolling_AUV::T_min
protected

Minimum value in which the node can choose his backoff time.

Definition at line 1033 of file uwpolling_AUV.h.

◆ T_probe

double Uwpolling_AUV::T_probe
protected

Duration of PROBE TIMER.

Definition at line 1028 of file uwpolling_AUV.h.

◆ T_probe_guard

double Uwpolling_AUV::T_probe_guard
protected

Guard time for PROBE packet: T_probe=T_max+T_probe_guard.

Definition at line 1029 of file uwpolling_AUV.h.

◆ Tdata

double Uwpolling_AUV::Tdata
protected

Time needed to transmit a DATA packet.

Definition at line 1116 of file uwpolling_AUV.h.

◆ temp_buffer

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

Definition at line 1137 of file uwpolling_AUV.h.

◆ total_time

double Uwpolling_AUV::total_time
protected

Total time in which the AUV has received data packets.

Definition at line 1114 of file uwpolling_AUV.h.

◆ Tpoll

double Uwpolling_AUV::Tpoll
protected

Time needed to transmit a POLL packet.

Definition at line 1119 of file uwpolling_AUV.h.

◆ Tprobe

double Uwpolling_AUV::Tprobe
protected

Time needed to transmit a PROBE packet.

Definition at line 1117 of file uwpolling_AUV.h.

◆ TRIGGER_uid

uint Uwpolling_AUV::TRIGGER_uid
protected

TRIGGER Unique ID.

Definition at line 1120 of file uwpolling_AUV.h.

◆ Ttrigger

double Uwpolling_AUV::Ttrigger
protected

Time needed to transmit a TRIGGER packet.

Definition at line 1118 of file uwpolling_AUV.h.

◆ tx_buffer

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

Queue of DATA in number of packets.

Definition at line 1136 of file uwpolling_AUV.h.

◆ TxEnabled

bool Uwpolling_AUV::TxEnabled
protected

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

Definition at line 1081 of file uwpolling_AUV.h.

◆ uid_tx_pkt

uint16_t Uwpolling_AUV::uid_tx_pkt
protected

Unique ID of the transmitted packets.

Definition at line 1140 of file uwpolling_AUV.h.

◆ wrong_node_data_sent

int Uwpolling_AUV::wrong_node_data_sent
protected

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

Definition at line 1102 of file uwpolling_AUV.h.


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