#include <uwpolling_NODE.h>
|
enum | UWPOLLING_NODE_STATUS {
UWPOLLING_NODE_STATUS_IDLE = 1
, UWPOLLING_NODE_STATUS_RX_TRIGGER
, UWPOLLING_NODE_STATUS_TX_PROBE
, UWPOLLING_NODE_STATUS_RX_POLL
,
UWPOLLING_NODE_STATUS_TX_DATA
, UWPOLLING_NODE_STATUS_WAIT_POLL
} |
|
enum | UWPOLLING_PKT_TYPE { UWPOLLING_DATA_PKT = 1
, UWPOLLING_POLL_PKT
, UWPOLLING_TRIGGER_PKT
, UWPOLLING_PROBE_PKT
} |
|
enum | UWPOLLING_NODE_REASON {
UWPOLLING_NODE_REASON_TX_DATA
, UWPOLLING_NODE_REASON_RX_TRIGGER
, UWPOLLING_NODE_REASON_PKT_ERROR
, UWPOLLING_NODE_REASON_TX_PROBE
,
UWPOLLING_NODE_REASON_RX_POLL
, UWPOLLING_NODE_REASON_BACKOFF_TIMER_EXPIRED
, UWPOLLING_NODE_REASON_RX_POLL_TIMER_EXPIRED
, UWPOLLING_NODE_REASON_NOT_SET
,
UWPOLLING_NODE_REASON_EMPTY_DATA_QUEUE
, UWPOLLING_NODE_REASON_WRONG_TYPE
, UWPOLLING_NODE_REASON_WRONG_RECEIVER
, UWPOLLING_NODE_REASON_WRONG_STATE
,
UWPOLLING_NODE_REASON_NOT_IN_LIST
, UWPOLLING_NODE_REASON_LIST_NOT_POLLED
} |
|
enum | UWPOLLING_TIMER_STATUS { UWPOLLING_IDLE = 1
, UWPOLLING_RUNNING
, UWPOLLING_FROZEN
, UWPOLLING_EXPIRED
} |
|
Class used to represents the UWPOLLING MAC layer of a node.
Definition at line 74 of file uwpolling_NODE.h.
◆ UWPOLLING_NODE_REASON
Enumerator |
---|
UWPOLLING_NODE_REASON_TX_DATA | |
UWPOLLING_NODE_REASON_RX_TRIGGER | |
UWPOLLING_NODE_REASON_PKT_ERROR | |
UWPOLLING_NODE_REASON_TX_PROBE | |
UWPOLLING_NODE_REASON_RX_POLL | |
UWPOLLING_NODE_REASON_BACKOFF_TIMER_EXPIRED | |
UWPOLLING_NODE_REASON_RX_POLL_TIMER_EXPIRED | |
UWPOLLING_NODE_REASON_NOT_SET | |
UWPOLLING_NODE_REASON_EMPTY_DATA_QUEUE | |
UWPOLLING_NODE_REASON_WRONG_TYPE | |
UWPOLLING_NODE_REASON_WRONG_RECEIVER | |
UWPOLLING_NODE_REASON_WRONG_STATE | |
UWPOLLING_NODE_REASON_NOT_IN_LIST | |
UWPOLLING_NODE_REASON_LIST_NOT_POLLED | |
Definition at line 125 of file uwpolling_NODE.h.
◆ UWPOLLING_NODE_STATUS
< Variable that rapresents the status of the protocol machine state
Enumerator |
---|
UWPOLLING_NODE_STATUS_IDLE | |
UWPOLLING_NODE_STATUS_RX_TRIGGER | |
UWPOLLING_NODE_STATUS_TX_PROBE | |
UWPOLLING_NODE_STATUS_RX_POLL | |
UWPOLLING_NODE_STATUS_TX_DATA | |
UWPOLLING_NODE_STATUS_WAIT_POLL | |
Definition at line 107 of file uwpolling_NODE.h.
◆ UWPOLLING_PKT_TYPE
Enumerator |
---|
UWPOLLING_DATA_PKT | |
UWPOLLING_POLL_PKT | |
UWPOLLING_TRIGGER_PKT | |
UWPOLLING_PROBE_PKT | |
Definition at line 117 of file uwpolling_NODE.h.
◆ UWPOLLING_TIMER_STATUS
Enumerator |
---|
UWPOLLING_IDLE | |
UWPOLLING_RUNNING | |
UWPOLLING_FROZEN | |
UWPOLLING_EXPIRED | |
Definition at line 143 of file uwpolling_NODE.h.
◆ Uwpolling_NODE()
Uwpolling_NODE::Uwpolling_NODE |
( |
| ) |
|
◆ ~Uwpolling_NODE()
Uwpolling_NODE::~Uwpolling_NODE |
( |
| ) |
|
|
virtual |
◆ BackOffTimerExpired()
void Uwpolling_NODE::BackOffTimerExpired |
( |
| ) |
|
|
protectedvirtual |
Method called by the Expire event of the timer.
Here we call the stateTxProbe method
Definition at line 88 of file uwpolling_NODE.cpp.
◆ command()
int Uwpolling_NODE::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
TCL command interpreter.
It implements the following OTcl methods:
- Parameters
-
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). |
- Returns
- TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.
Definition at line 203 of file uwpolling_NODE.cpp.
◆ crLayCommand()
int Uwpolling_NODE::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 244 of file uwpolling_NODE.cpp.
◆ getBackOffTime()
double Uwpolling_NODE::getBackOffTime |
( |
| ) |
|
|
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.
Definition at line 629 of file uwpolling_NODE.cpp.
◆ getDataQueueLog()
void Uwpolling_NODE::getDataQueueLog |
( |
| ) |
|
|
inlineprotected |
◆ getEpoch()
unsigned long int Uwpolling_NODE::getEpoch |
( |
| ) |
|
|
inlineprotected |
Calculate the epoch of the event.
Used in sea-trial mode
- Returns
- the epoch of the system
Definition at line 675 of file uwpolling_NODE.h.
◆ getPollDropped()
int Uwpolling_NODE::getPollDropped |
( |
| ) |
|
|
inlineprotected |
Return the number of POLL dropped by the node because of erroneous CRC.
- Returns
- itn n_poll_dropped number of POLL dropped
Definition at line 594 of file uwpolling_NODE.h.
◆ getProbeSent()
int Uwpolling_NODE::getProbeSent |
( |
| ) |
|
|
inlineprotected |
Returns the number of PROBE packets sent during the simulation.
- Returns
- int n_probe_sent the number of PROBE packets sent
Definition at line 554 of file uwpolling_NODE.h.
◆ getTimesPolled()
int Uwpolling_NODE::getTimesPolled |
( |
| ) |
|
|
inlineprotected |
Return the number of times the node are polled by the AUV.
- Returns
- int n_times_polled number of times polled
Definition at line 564 of file uwpolling_NODE.h.
◆ getTriggerDropped()
int Uwpolling_NODE::getTriggerDropped |
( |
| ) |
|
|
inlineprotected |
Return the number of TRIGGER dropped by the node because of erroneous CRC.
- Returns
- int n_trigger_dropped number of TRIGGER dropped by the AUV
Definition at line 584 of file uwpolling_NODE.h.
◆ getTriggerReceived()
int Uwpolling_NODE::getTriggerReceived |
( |
| ) |
|
|
inlineprotected |
Return the number of TRIGGER packets received by the NODE.
- Returns
- int n_trigger_received number of TRIGGER packets received
Definition at line 574 of file uwpolling_NODE.h.
◆ incrPollDropped()
void Uwpolling_NODE::incrPollDropped |
( |
| ) |
|
|
inlineprotected |
Increments the number of POLL packets dropped because of erroneous CRC.
Definition at line 535 of file uwpolling_NODE.h.
◆ incrProbeSent()
virtual void Uwpolling_NODE::incrProbeSent |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ incrTimesPolled()
virtual void Uwpolling_NODE::incrTimesPolled |
( |
| ) |
|
|
inlineprotectedvirtual |
Increments the number of times that the node has been polled by the AUV.
Definition at line 508 of file uwpolling_NODE.h.
◆ incrTriggerDropped()
void Uwpolling_NODE::incrTriggerDropped |
( |
| ) |
|
|
inlineprotected |
Increments the number of TRIGGER packets dropped because of erroneous CRC.
Definition at line 526 of file uwpolling_NODE.h.
◆ incrTriggerReceived()
void Uwpolling_NODE::incrTriggerReceived |
( |
| ) |
|
|
inlineprotected |
Increments the number of TRIGGER packets received.
Definition at line 517 of file uwpolling_NODE.h.
◆ initInfo()
void Uwpolling_NODE::initInfo |
( |
| ) |
|
|
protectedvirtual |
Initializes the protocol at the beginning of the simulation.
This method is called by a command in tcl.
- Parameters
-
- See also
- command method
Definition at line 253 of file uwpolling_NODE.cpp.
◆ initPkt()
Inits the packet with the MAC address of the receiver and the sender, the size of the packet and the type.
- Parameters
-
UWPOLLING_PKT_TYPE | the type of the packet |
Definition at line 535 of file uwpolling_NODE.cpp.
◆ Mac2PhyStartTx()
void Uwpolling_NODE::Mac2PhyStartTx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Pass the packet to the PHY layer.
- Parameters
-
Packet* | Pointer to an object of type Packet that rapresent the Packet to transmit |
Definition at line 468 of file uwpolling_NODE.cpp.
◆ Phy2MacEndRx()
void Uwpolling_NODE::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
- Parameters
-
const | Packet* Pointer to an object of type Packet that rapresent the packet received |
Definition at line 640 of file uwpolling_NODE.cpp.
◆ Phy2MacEndTx()
void Uwpolling_NODE::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_NODE.cpp.
◆ Phy2MacStartRx()
virtual void Uwpolling_NODE::Phy2MacStartRx |
( |
const Packet * |
p | ) |
|
|
inlineprotectedvirtual |
Method called when the Phy Layer start to receive a Packet.
- Parameters
-
const | Packet* Pointer to an object of type Packet that rapresent the Packet that is in reception |
Definition at line 450 of file uwpolling_NODE.h.
◆ recvFromUpperLayers()
void Uwpolling_NODE::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Receives the packet from the upper layer (e.g.
IP)
- Parameters
-
Packet* | pointer to the packet received |
Definition at line 407 of file uwpolling_NODE.cpp.
◆ refreshReason()
Refresh the reason for the changing of the state.
- Parameters
-
UWPOLLING_NODE_REASON | The reason of the change of the state |
Definition at line 479 of file uwpolling_NODE.h.
◆ refreshState()
Refresh the state of the protocol.
- Parameters
-
UWPOLLING_AUV_STATUS | current state of the protcol |
Definition at line 489 of file uwpolling_NODE.h.
◆ RxPollTimerExpired()
void Uwpolling_NODE::RxPollTimerExpired |
( |
| ) |
|
|
protectedvirtual |
Methods called by the Expire event of the timer.
Here we disable the possibility of the node to receive POLL packets.
Definition at line 115 of file uwpolling_NODE.cpp.
◆ stateIdle()
void Uwpolling_NODE::stateIdle |
( |
| ) |
|
|
protectedvirtual |
◆ stateRxPoll()
void Uwpolling_NODE::stateRxPoll |
( |
| ) |
|
|
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
Definition at line 367 of file uwpolling_NODE.cpp.
◆ stateRxTrigger()
void Uwpolling_NODE::stateRxTrigger |
( |
| ) |
|
|
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
Definition at line 593 of file uwpolling_NODE.cpp.
◆ stateTxData()
void Uwpolling_NODE::stateTxData |
( |
| ) |
|
|
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
Definition at line 435 of file uwpolling_NODE.cpp.
◆ stateTxProbe()
void Uwpolling_NODE::stateTxProbe |
( |
| ) |
|
|
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
Definition at line 309 of file uwpolling_NODE.cpp.
◆ stateWaitPoll()
void Uwpolling_NODE::stateWaitPoll |
( |
| ) |
|
|
protectedvirtual |
State in which the protocol set up the timer to wait the reception of the POLL packet.
Definition at line 351 of file uwpolling_NODE.cpp.
◆ TxData()
void Uwpolling_NODE::TxData |
( |
| ) |
|
|
protectedvirtual |
◆ TxPRobe()
void Uwpolling_NODE::TxPRobe |
( |
| ) |
|
|
protectedvirtual |
◆ waitForUser()
void Uwpolling_NODE::waitForUser |
( |
| ) |
|
|
protectedvirtual |
Used for debug purposes.
(Permit to have a "step by step" behaviour of the protocol)
Definition at line 710 of file uwpolling_NODE.cpp.
◆ AUV_mac_addr
int Uwpolling_NODE::AUV_mac_addr |
|
protected |
◆ backoff_timer
◆ backoff_tuner
double Uwpolling_NODE::backoff_tuner |
|
protected |
◆ BOffTime
double Uwpolling_NODE::BOffTime |
|
protected |
◆ buffer_data_pkts
int Uwpolling_NODE::buffer_data_pkts |
|
protected |
Length of buffer of DATA pkts in number of pkts.
Definition at line 690 of file uwpolling_NODE.h.
◆ curr_data_pkt
Packet* Uwpolling_NODE::curr_data_pkt |
|
protected |
◆ curr_poll_pkt
Packet* Uwpolling_NODE::curr_poll_pkt |
|
protected |
◆ curr_probe_pkt
Packet* Uwpolling_NODE::curr_probe_pkt |
|
protected |
◆ curr_state
◆ curr_trigger_pkt
Packet* Uwpolling_NODE::curr_trigger_pkt |
|
protected |
◆ fout
std::ofstream Uwpolling_NODE::fout |
|
protected |
◆ initialized
bool Uwpolling_NODE::initialized = false |
|
staticprotected |
true if the protocol is initialized, false otherwise
Definition at line 705 of file uwpolling_NODE.h.
◆ Intra_data_Guard_Time
double Uwpolling_NODE::Intra_data_Guard_Time |
|
protected |
Guard Time between one data packet and the following.
Definition at line 700 of file uwpolling_NODE.h.
◆ last_reason
◆ LastPacket
bool Uwpolling_NODE::LastPacket |
|
protected |
true if the node has just sent the last packet of the queue and has to exit from the TxData state, false otherwise
Definition at line 716 of file uwpolling_NODE.h.
◆ max_data_pkt_tx
int Uwpolling_NODE::max_data_pkt_tx |
|
protected |
Max number of DATA packets to transmit each cycle.
Definition at line 693 of file uwpolling_NODE.h.
◆ max_payload
int Uwpolling_NODE::max_payload |
|
protected |
◆ MaxTimeStamp
double Uwpolling_NODE::MaxTimeStamp |
|
protected |
Timestamp of the most recent data packet generated.
Definition at line 721 of file uwpolling_NODE.h.
◆ N_data_pkt_2_TX
int Uwpolling_NODE::N_data_pkt_2_TX |
|
protected |
Number of DATA packets to transmit to the AUV.
Definition at line 729 of file uwpolling_NODE.h.
◆ n_poll_dropped
int Uwpolling_NODE::n_poll_dropped |
|
protected |
◆ N_polled_node
uint Uwpolling_NODE::N_polled_node |
|
protected |
◆ n_probe_sent
uint Uwpolling_NODE::n_probe_sent |
|
protected |
◆ n_run
int Uwpolling_NODE::n_run |
|
protected |
◆ n_times_polled
int Uwpolling_NODE::n_times_polled |
|
protected |
Number of times that the node has been polled by the AUV.
Definition at line 732 of file uwpolling_NODE.h.
◆ n_trigger_dropped
int Uwpolling_NODE::n_trigger_dropped |
|
protected |
◆ n_trigger_received
int Uwpolling_NODE::n_trigger_received |
|
protected |
◆ node_id
uint Uwpolling_NODE::node_id |
|
protected |
◆ out_file_stats
std::ofstream Uwpolling_NODE::out_file_stats |
|
protected |
◆ packet_index
int Uwpolling_NODE::packet_index |
|
protected |
◆ pkt_type_info
◆ polled
bool Uwpolling_NODE::polled |
|
protected |
◆ prev_state
◆ print_stats
int Uwpolling_NODE::print_stats |
|
protected |
◆ PROBE_uid
uint Uwpolling_NODE::PROBE_uid |
|
protected |
◆ Q_data
std::queue<Packet *> Uwpolling_NODE::Q_data |
|
protected |
◆ reason_info
◆ rx_poll_timer
◆ RxPollEnabled
bool Uwpolling_NODE::RxPollEnabled |
|
protected |
true if the node is enabled to receive the POLL, false otherwise
Definition at line 711 of file uwpolling_NODE.h.
◆ sea_trial
int Uwpolling_NODE::sea_trial |
|
protected |
Sea Trial flag: To activate if the protocol is going to be tested at the sea.
Definition at line 696 of file uwpolling_NODE.h.
◆ status_info
◆ T_fin
double Uwpolling_NODE::T_fin |
|
protected |
Upper bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Definition at line 725 of file uwpolling_NODE.h.
◆ T_in
double Uwpolling_NODE::T_in |
|
protected |
Lower bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Definition at line 723 of file uwpolling_NODE.h.
◆ T_poll
double Uwpolling_NODE::T_poll |
|
protected |
◆ T_poll_guard
double Uwpolling_NODE::T_poll_guard |
|
protected |
◆ Triggered
bool Uwpolling_NODE::Triggered |
|
protected |
true if the node has correctly received a TRIGGER, false otherwise
Definition at line 713 of file uwpolling_NODE.h.
◆ tx_data_timer
◆ useAdaptiveTpoll
int Uwpolling_NODE::useAdaptiveTpoll |
|
protected |
The documentation for this class was generated from the following files: