|
DESERT 4.0.0
|
#include <uwpolling_SINK.h>


Classes | |
| class | BackOffTimer |
| class | Rx_Data_Timer |
| class | Uwpolling_SINK_Timer |
Public Member Functions | |
| Uwpolling_SINK () | |
| virtual | ~Uwpolling_SINK () |
| virtual int | command (int argc, const char *const *argv) |
| virtual int | crLayCommand (ClMessage *m) |
Protected Member Functions | |
| virtual void | Mac2PhyStartTx (Packet *p) |
| virtual void | Phy2MacEndTx (const Packet *p) |
| virtual void | Phy2MacStartRx (const Packet *p) |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual void | initPkt (UWPOLLING_PKT_TYPE pkt_type) |
| virtual void | initInfo () |
| virtual void | refreshReason (UWPOLLING_SINK_REASON reason) |
| virtual void | refreshState (UWPOLLING_SINK_STATUS state) |
| virtual void | incrProbeSent () |
| virtual void | incrAckSent () |
| void | incrTriggerReceived () |
| void | incrTriggerDropped () |
| int | getProbeSent () |
| int | getAckSent () |
| int | getTriggerReceived () |
| int | getTriggerDropped () |
| uint | getDuplicatedPkt () |
| void | incrDuplicatedPkt () |
| virtual void | waitForUser () |
| virtual void | stateIdle () |
| virtual void | stateRxTrigger () |
| virtual void | stateTxProbe () |
| virtual void | BackOffTimerExpired () |
| virtual void | RxDataTimerExpired () |
| virtual double | getBackOffTime () |
| virtual void | txAck () |
| virtual void | TxProbe () |
| virtual void | stateWaitData () |
| virtual void | stateRxData () |
| virtual void | addMissPkt2List (uint16_t n_pkts) |
| virtual void | stateTxAck () |
| unsigned long int | getEpoch () |
Protected Attributes | |
| double | T_data |
| double | T_data_gurad |
| double | backoff_tuner |
| uint | sink_id |
| bool | RxDataEnabled |
| bool | Triggered |
| bool | triggerEnabled |
| double | T_in |
| double | T_fin |
| double | BOffTime |
| int | AUV_mac_addr |
| int | n_probe_sent |
| int | n_trigger_received |
| int | n_trigger_dropped |
| int | n_ack_sent |
| uint | n_curr_rx_pkts |
| uint16_t | expected_id |
| uint16_t | last_rx |
| bool | send_ACK |
| std::list< uint16_t > | missing_id_list |
| uint16_t | expected_last_id |
| uint16_t | prev_expect_last_id |
| uint | duplicate_pkts |
| bool | first_rx_pkt |
| uint | PROBE_uid |
| Packet * | curr_data_pkt |
| Packet * | curr_probe_pkt |
| Packet * | curr_trigger_pkt |
| Packet * | curr_ack_pkt |
| UWPOLLING_SINK_REASON | last_reason |
| UWPOLLING_SINK_STATUS | curr_state |
| UWPOLLING_SINK_STATUS | prev_state |
| BackOffTimer | backoff_timer |
| Rx_Data_Timer | rx_data_timer |
| std::ofstream | fout |
| std::ofstream | out_file_stats |
| int | sea_trial |
| int | print_stats |
| int | n_run |
| int | useAdaptiveTdata |
| int | ack_enabled |
| uint | max_n_ack |
| double | T_guard |
| int | max_payload |
| int | modem_data_bit_rate |
Static Protected Attributes | |
| static bool | initialized = false |
| static map< Uwpolling_SINK::UWPOLLING_SINK_STATUS, string > | status_info |
| static map< Uwpolling_SINK::UWPOLLING_SINK_REASON, string > | reason_info |
| static map< Uwpolling_SINK::UWPOLLING_PKT_TYPE, string > | pkt_type_info |
Class used to represents the UWPOLLING MAC layer of a node.
|
protected |
|
protected |
|
protected |
|
protected |
| Uwpolling_SINK::Uwpolling_SINK | ( | ) |
Constructor of the Uwpolling_SINK class
References ack_enabled, backoff_tuner, max_n_ack, max_payload, modem_data_bit_rate, n_run, print_stats, sea_trial, sink_id, T_data_gurad, T_guard, and useAdaptiveTdata.
|
virtual |
Destructor of the Uwpolling_SINK class
|
protectedvirtual |
Add packet uids in the missing packet list
| number | of missing packets to insert inthe list |
References last_rx, and missing_id_list.
Referenced by RxDataTimerExpired(), and stateRxData().
|
protectedvirtual |
Method called by the Expire event of the timer. Here we call the stateTxProbe method
References refreshReason(), stateTxProbe(), Triggered, and UWPOLLING_SINK_REASON_BACKOFF_TIMER_EXPIRED.

|
virtual |
TCL command interpreter. It implements the following OTcl methods:
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
References getAckSent(), getDuplicatedPkt(), getProbeSent(), getTriggerDropped(), getTriggerReceived(), initialized, and initInfo().

|
virtual |
Cross-Layer messages interpreter
| ClMessage* | an instance of ClMessage that represent the message received |
|
inlineprotected |
Returns the number of ACK packets sent during the simulation
References n_ack_sent.
Referenced by command().
|
protectedvirtual |
The backoff timer is calculated choosing randomly using a Uniform random variable and multiplying it by a backoff_tuner chosen by the user via tcl
References backoff_tuner, T_fin, and T_in.
Referenced by stateRxTrigger().
|
inlineprotected |
References duplicate_pkts.
Referenced by command().
|
inlineprotected |
Calculate the epoch of the event. Used in sea-trial mode
Referenced by initInfo(), Phy2MacEndRx(), stateRxData(), and stateTxProbe().
|
inlineprotected |
Returns the number of PROBE packets sent during the simulation
References n_probe_sent.
Referenced by command().
|
inlineprotected |
Return the number of TRIGGER dropped by the node because of erroneous CRC
References n_trigger_dropped.
Referenced by command().
|
inlineprotected |
Return the number of TRIGGER packets received by the NODE
References n_trigger_received.
Referenced by command().
|
inlineprotectedvirtual |
|
inlineprotected |
References duplicate_pkts.
Referenced by stateRxData().
|
inlineprotectedvirtual |
|
inlineprotected |
Increments the number of TRIGGER packets dropped because of erroneous CRC
References n_trigger_dropped.
Referenced by Phy2MacEndRx().
|
inlineprotected |
Increments the number of TRIGGER packets received
References n_trigger_received.
Referenced by stateRxTrigger().
|
protectedvirtual |
Initializes the protocol at the beginning of the simulation. This method is called by a command in tcl.
| double | delay |
References getEpoch(), initialized, n_run, out_file_stats, pkt_type_info, print_stats, reason_info, sea_trial, status_info, UWPOLLING_ACK_PKT, UWPOLLING_DATA_PKT, UWPOLLING_POLL_PKT, UWPOLLING_PROBE_PKT, UWPOLLING_SINK_REASON_BACKOFF_TIMER_EXPIRED, UWPOLLING_SINK_REASON_MAX_DATA_RECEIVED, UWPOLLING_SINK_REASON_NOT_SET, UWPOLLING_SINK_REASON_PKT_ERROR, UWPOLLING_SINK_REASON_RX_DATA, UWPOLLING_SINK_REASON_RX_DATA_TIMER_EXPIRED, UWPOLLING_SINK_REASON_RX_TRIGGER, UWPOLLING_SINK_REASON_TX_ACK, UWPOLLING_SINK_REASON_TX_PROBE, UWPOLLING_SINK_REASON_WRONG_RECEIVER, UWPOLLING_SINK_REASON_WRONG_STATE, UWPOLLING_SINK_REASON_WRONG_TYPE, UWPOLLING_SINK_STATUS_IDLE, UWPOLLING_SINK_STATUS_RX_DATA, UWPOLLING_SINK_STATUS_RX_TRIGGER, UWPOLLING_SINK_STATUS_TX_ACK, UWPOLLING_SINK_STATUS_TX_PROBE, UWPOLLING_SINK_STATUS_WAIT_DATA, and UWPOLLING_TRIGGER_PKT.
Referenced by command().

|
protectedvirtual |
Inits the packet with the MAC address of the receiver and the sender, the size of the packet and the type
| UWPOLLING_PKT_TYPE | the type of the packet |
References AUV_mac_addr, curr_ack_pkt, curr_probe_pkt, hdr_PROBE_SINK::id_ack(), hdr_ACK_SINK::id_ack(), hdr_PROBE_SINK::id_sink(), last_rx, max_n_ack, missing_id_list, hdr_PROBE_SINK::PROBE_uid(), PROBE_uid, PT_ACK_SINK, PT_PROBE_SINK, sink_id, UWPOLLING_ACK_PKT, and UWPOLLING_PROBE_PKT.
Referenced by stateTxAck(), and stateTxProbe().

|
protectedvirtual |
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet
| const | Packet* Pointer to an object of type Packet that rapresent the packet received |
References curr_data_pkt, curr_trigger_pkt, getEpoch(), incrTriggerDropped(), out_file_stats, hdr_POLL::POLL_time(), print_stats, PT_ACK_SINK, PT_POLL, PT_PROBE, PT_TRIGGER, refreshReason(), rx_data_timer, RxDataEnabled, Uwpolling_SINK::Uwpolling_SINK_Timer::schedule(), sea_trial, stateRxData(), stateRxTrigger(), useAdaptiveTdata, UWPOLLING_SINK_REASON_PKT_ERROR, UWPOLLING_SINK_REASON_RX_DATA, and UWPOLLING_SINK_REASON_RX_TRIGGER.

|
protectedvirtual |
Method called when the PHY layer finish to transmit the packet.
| Packet* | Pointer to an object of type Packet that rapresent the Packet transmitted |
References PT_ACK_SINK, PT_PROBE_SINK, refreshReason(), stateIdle(), stateWaitData(), UWPOLLING_SINK_REASON_TX_ACK, and UWPOLLING_SINK_REASON_TX_PROBE.

|
inlineprotectedvirtual |
Method called when the Phy Layer start to receive a Packet
| const | Packet* Pointer to an object of type Packet that rapresent the Packet that is in reception |
|
inlineprotectedvirtual |
Refresh the reason for the changing of the state
| UWPOLLING_SINK_REASON | The reason of the change of the state |
References last_reason.
Referenced by BackOffTimerExpired(), Phy2MacEndRx(), Phy2MacEndTx(), RxDataTimerExpired(), and stateRxData().
|
inlineprotectedvirtual |
Refresh the state of the protocol
| UWPOLLING_AUV_STATUS | current state of the protcol |
References curr_state, and prev_state.
Referenced by stateIdle(), stateRxData(), stateRxTrigger(), stateTxAck(), stateTxProbe(), and stateWaitData().
|
protectedvirtual |
Methods called by the Expire event of the timer. Here we disable the possibility of the node to receive DATA packets.
References ack_enabled, addMissPkt2List(), expected_last_id, first_rx_pkt, last_rx, n_curr_rx_pkts, refreshReason(), RxDataEnabled, send_ACK, stateIdle(), stateTxAck(), and UWPOLLING_SINK_REASON_RX_DATA_TIMER_EXPIRED.

|
protectedvirtual |
IDLE state. Each variable is resetted
References backoff_timer, first_rx_pkt, n_curr_rx_pkts, refreshState(), rx_data_timer, RxDataEnabled, send_ACK, Triggered, triggerEnabled, and UWPOLLING_SINK_STATUS_IDLE.
Referenced by Phy2MacEndTx(), RxDataTimerExpired(), and stateRxData().

|
protectedvirtual |
State in which the DATA packet is received
References ack_enabled, addMissPkt2List(), curr_data_pkt, expected_last_id, first_rx_pkt, getEpoch(), incrDuplicatedPkt(), hdr_AUV_MULE::last_pkt_uid(), last_rx, max_payload, missing_id_list, modem_data_bit_rate, n_curr_rx_pkts, out_file_stats, hdr_AUV_MULE::pkt_uid(), prev_expect_last_id, print_stats, refreshReason(), refreshState(), rx_data_timer, RxDataEnabled, Uwpolling_SINK::Uwpolling_SINK_Timer::schedule(), sea_trial, send_ACK, hdr_uwcbr::sn_, stateIdle(), stateTxAck(), T_guard, triggerEnabled, UWPOLLING_SINK_REASON_MAX_DATA_RECEIVED, and UWPOLLING_SINK_STATUS_RX_DATA.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
State of the protocol in which a TRIGGER packet is received. Here we check the header of the TRIGGER and we store the information into it (i.e. the range of values into which choose randomly the backoff time
References AUV_mac_addr, backoff_timer, BOffTime, curr_trigger_pkt, getBackOffTime(), incrTriggerReceived(), refreshState(), rx_data_timer, RxDataEnabled, Uwpolling_SINK::Uwpolling_SINK_Timer::schedule(), send_ACK, T_data, T_data_gurad, hdr_TRIGGER::t_fin(), T_fin, hdr_TRIGGER::t_in(), T_in, Triggered, triggerEnabled, and UWPOLLING_SINK_STATUS_RX_TRIGGER.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
State in which the ACK is sent
References initPkt(), refreshState(), send_ACK, txAck(), UWPOLLING_ACK_PKT, and UWPOLLING_SINK_STATUS_TX_ACK.
Referenced by RxDataTimerExpired(), and stateRxData().

|
protectedvirtual |
State of the protocol in which a PROBE packet is sent. Here we store into the PROBE header all the information needed, such as the timestamp of the most recent data packet, the number of the packets that the node wish to transmit
References curr_probe_pkt, getEpoch(), initPkt(), out_file_stats, print_stats, hdr_PROBE_SINK::PROBE_uid(), refreshState(), sea_trial, Triggered, TxProbe(), UWPOLLING_PROBE_PKT, and UWPOLLING_SINK_STATUS_TX_PROBE.
Referenced by BackOffTimerExpired().

|
protectedvirtual |
State in which the protocol set up the timer to wait the reception of the DATA packet
References n_curr_rx_pkts, refreshState(), rx_data_timer, RxDataEnabled, Uwpolling_SINK::Uwpolling_SINK_Timer::schedule(), T_data, and UWPOLLING_SINK_STATUS_WAIT_DATA.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
The ACK Packet is sent down to the PHY layer
References curr_ack_pkt, incrAckSent(), Mac2PhyStartTx(), and send_ACK.
Referenced by stateTxAck().

|
protectedvirtual |
The PROBE Packet is sended down to the PHY layer
References curr_probe_pkt, incrProbeSent(), and Mac2PhyStartTx().
Referenced by stateTxProbe().

|
protectedvirtual |
Used for debug purposes. (Permit to have a "step by step" behaviour of the protocol)
|
protected |
True if ack is enabled, false if disabled, default true
Referenced by RxDataTimerExpired(), stateRxData(), and Uwpolling_SINK().
|
protected |
MAC address of the AUV from which it receives data
Referenced by initPkt(), and stateRxTrigger().
|
protected |
Backoff timer
Referenced by stateIdle(), and stateRxTrigger().
|
protected |
Multiplying value to the backoff value
Referenced by getBackOffTime(), and Uwpolling_SINK().
|
protected |
Backoff time chosen
Referenced by stateRxTrigger().
|
protected |
|
protected |
Pointer to the current DATA packet
Referenced by Phy2MacEndRx(), and stateRxData().
|
protected |
Pointer to the current PROBE packet
Referenced by initPkt(), stateTxProbe(), and TxProbe().
|
protected |
Current state of the protocol
Referenced by refreshState().
|
protected |
Pointer to the current TRIGGER packet
Referenced by Phy2MacEndRx(), and stateRxTrigger().
|
protected |
Referenced by getDuplicatedPkt(), and incrDuplicatedPkt().
|
protected |
Expected ID of the next data packet received
|
protected |
Referenced by RxDataTimerExpired(), and stateRxData().
|
protected |
Number ot duplicated packets received.
Referenced by RxDataTimerExpired(), stateIdle(), and stateRxData().
|
protected |
Output stream for the textual file of debug
|
staticprotected |
true if the protocol is initialized, false otherwise
Referenced by command(), and initInfo().
|
protected |
Last reason to the change of state
Referenced by refreshReason().
|
protected |
ID of the last received packet
Referenced by addMissPkt2List(), initPkt(), RxDataTimerExpired(), and stateRxData().
|
protected |
Max number of ACK that can be sent in a single round. The same value has to be used in packer, if needed.
Referenced by initPkt(), and Uwpolling_SINK().
|
protected |
Dimension of the DATA payload
Referenced by stateRxData(), and Uwpolling_SINK().
|
protected |
List with missing packet ID
Referenced by addMissPkt2List(), initPkt(), and stateRxData().
|
protected |
Bit rate of the modem used
Referenced by stateRxData(), and Uwpolling_SINK().
|
protected |
Referenced by getAckSent(), and incrAckSent().
|
protected |
Number of current received packets after the probe transmission.
Referenced by RxDataTimerExpired(), stateIdle(), stateRxData(), and stateWaitData().
|
protected |
Number of PROBE packets sent to the AUV
Referenced by getProbeSent(), and incrProbeSent().
|
protected |
Referenced by initInfo(), and Uwpolling_SINK().
|
protected |
Number of TRIGGER packet dropped
Referenced by getTriggerDropped(), and incrTriggerDropped().
|
protected |
Number of TRIGGER packets received
Referenced by getTriggerReceived(), and incrTriggerReceived().
|
protected |
Referenced by initInfo(), Phy2MacEndRx(), stateRxData(), and stateTxProbe().
|
staticprotected |
Textual info of the type of the packet
Referenced by initInfo().
|
protected |
Expected Unique ID of the last packet in the round
Referenced by stateRxData().
|
protected |
Previous state of the protocol
Referenced by refreshState().
|
protected |
Print protocol's statistics of the protocol
Referenced by initInfo(), Phy2MacEndRx(), stateRxData(), stateTxProbe(), and Uwpolling_SINK().
|
protected |
True if the packet received is the first packet in the round PROBE Unique ID
Referenced by initPkt().
|
staticprotected |
Textual info of the reason
Referenced by initInfo().
|
protected |
Receiving DATA Timer
Referenced by Phy2MacEndRx(), stateIdle(), stateRxData(), stateRxTrigger(), and stateWaitData().
|
protected |
true if the node is enabled to receive the DATA, false otherwise
Referenced by Phy2MacEndRx(), RxDataTimerExpired(), stateIdle(), stateRxData(), stateRxTrigger(), and stateWaitData().
|
protected |
Sea Trial flag: To activate if the protocol is going to be tested at the sea
Referenced by initInfo(), Phy2MacEndRx(), stateRxData(), stateTxProbe(), and Uwpolling_SINK().
|
protected |
True if an ACK has to be sent, false otherwise
Referenced by RxDataTimerExpired(), stateIdle(), stateRxData(), stateRxTrigger(), stateTxAck(), and txAck().
|
protected |
Unique Node ID
Referenced by initPkt(), and Uwpolling_SINK().
|
staticprotected |
Textual info of the state
Referenced by initInfo().
|
protected |
Duration of RxDataTimer
Referenced by stateRxTrigger(), and stateWaitData().
|
protected |
Guard time for RxDataTimer
Referenced by stateRxTrigger(), and Uwpolling_SINK().
|
protected |
Upper bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Referenced by getBackOffTime(), and stateRxTrigger().
|
protected |
Guard time added to the calculation of the data TO
Referenced by stateRxData(), and Uwpolling_SINK().
|
protected |
True if rx trigger is enabled. Lower bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Referenced by getBackOffTime(), and stateRxTrigger().
|
protected |
true if the node has correctly received a TRIGGER, false otherwise
Referenced by BackOffTimerExpired(), stateIdle(), stateRxTrigger(), and stateTxProbe().
|
protected |
Referenced by stateIdle(), stateRxData(), and stateRxTrigger().
|
protected |
True if an adaptive T_poll is used
Referenced by Phy2MacEndRx(), and Uwpolling_SINK().