|
DESERT 4.0.0
|
#include <uwpolling_NODE.h>


Classes | |
| class | BackOffTimer |
| class | Rx_Poll_Timer |
| class | Tx_Data_Timer |
| class | Uwpolling_NODE_Timer |
Public Member Functions | |
| Uwpolling_NODE () | |
| virtual | ~Uwpolling_NODE () |
| virtual int | command (int argc, const char *const *argv) |
| virtual int | crLayCommand (ClMessage *m) |
Protected Member Functions | |
| virtual void | recvFromUpperLayers (Packet *p) |
| virtual void | Mac2PhyStartTx (Packet *p) |
| virtual void | Phy2MacEndTx (const Packet *p) |
| virtual void | Phy2MacStartRx (const Packet *p) |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual void | initPkt (UWPOLLING_PKT_TYPE pkt_type) |
| virtual void | initInfo () |
| virtual void | refreshReason (UWPOLLING_NODE_REASON reason) |
| virtual void | refreshState (UWPOLLING_NODE_STATUS state) |
| virtual void | incrProbeSent () |
| virtual void | incrTimesPolled () |
| void | incrTriggerReceived () |
| void | incrTriggerDropped () |
| void | incrPollDropped () |
| void | getDataQueueLog () |
| int | getProbeSent () |
| int | getTimesPolled () |
| int | getTriggerReceived () |
| int | getTriggerDropped () |
| int | getPollDropped () |
| virtual void | waitForUser () |
| virtual void | stateIdle () |
| virtual void | stateTxData () |
| virtual void | stateRxTrigger () |
| virtual void | stateTxProbe () |
| virtual void | stateRxPoll () |
| virtual void | BackOffTimerExpired () |
| virtual void | RxPollTimerExpired () |
| virtual double | getBackOffTime () |
| virtual void | TxData () |
| virtual void | TxPRobe () |
| virtual void | stateWaitPoll () |
| unsigned long int | getEpoch () |
Protected Attributes | |
| double | T_poll |
| double | T_poll_guard |
| double | backoff_tuner |
| int | max_payload |
| int | buffer_data_pkts |
| int | max_data_pkt_tx |
| uint | node_id |
| int | sea_trial |
| int | print_stats |
| int | n_run |
| double | Intra_data_Guard_Time |
| std::queue< Packet * > | Q_data |
| bool | polled |
| bool | RxPollEnabled |
| bool | Triggered |
| bool | LastPacket |
| double | MaxTimeStamp |
| double | T_in |
| double | T_fin |
| double | BOffTime |
| int | AUV_mac_addr |
| int | N_data_pkt_2_TX |
| int | packet_index |
| uint | n_probe_sent |
| int | n_times_polled |
| int | n_trigger_received |
| uint | N_polled_node |
| uint | PROBE_uid |
| Packet * | curr_data_pkt |
| Packet * | curr_probe_pkt |
| Packet * | curr_poll_pkt |
| Packet * | curr_trigger_pkt |
| UWPOLLING_NODE_REASON | last_reason |
| UWPOLLING_NODE_STATUS | curr_state |
| UWPOLLING_NODE_STATUS | prev_state |
| BackOffTimer | backoff_timer |
| Rx_Poll_Timer | rx_poll_timer |
| Tx_Data_Timer | tx_data_timer |
| std::ofstream | fout |
| std::ofstream | out_file_stats |
| int | n_trigger_dropped |
| int | n_poll_dropped |
| int | useAdaptiveTpoll |
Static Protected Attributes | |
| static bool | initialized = false |
| static map< Uwpolling_NODE::UWPOLLING_NODE_STATUS, string > | status_info |
| static map< Uwpolling_NODE::UWPOLLING_NODE_REASON, string > | reason_info |
| static map< Uwpolling_NODE::UWPOLLING_PKT_TYPE, string > | pkt_type_info |
Class used to represents the UWPOLLING MAC layer of a node.
|
protected |
|
protected |
|
protected |
|
protected |
| Uwpolling_NODE::Uwpolling_NODE | ( | ) |
Constructor of the Uwpolling_NODE class
References backoff_tuner, buffer_data_pkts, Intra_data_Guard_Time, max_data_pkt_tx, max_payload, n_run, node_id, print_stats, sea_trial, T_poll_guard, and useAdaptiveTpoll.
|
virtual |
Destructor of the Uwpolling_NODE class
|
protectedvirtual |
Method called by the Expire event of the timer. Here we call the stateTxProbe method
References refreshReason(), stateTxProbe(), and UWPOLLING_NODE_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 getDataQueueLog(), getPollDropped(), getProbeSent(), getTimesPolled(), getTriggerDropped(), getTriggerReceived(), initialized, initInfo(), and Q_data.

|
virtual |
Cross-Layer messages interpreter
| ClMessage* | an instance of ClMessage that represent the message received |
|
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, getEpoch(), T_fin, and T_in.
Referenced by stateRxTrigger().

|
inlineprotected |
References getEpoch(), and Q_data.
Referenced by command().

|
inlineprotected |
Calculate the epoch of the event. Used in sea-trial mode
Referenced by getBackOffTime(), getDataQueueLog(), initInfo(), initPkt(), Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateIdle(), stateRxPoll(), stateRxTrigger(), stateTxData(), stateTxProbe(), and stateWaitPoll().
|
inlineprotected |
Return the number of POLL dropped by the node because of erroneous CRC
References n_poll_dropped.
Referenced by command().
|
inlineprotected |
Returns the number of PROBE packets sent during the simulation
References n_probe_sent.
Referenced by command().
|
inlineprotected |
Return the number of times the node are polled by the AUV
References n_times_polled.
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().
|
inlineprotected |
Increments the number of POLL packets dropped because of erroneous CRC
References n_poll_dropped.
Referenced by Phy2MacEndRx().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Increments the number of times that the node has been polled by the AUV
References n_times_polled.
Referenced by stateRxPoll().
|
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_DATA_PKT, UWPOLLING_NODE_REASON_BACKOFF_TIMER_EXPIRED, UWPOLLING_NODE_REASON_EMPTY_DATA_QUEUE, UWPOLLING_NODE_REASON_LIST_NOT_POLLED, UWPOLLING_NODE_REASON_NOT_IN_LIST, UWPOLLING_NODE_REASON_NOT_SET, UWPOLLING_NODE_REASON_PKT_ERROR, UWPOLLING_NODE_REASON_RX_POLL, UWPOLLING_NODE_REASON_RX_POLL_TIMER_EXPIRED, UWPOLLING_NODE_REASON_RX_TRIGGER, UWPOLLING_NODE_REASON_TX_DATA, UWPOLLING_NODE_REASON_TX_PROBE, UWPOLLING_NODE_REASON_WRONG_RECEIVER, UWPOLLING_NODE_REASON_WRONG_STATE, UWPOLLING_NODE_REASON_WRONG_TYPE, UWPOLLING_NODE_STATUS_IDLE, UWPOLLING_NODE_STATUS_RX_POLL, UWPOLLING_NODE_STATUS_RX_TRIGGER, UWPOLLING_NODE_STATUS_TX_DATA, UWPOLLING_NODE_STATUS_TX_PROBE, UWPOLLING_NODE_STATUS_WAIT_POLL, UWPOLLING_POLL_PKT, UWPOLLING_PROBE_PKT, 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, BOffTime, curr_probe_pkt, getEpoch(), hdr_PROBE::id_node(), max_data_pkt_tx, MaxTimeStamp, N_data_pkt_2_TX, hdr_PROBE::n_pkts(), node_id, PT_PROBE, Q_data, hdr_PROBE::ts(), and UWPOLLING_PROBE_PKT.
Referenced by 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_poll_pkt, curr_trigger_pkt, getEpoch(), hdr_POLL::id_, incrPollDropped(), incrTriggerDropped(), out_file_stats, print_stats, PT_POLL, PT_TRIGGER, refreshReason(), rx_poll_timer, sea_trial, stateRxPoll(), stateRxTrigger(), UWPOLLING_NODE_REASON_PKT_ERROR, UWPOLLING_NODE_REASON_RX_POLL, and UWPOLLING_NODE_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 AUV_mac_addr, curr_state, getEpoch(), Intra_data_Guard_Time, LastPacket, max_payload, prev_state, refreshReason(), Uwpolling_NODE::Uwpolling_NODE_Timer::schedule(), stateIdle(), stateWaitPoll(), status_info, tx_data_timer, UWPOLLING_NODE_REASON_TX_DATA, UWPOLLING_NODE_REASON_TX_PROBE, UWPOLLING_NODE_STATUS_TX_DATA, and UWPOLLING_NODE_STATUS_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 |
|
protectedvirtual |
Receives the packet from the upper layer (e.g. IP)
| Packet* | pointer to the packet received |
References buffer_data_pkts, getEpoch(), out_file_stats, print_stats, Q_data, sea_trial, and hdr_uwcbr::sn_.

|
inlineprotectedvirtual |
Refresh the reason for the changing of the state
| UWPOLLING_NODE_REASON | The reason of the change of the state |
References last_reason.
Referenced by BackOffTimerExpired(), Phy2MacEndRx(), Phy2MacEndTx(), RxPollTimerExpired(), stateRxPoll(), and stateTxProbe().
|
inlineprotectedvirtual |
Refresh the state of the protocol
| UWPOLLING_AUV_STATUS | current state of the protcol |
References curr_state, and prev_state.
Referenced by stateIdle(), stateRxPoll(), stateRxTrigger(), stateTxData(), stateTxProbe(), and stateWaitPoll().
|
protectedvirtual |
Methods called by the Expire event of the timer. Here we disable the possibility of the node to receive POLL packets.
References refreshReason(), RxPollEnabled, stateIdle(), and UWPOLLING_NODE_REASON_RX_POLL_TIMER_EXPIRED.

|
protectedvirtual |
IDLE state. Each variable is resetted
References backoff_timer, getEpoch(), polled, refreshState(), rx_poll_timer, RxPollEnabled, Triggered, and UWPOLLING_NODE_STATUS_IDLE.
Referenced by Phy2MacEndTx(), RxPollTimerExpired(), and stateTxProbe().

|
protectedvirtual |
State of the protocol in which a POLL packet is received. Here the node check if he's polled or, at least, he is in the list of polled node. If he's the polled node, he goes into the stateTxData state. Otherwise he drops the packet
References curr_poll_pkt, getEpoch(), hdr_POLL::id_, incrTimesPolled(), node_id, out_file_stats, hdr_POLL::POLL_time(), hdr_POLL::POLL_uid_, polled, print_stats, refreshReason(), refreshState(), rx_poll_timer, RxPollEnabled, Uwpolling_NODE::Uwpolling_NODE_Timer::schedule(), sea_trial, stateTxData(), useAdaptiveTpoll, UWPOLLING_NODE_REASON_NOT_IN_LIST, UWPOLLING_NODE_REASON_RX_POLL, UWPOLLING_NODE_REASON_WRONG_STATE, and UWPOLLING_NODE_STATUS_RX_POLL.
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(), getEpoch(), incrTriggerReceived(), out_file_stats, print_stats, refreshState(), rx_poll_timer, RxPollEnabled, Uwpolling_NODE::Uwpolling_NODE_Timer::schedule(), sea_trial, hdr_TRIGGER::t_fin(), T_fin, hdr_TRIGGER::t_in(), T_in, T_poll, T_poll_guard, hdr_TRIGGER::TRIGGER_uid_, Triggered, and UWPOLLING_NODE_STATUS_RX_TRIGGER.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
State of the protocol in which a DATA packet is sent. Here we compute some statistics related to the transmission of the packet (i.e. the number of data packets transmitted is incremented and we check the number of data packet to transmit
References AUV_mac_addr, curr_data_pkt, curr_state, getEpoch(), LastPacket, N_data_pkt_2_TX, out_file_stats, packet_index, polled, print_stats, Q_data, refreshState(), sea_trial, hdr_uwcbr::sn_, TxData(), UWPOLLING_NODE_STATUS_RX_POLL, and UWPOLLING_NODE_STATUS_TX_DATA.
Referenced by stateRxPoll().

|
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(), hdr_PROBE::n_pkts(), hdr_PROBE::n_pkts_, out_file_stats, print_stats, PROBE_uid, hdr_PROBE::PROBE_uid_, refreshReason(), refreshState(), sea_trial, stateIdle(), Triggered, TxPRobe(), UWPOLLING_NODE_REASON_EMPTY_DATA_QUEUE, UWPOLLING_NODE_STATUS_TX_PROBE, and UWPOLLING_PROBE_PKT.
Referenced by BackOffTimerExpired().

|
protectedvirtual |
State in which the protocol set up the timer to wait the reception of the POLL packet
References Uwpolling_NODE::Uwpolling_NODE_Timer::getDuration(), getEpoch(), refreshState(), rx_poll_timer, RxPollEnabled, Uwpolling_NODE::Uwpolling_NODE_Timer::schedule(), T_poll, and UWPOLLING_NODE_STATUS_WAIT_POLL.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
The DATA Packet is sended down to the PHY layer
References curr_data_pkt, and Mac2PhyStartTx().
Referenced by stateTxData().

|
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 |
MAC address of the AUV
Referenced by initPkt(), Phy2MacEndTx(), stateRxTrigger(), and stateTxData().
|
protected |
Backoff timer
Referenced by stateIdle(), and stateRxTrigger().
|
protected |
Multiplying value to the backoff value
Referenced by getBackOffTime(), and Uwpolling_NODE().
|
protected |
Backoff time chosen
Referenced by initPkt(), and stateRxTrigger().
|
protected |
Length of buffer of DATA pkts in number of pkts
Referenced by recvFromUpperLayers(), and Uwpolling_NODE().
|
protected |
Pointer to the current DATA packet
Referenced by stateTxData(), and TxData().
|
protected |
Pointer ot the current POLL packet
Referenced by Phy2MacEndRx(), and stateRxPoll().
|
protected |
Pointer to the current PROBE packet
Referenced by initPkt(), stateTxProbe(), and TxPRobe().
|
protected |
Current state of the protocol
Referenced by Phy2MacEndTx(), refreshState(), and stateTxData().
|
protected |
Pointer to the current TRIGGER packet
Referenced by Phy2MacEndRx(), and stateRxTrigger().
|
protected |
Output stream for the textual file of debug
|
staticprotected |
true if the protocol is initialized, false otherwise
Referenced by command(), and initInfo().
|
protected |
Guard Time between one data packet and the following
Referenced by Phy2MacEndTx(), and Uwpolling_NODE().
|
protected |
Last reason to the change of state
Referenced by refreshReason().
|
protected |
true if the node has just sent the last packet of the queue and has to exit from the TxData state, false otherwise
Referenced by Phy2MacEndTx(), and stateTxData().
|
protected |
Max number of DATA packets to transmit each cycle
Referenced by initPkt(), and Uwpolling_NODE().
|
protected |
Payload of Application Layer in bytes
Referenced by Phy2MacEndTx(), and Uwpolling_NODE().
|
protected |
Timestamp of the most recent data packet generated
Referenced by initPkt().
|
protected |
Number of DATA packets to transmit to the AUV
Referenced by initPkt(), and stateTxData().
|
protected |
Number of POLL packet dropped
Referenced by getPollDropped(), and incrPollDropped().
|
protected |
Number of node polled in this POLL message
|
protected |
Number of PROBE packets sent to the AUV
Referenced by getProbeSent(), and incrProbeSent().
|
protected |
Referenced by initInfo(), and Uwpolling_NODE().
|
protected |
Number of times that the node has been polled by the AUV
Referenced by getTimesPolled(), and incrTimesPolled().
|
protected |
Number of TRIGGER packet dropped
Referenced by getTriggerDropped(), and incrTriggerDropped().
|
protected |
Number of TRIGGER packets received
Referenced by getTriggerReceived(), and incrTriggerReceived().
|
protected |
Unique Node ID
Referenced by initPkt(), stateRxPoll(), and Uwpolling_NODE().
|
protected |
Referenced by initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxPoll(), stateRxTrigger(), stateTxData(), and stateTxProbe().
|
protected |
Index of the packet just sent to the AUV
Referenced by stateTxData().
|
staticprotected |
Textual info of the type of the packet
Referenced by initInfo().
|
protected |
true if the node is polled, false otherwise
Referenced by stateIdle(), stateRxPoll(), and stateTxData().
|
protected |
Previous state of the protocol
Referenced by Phy2MacEndTx(), and refreshState().
|
protected |
Print protocol's statistics of the protocol
Referenced by initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxPoll(), stateRxTrigger(), stateTxData(), stateTxProbe(), and Uwpolling_NODE().
|
protected |
PROBE Unique ID
Referenced by stateTxProbe().
|
protected |
Queue of DATA in number of packets
Referenced by command(), getDataQueueLog(), initPkt(), recvFromUpperLayers(), and stateTxData().
|
staticprotected |
Textual info of the reason
Referenced by initInfo().
|
protected |
Receiving POLL Timer
Referenced by Phy2MacEndRx(), stateIdle(), stateRxPoll(), stateRxTrigger(), and stateWaitPoll().
|
protected |
true if the node is enabled to receive the POLL, false otherwise
Referenced by RxPollTimerExpired(), stateIdle(), stateRxPoll(), stateRxTrigger(), and stateWaitPoll().
|
protected |
Sea Trial flag: To activate if the protocol is going to be tested at the sea
Referenced by initInfo(), Phy2MacEndRx(), recvFromUpperLayers(), stateRxPoll(), stateRxTrigger(), stateTxData(), stateTxProbe(), and Uwpolling_NODE().
|
staticprotected |
Textual info of the state
Referenced by initInfo(), and Phy2MacEndTx().
|
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 |
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 |
Duration of RxPOLLTimer
Referenced by stateRxTrigger(), and stateWaitPoll().
|
protected |
Guard time for initial POLL timer
Referenced by stateRxTrigger(), and Uwpolling_NODE().
|
protected |
true if the node has correctly received a TRIGGER, false otherwise
Referenced by stateIdle(), stateRxTrigger(), and stateTxProbe().
|
protected |
Timer between two consequent DATA packet transmission
Referenced by Phy2MacEndTx().
|
protected |
True if an adaptive T_poll is used
Referenced by stateRxPoll(), and Uwpolling_NODE().