|
DESERT 4.0.0
|
#include <uw-aloha-q-sync-node.h>


Public Member Functions | |
| UwAloha_Q_Sync_NODE () | |
| virtual | ~UwAloha_Q_Sync_NODE ()=default |
| virtual int | recvSyncClMsg (ClMessage *m) |
Protected Types | |
| enum | UWALOHAQ_STATUS { IDLE , TRANSMITTING , RECEIVING } |
| enum | SLOT_STATUS { TRANSMIT , RECEIVE } |
Protected Member Functions | |
| virtual void | stateRxAck (Packet *p, int addr) |
| virtual void | findMySlot () |
| virtual void | updateQ_table (int ack_received) |
| virtual void | handleTimerExpiration () |
| virtual void | txData () |
| virtual void | start (double delay) |
| virtual void | stop () |
| virtual void | recvFromUpperLayers (Packet *p) |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual void | Phy2MacStartRx (Packet *p) |
| virtual void | Mac2PhyStartTx (Packet *p) |
| virtual void | Phy2MacEndTx (const Packet *p) |
| virtual void | rxPacketNotForMe (Packet *p) |
| virtual void | initPkt (Packet *p) |
| virtual int | command (int argc, const char *const *argv) |
Protected Attributes | |
| UwAlohaQSyncTimer | alohaq_sync_timer |
| std::vector< std::vector< double > > | Q_table {} |
| double | start_time |
| UWALOHAQ_STATUS | transceiver_status |
| SLOT_STATUS | slot_status |
| std::ofstream | out_file_stats |
| int | HDR_size |
| int | packet_sent_curr_frame |
| int | max_queue_size |
| int | drop_old_ |
| bool | enable |
| int | checkPriority |
| int | debug_ |
| int | sea_trial_ |
| std::deque< Packet * > | buffer |
| int | curr_slot |
| int | curr_subslot |
| int | my_curr_slot |
| int | my_curr_subslot |
| double | t_prop_max |
| double | t_dp |
| double | t_guard |
| std::vector< int > | ack_data |
| double | slot_duration_factor |
| int | nn |
| int | subslot_num |
Friends | |
| class | UwAlohaQSyncTimer |
Class that represents a UwAlohaQSync Node
|
protected |
|
protected |
| UwAloha_Q_Sync_NODE::UwAloha_Q_Sync_NODE | ( | ) |
Constructor of the UwAloha_Q_Sync_NODE class
References checkPriority, debug_, drop_old_, HDR_size, max_queue_size, nn, sea_trial_, slot_duration_factor, subslot_num, t_dp, and t_prop_max.
|
virtualdefault |
Destructor of the UwAloha_Q_Sync_NODE class
|
protectedvirtual |
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 start(), start_time, and stop().
Referenced by recvSyncClMsg().

|
protectedvirtual |
Search Q-table and find slot for transmission in the following frame
References my_curr_slot, my_curr_subslot, nn, Q_table, and subslot_num.
Referenced by handleTimerExpiration().
|
protectedvirtual |
Triggered upon timer expiration event
References alohaq_sync_timer, curr_slot, curr_subslot, debug_, findMySlot(), IDLE, my_curr_slot, my_curr_subslot, nn, packet_sent_curr_frame, RECEIVE, slot_duration_factor, slot_status, subslot_num, t_dp, t_guard, t_prop_max, transceiver_status, TRANSMIT, and txData().

|
protectedvirtual |
Method called to add the MAC header size
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
References HDR_size.
Referenced by recvFromUpperLayers().
|
protectedvirtual |
Method called when the Mac Layer start to transmit a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
References debug_, IDLE, transceiver_status, and TRANSMITTING.
Referenced by txData().
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
References ack_data, debug_, IDLE, PT_ALOHAQ_SYNC_ACK, rxPacketNotForMe(), stateRxAck(), transceiver_status, and TRANSMITTING.

|
protectedvirtual |
Method called when the Mac Layer finish to transmit a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
References IDLE, and transceiver_status.
|
protectedvirtual |
Method called when the Phy Layer start to receive a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
References debug_, IDLE, RECEIVING, slot_status, transceiver_status, and TRANSMIT.
|
protectedvirtual |
Receive the packet from the upper layer (e.g. IP)
| Packet* | pointer to the packet received |
References buffer, initPkt(), and max_queue_size.

|
virtual |
Cross-Layer messages synchronous interpreter.
| ClMessage* | an instance of ClMessage that represent the message received |
References CLMSG_UWMMAC_ENABLE, command(), ClMsgUwMmac::SET_REPLY, ClMsgUwMmac::SET_REQ, start(), start_time, and stop().

|
protectedvirtual |
Method called when the Packet received is determined to be not for me
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
References debug_.
Referenced by Phy2MacEndRx().
|
protectedvirtual |
Schedule the beginning of each TDMA cycle, each one after delay
| delay | to await before starting the protocol |
References alohaq_sync_timer, enable, nn, Q_table, and subslot_num.
Referenced by command(), and recvSyncClMsg().
|
protectedvirtual |
Confirm ACK is received in desired time slot
| Packet* | pointer to the ACK packet received |
| addr | MAC adress of the receiving node |
References ack_data, debug_, IDLE, out_file_stats, transceiver_status, and updateQ_table().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
Cancel the timer
References alohaq_sync_timer, and enable.
Referenced by command(), and recvSyncClMsg().
|
protectedvirtual |
Transmit a data packet if in my slot
References buffer, debug_, IDLE, Mac2PhyStartTx(), packet_sent_curr_frame, and transceiver_status.
Referenced by handleTimerExpiration().

|
protectedvirtual |
Update Q-table based on reward value
| ack_received | reward value - 1 if ACK received, 0 if not |
References debug_, my_curr_slot, my_curr_subslot, nn, Q_table, and subslot_num.
Referenced by stateRxAck().
|
friend |
|
protected |
Sink's list to store successful transmittors
Referenced by Phy2MacEndRx(), and stateRxAck().
|
protected |
UwAlohaQSync timer handler
Referenced by handleTimerExpiration(), start(), and stop().
|
protected |
Buffer of the MAC node
Referenced by recvFromUpperLayers(), and txData().
|
protected |
flag to set to 1 if UWCBR module uses packets with priority, set to 0 otherwise. Priority can be used only with UWCBR module
Referenced by UwAloha_Q_Sync_NODE().
|
protected |
Current slot
Referenced by handleTimerExpiration().
|
protected |
Current subslot
Referenced by handleTimerExpiration().
|
protected |
Debug variable: 0 for no info, >1 for info
Referenced by handleTimerExpiration(), Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacStartRx(), rxPacketNotForMe(), stateRxAck(), txData(), updateQ_table(), and UwAloha_Q_Sync_NODE().
|
protected |
flag to set the drop packet policy in case of buffer overflow: if 0 (default) drops the new packet, if 1 the oldest
Referenced by UwAloha_Q_Sync_NODE().
|
protected |
Size of the HDR if any
Referenced by initPkt(), and UwAloha_Q_Sync_NODE().
|
protected |
Maximum dimension of Queue
Referenced by recvFromUpperLayers(), and UwAloha_Q_Sync_NODE().
|
protected |
Node's slot chosen for transmission
Referenced by findMySlot(), handleTimerExpiration(), and updateQ_table().
|
protected |
Node's subslot chosen for transmission
Referenced by findMySlot(), handleTimerExpiration(), and updateQ_table().
|
protected |
number of nodes
Referenced by findMySlot(), handleTimerExpiration(), start(), updateQ_table(), and UwAloha_Q_Sync_NODE().
|
protected |
File stream for the statistics log file
Referenced by stateRxAck().
|
protected |
counter of packet has been sent in the current frame
Referenced by handleTimerExpiration(), and txData().
|
protected |
2D Q-table
Referenced by findMySlot(), start(), and updateQ_table().
|
protected |
Written log variable
Referenced by UwAloha_Q_Sync_NODE().
|
protected |
slot_duration = packet_duration * slot_duration_factor
Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_NODE().
|
protected |
Variable that holds SLOT_STATUS
Referenced by handleTimerExpiration(), and Phy2MacStartRx().
|
protected |
Time to wait before starting the protocol
Referenced by command(), and recvSyncClMsg().
|
protected |
Number of subslots
Referenced by findMySlot(), handleTimerExpiration(), start(), updateQ_table(), and UwAloha_Q_Sync_NODE().
|
protected |
Transmission delay
Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_NODE().
|
protected |
Guard interval
Referenced by handleTimerExpiration().
|
protected |
Maximal propagation delay
Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_NODE().
|
protected |
Variable that holds UWALOHAQ_STATUS
Referenced by handleTimerExpiration(), Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), stateRxAck(), and txData().