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


Public Member Functions | |
| UwAloha_Q_NODE () | |
| virtual | ~UwAloha_Q_NODE ()=default |
| virtual int | recvSyncClMsg (ClMessage *m) |
Protected Types | |
| enum | UWALOHAQ_PKT_TYPE { UWALOHAQ_ACK_PKT , UWALOHAQ_DATA_PKT } |
| enum | UWALOHAQ_STATUS { IDLE , TRANSMITTING , RECEIVING , WAIT_ACK } |
| enum | UWALOHAQ_ACK_STATUS { ACK_RECEIVED , ACK_NOT_RECEIVED } |
| enum | UWALOHAQ_BACKOFF_STATUS { ADD_BACKOFF , HALT } |
| enum | UWALOHAQ_BACKOFF_MODE { B1 , B2 } |
Protected Member Functions | |
| virtual int | decide_if_backoff (int slot) |
| virtual void | stateRxAck (Packet *p) |
| virtual int | getLayerIdFromTag (const std::string &tag) |
| virtual int | 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) override |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual void | Phy2MacStartRx (const 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 | |
| UwAlohaQTimer | alohaq_timer |
| int | slot_status |
| double | slot_duration |
| std::vector< double > | Q_table {} |
| double | start_time |
| UWALOHAQ_STATUS | transceiver_status |
| UWALOHAQ_ACK_STATUS | ack_status |
| UWALOHAQ_BACKOFF_STATUS | backoff_status |
| UWALOHAQ_BACKOFF_MODE | backoff_mode |
| double | guard_time |
| int | tot_slots |
| int | HDR_size |
| int | max_packet_per_slot |
| int | packet_sent_curr_slot_ |
| int | packet_sent_curr_frame |
| int | max_queue_size |
| bool | enable |
| int | debug_ |
| int | sea_trial_ |
| std::deque< Packet * > | buffer |
| int | curr_slot |
| int | my_curr_slot |
| int | data_phy_id |
| int | decide_backoff |
| std::string | phy_data_tag |
Friends | |
| class | UwAlohaQTimer |
Class that represents a UwAloha_Q Node
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| UwAloha_Q_NODE::UwAloha_Q_NODE | ( | ) |
Constructor of the UW_Aloha_Q_NODE class
References backoff_mode, debug_, guard_time, HDR_size, max_packet_per_slot, max_queue_size, sea_trial_, slot_duration, start_time, and tot_slots.
|
virtualdefault |
Destructor of the UW_Aloha_Q_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 phy_data_tag, start(), start_time, and stop().
Referenced by recvSyncClMsg().

|
protectedvirtual |
Decide if backoff should be applied in the following slot
References Q_table.
Referenced by handleTimerExpiration().
|
protectedvirtual |
Search Q-table and find optimal slot for transmission
References Q_table, and tot_slots.
Referenced by handleTimerExpiration().
|
protectedvirtual |
Check channel packet is sent through
Referenced by txData().
|
protectedvirtual |
References ACK_NOT_RECEIVED, ack_status, ADD_BACKOFF, alohaq_timer, B1, B2, backoff_mode, backoff_status, curr_slot, debug_, decide_backoff, decide_if_backoff(), findMySlot(), HALT, IDLE, my_curr_slot, packet_sent_curr_frame, packet_sent_curr_slot_, slot_duration, slot_status, tot_slots, transceiver_status, txData(), and updateQ_table().

|
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 Phy Layer finish to receive a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
References debug_, IDLE, PT_MMAC_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 debug_, packet_sent_curr_slot_, transceiver_status, and WAIT_ACK.
|
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_, RECEIVING, transceiver_status, and WAIT_ACK.
|
overrideprotectedvirtual |
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 cycle, each one after delay
| delay | to await before starting the protocol |
References alohaq_timer, debug_, enable, Q_table, slot_duration, slot_status, and tot_slots.
Referenced by command(), and recvSyncClMsg().
|
protectedvirtual |
Acknowledge ACK is received in the right slot
References ACK_RECEIVED, ack_status, debug_, IDLE, slot_status, transceiver_status, and updateQ_table().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
|
protectedvirtual |
Transmit a data packet if in my slot
References buffer, data_phy_id, debug_, getLayerIdFromTag(), IDLE, max_packet_per_slot, packet_sent_curr_frame, packet_sent_curr_slot_, phy_data_tag, slot_status, transceiver_status, and TRANSMITTING.
Referenced by handleTimerExpiration().

|
protectedvirtual |
Update Q-table
References curr_slot, debug_, Q_table, and tot_slots.
Referenced by handleTimerExpiration(), and stateRxAck().
|
friend |
|
protected |
Variable holding ack status
Referenced by handleTimerExpiration(), and stateRxAck().
|
protected |
TDMA timer handler
Referenced by handleTimerExpiration(), start(), and stop().
|
protected |
Variable holding backoff mode
Referenced by handleTimerExpiration(), and UwAloha_Q_NODE().
|
protected |
Variable holding backoff status
Referenced by handleTimerExpiration().
|
protected |
Buffer of the MAC node
Referenced by recvFromUpperLayers(), and txData().
|
protected |
Current slot
Referenced by handleTimerExpiration(), and updateQ_table().
|
protected |
Data channel identifier
Referenced by txData().
|
protected |
Debug variable: 0 for no info, 1 for displaying debug info
Referenced by handleTimerExpiration(), Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), rxPacketNotForMe(), start(), stateRxAck(), txData(), updateQ_table(), and UwAloha_Q_NODE().
|
protected |
Dercide about triggering backoff
Referenced by handleTimerExpiration().
|
protected |
Guard time between slots
Referenced by UwAloha_Q_NODE().
|
protected |
Size of the HDR if any
Referenced by initPkt(), and UwAloha_Q_NODE().
|
protected |
max numer of packet it can transmit per slot
Referenced by txData(), and UwAloha_Q_NODE().
|
protected |
Maximum dimension of Queue
Referenced by recvFromUpperLayers(), and UwAloha_Q_NODE().
|
protected |
Node's current slot in the ongoing frame
Referenced by handleTimerExpiration().
|
protected |
counter of packet has been sent in the current frame
Referenced by handleTimerExpiration(), and txData().
|
protected |
counter of packet has been sent in the current slot
Referenced by handleTimerExpiration(), Phy2MacEndTx(), and txData().
|
protected |
Slot duration
Referenced by decide_if_backoff(), findMySlot(), start(), and updateQ_table().
|
protected |
Written log variable
Referenced by UwAloha_Q_NODE().
|
protected |
Referenced by handleTimerExpiration(), start(), and UwAloha_Q_NODE().
|
protected |
Is it my turn to transmit data?
Referenced by handleTimerExpiration(), start(), stateRxAck(), and txData().
|
protected |
Time to wait before starting the protocol
Referenced by command(), recvSyncClMsg(), and UwAloha_Q_NODE().
|
protected |
Number of slots in the frame
Referenced by findMySlot(), handleTimerExpiration(), start(), updateQ_table(), and UwAloha_Q_NODE().
|
protected |
Variable holding transceiver status
Referenced by handleTimerExpiration(), Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), stateRxAck(), and txData().