DESERT 3.5.1
|
#include <uwaloha.h>
Classes | |
class | AckTimer |
class | BackOffTimer |
class | UWAlohaTimer |
Public Member Functions | |
UWAloha () | |
virtual | ~UWAloha () |
virtual int | command (int argc, const char *const *argv) |
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 double | computeTxTime (UWALOHA_PKT_TYPE type) |
virtual void | initPkt (Packet *p, UWALOHA_PKT_TYPE pkt_type, int dest_addr=0) |
virtual double | getBackoffTime () |
virtual void | txData () |
virtual void | txAck (int dest_addr) |
virtual void | stateIdle () |
virtual void | stateRxIdle () |
virtual void | stateTxData () |
virtual void | stateTxAck (int dest_addr) |
virtual void | stateWaitAck () |
virtual void | stateRxWaitAck () |
virtual void | stateBackoff () |
virtual void | stateRxBackoff () |
virtual void | stateCheckAckExpired () |
virtual void | stateCheckBackoffExpired () |
virtual void | stateRxData (Packet *p) |
virtual void | stateRxAck (Packet *p) |
virtual void | exitBackoff () |
virtual void | printStateInfo (double delay=0) |
virtual void | initInfo () |
virtual void | refreshState (UWALOHA_STATUS state) |
virtual void | refreshReason (UWALOHA_REASON_STATUS reason) |
virtual void | incrCurrTxRounds () |
virtual void | resetCurrTxRounds () |
virtual void | updateRTT (double rtt) |
virtual double | getRTT () |
virtual void | updateAckTimeout (double rtt) |
virtual void | updateLastDataIdRx (int id) |
virtual void | waitForUser () |
int | getPktSeqNum (Packet *p) |
void | putPktInQueue (Packet *p) |
void | eraseItemFromPktQueue (int seq_num) |
void | putAckTimerInMap (int seq_num) |
void | eraseItemFrommapAckTimer (int seq_num) |
virtual int | getRemainingPkts () |
virtual void | incrUpperDataRx () |
int | getUpLayersDataPktsRx () |
Protected Attributes | |
int | max_tx_tries |
double | wait_constant |
double | backoff_tuner |
int | max_payload |
int | HDR_size |
int | ACK_size |
double | ACK_timeout |
int | buffer_pkts |
double | alpha_ |
int | max_backoff_counter |
int | uwaloha_debug |
int | last_sent_data_id |
bool | print_transitions |
bool | has_buffer_queue |
double | start_tx_time |
double | srtt |
double | sumrtt |
double | sumrtt2 |
int | rttsamples |
int | curr_tx_rounds |
int | last_data_id_rx |
int | recv_data_id |
Packet * | curr_data_pkt |
int | txsn |
AckTimer | ack_timer |
BackOffTimer | backoff_timer |
UWALOHA_REASON_STATUS | last_reason |
UWALOHA_STATUS | curr_state |
UWALOHA_STATUS | prev_state |
UWALOHA_STATUS | prev_prev_state |
UWALOHA_ACK_MODES | ack_mode |
map< pktSeqNum, Packet * > | mapPacket |
map< pktSeqNum, AckTimer > | mapAckTimer |
ofstream | fout |
Static Protected Attributes | |
static bool | initialized = false |
static const double | prop_speed = 1500.0 |
static map< UWALOHA_STATUS, string > | status_info |
static map< UWALOHA_REASON_STATUS, string > | reason_info |
static map< UWALOHA_PKT_TYPE, string > | pkt_type_info |
This is the base class of UWAloha protocol, which is a derived class of MMac.
|
protected |
Enumeration class of UWAloha acknowledgement mode.
First enumerator is given value 1. This protocol supports both acknowledgement and non-acknowledgement technique. If Acknowledgement is set, it uses Stop-And-Wait ARQ technique.
Enumerator | |
---|---|
UWALOHA_ACK_MODE | |
UWALOHA_NO_ACK_MODE |
|
protected |
|
protected |
Enumeration class which tells the nodes the reason why it is in this state.
First enumerator is given value 1.
|
protected |
Enumeration class of UWAloha status.
First enumerator is given value 1.
|
protected |
UWAloha::UWAloha | ( | ) |
Constructor of UWAloha Class.
Definition at line 119 of file uwaloha.cpp.
|
virtual |
Destructor of UWAloha Class.
Definition at line 162 of file uwaloha.cpp.
|
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) |
Definition at line 169 of file uwaloha.cpp.
|
protectedvirtual |
Compute the transmission time of a packet.
It uses a cross-layer message to calculate the duration of that packet.
type | is a UWALOHA_PKT_TYPE |
Definition at line 310 of file uwaloha.cpp.
|
inlineprotected |
|
inlineprotected |
|
protectedvirtual |
It stops the backoff timer.
Definition at line 280 of file uwaloha.cpp.
|
protectedvirtual |
This function calculates the backoff duration and return the backoff time.It employs the exponential backoff algorithm.
Definition at line 286 of file uwaloha.cpp.
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
protectedvirtual |
This function is used to initialize the UWAloha protocol.
Definition at line 208 of file uwaloha.cpp.
|
protectedvirtual |
This method, initialize the packet.
If the packet is received from the upper layer, it adds the header (if any). In case of UWAloha with ARQ technique, it set the fields of ACK packet.
Packet | pointer P. The packet can be Data packet or ACK packet. |
pkt_type | is an UWALOHA_PKT_TYPE. Packet can be either Data packet or ACK packet. |
dest_addr | is a integer data type. It is initialized as 0. |
Definition at line 369 of file uwaloha.cpp.
|
protectedvirtual |
It informs that a packet transmission started.
Packet | pointer |
Definition at line 393 of file uwaloha.cpp.
|
protectedvirtual |
PHY layer informs the MAC layer that the reception of the packet is over.
Packet | pointer. |
Definition at line 465 of file uwaloha.cpp.
|
protectedvirtual |
It infroms that a packet transmission end.
Packet | pointer |
Definition at line 403 of file uwaloha.cpp.
|
protectedvirtual |
PHY layer informs the MAC layer that it is receiving a packet.
@Param Packet pointer (constant)
Definition at line 457 of file uwaloha.cpp.
|
protectedvirtual |
This methods print the state information of the nodes.
delay | is a double data type. |
Definition at line 815 of file uwaloha.cpp.
|
inlineprotected |
|
inlineprotected |
|
protectedvirtual |
This function receives the packet from upper layer and save it in the queue.
Packet | pointer |
Definition at line 339 of file uwaloha.cpp.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
protectedvirtual |
If ACK packet is not received within the acknowledgement expire time.
Definition at line 634 of file uwaloha.cpp.
|
protectedvirtual |
It checks whether the ack timer is already expired while it was busy with other activities.
Definition at line 548 of file uwaloha.cpp.
|
protectedvirtual |
It checks whether the backoff timer is already expired while it was busy with other activities.
Definition at line 578 of file uwaloha.cpp.
|
protectedvirtual |
Node is in Idle state.
It only changes its state if it has packet(s) to transmit or it receives a packet.
Definition at line 605 of file uwaloha.cpp.
|
protectedvirtual |
The node comes to this state if it receives an ACK packet.
After receiving an ACK packet it changes it states according to the previously stored status information.
Definition at line 789 of file uwaloha.cpp.
|
protectedvirtual |
If a node start receiving a packet when it is in backoff state.
The node first freeze (or another word, hold) the backoff timer and start receiving the packet.
Definition at line 651 of file uwaloha.cpp.
|
protectedvirtual |
It process the packet which is received.
After receiving a packet it changes it states according to the previously stored status information.
<i>Data</i> | packet pointer |
Definition at line 764 of file uwaloha.cpp.
|
protectedvirtual |
If a node start receiving a packet in Idle state.
Definition at line 625 of file uwaloha.cpp.
|
protectedvirtual |
If a node receives any packet while it was waiting for ACK packet, it moves to this state.
The packet it is receiving can be a Data packet from another node or ACK packet.
Definition at line 741 of file uwaloha.cpp.
|
protectedvirtual |
If the protocl uses ARQ technique, in that case, after receiving a Data packet the node sends an ACK packet.
Definition at line 750 of file uwaloha.cpp.
|
protectedvirtual |
If a node has packet to transmits.
In such case, it moves from Idle state to data transmits state.
Definition at line 661 of file uwaloha.cpp.
|
protectedvirtual |
After transmitting a Data packet, a node waits for the ACK packet.
Definition at line 722 of file uwaloha.cpp.
|
protectedvirtual |
This methods transmits ACK packet from MAC layer to PHY layer.
dest_addr | which is an integer data type. |
Definition at line 538 of file uwaloha.cpp.
|
protectedvirtual |
This method transmits Data packets from MAC layer to PHY layer.
Definition at line 524 of file uwaloha.cpp.
|
protectedvirtual |
Like updateRTT() function.
Definition at line 265 of file uwaloha.cpp.
|
inlineprotectedvirtual |
|
protectedvirtual |
Update the Round Trip Time (RTT) which is necessary to compute the acknowledgement duration as well as backoff duration.
rtt | is a double data type. |
Definition at line 255 of file uwaloha.cpp.
|
protectedvirtual |
Definition at line 840 of file uwaloha.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |