This is the base class of MMacUWSR protocol, which is a derived class of MMac.
More...
#include <uwsr.h>
|
| enum | UWSR_STATUS {
UWSR_STATE_IDLE = 1
, UWSR_STATE_BACKOFF
, UWSR_STATE_TX_DATA
, UWSR_STATE_TX_ACK
,
UWSR_STATE_WAIT_ACK
, UWSR_STATE_DATA_RX
, UWSR_STATE_ACK_RX
, UWSR_STATE_NOT_SET
,
UWSR_STATE_LISTEN
, UWSR_STATE_CHK_ACK_TIMEOUT
, UWSR_STATE_CHK_LISTEN_TIMEOUT
, UWSR_STATE_CHK_BACKOFF_TIMEOUT
,
UWSR_STATE_RX_IDLE
, UWSR_STATE_RX_LISTEN
, UWSR_STATE_RX_BACKOFF
, UWSR_STATE_RX_WAIT_ACK
,
UWSR_STATE_WRONG_PKT_RX
, UWSR_STATE_WAIT_TX
, UWSR_STATE_CHK_WAIT_TX_TIMEOUT
, UWSR_STATE_WAIT_ACK_WAIT_TX
,
UWSR_STATE_RX_DATA_TX_DATA
, UWSR_STATE_PRE_TX_DATA
, UWSR_STATE_RX_IN_PRE_TX_DATA
} |
| |
| enum | UWSR_REASON_STATUS {
UWSR_REASON_DATA_PENDING
, UWSR_REASON_DATA_RX
, UWSR_REASON_DATA_TX
, UWSR_REASON_ACK_TX
,
UWSR_REASON_ACK_RX
, UWSR_REASON_BACKOFF_TIMEOUT
, UWSR_REASON_ACK_TIMEOUT
, UWSR_REASON_DATA_EMPTY
,
UWSR_REASON_NOT_SET
, UWSR_REASON_MAX_TX_TRIES
, UWSR_REASON_BACKOFF_PENDING
, UWSR_REASON_LISTEN
,
UWSR_REASON_LISTEN_TIMEOUT
, UWSR_REASON_LISTEN_PENDING
, UWSR_REASON_START_RX
, UWSR_REASON_PKT_NOT_FOR_ME
,
UWSR_REASON_WAIT_ACK_PENDING
, UWSR_REASON_PKT_ERROR
, UWSR_REASON_WAIT_TX
, UWSR_REASON_WAIT_TX_PENDING
,
UWSR_REASON_WAIT_TX_TIMEOUT
} |
| |
| enum | UWSR_PKT_TYPE { UWSR_ACK_PKT = 1
, UWSR_DATA_PKT
, UWSR_DATAMAX_PKT
} |
| |
| enum | UWSR_TIMER_STATUS { UWSR_IDLE = 1
, UWSR_RUNNING
, UWSR_FROZEN
, UWSR_EXPIRED
} |
| |
| enum | CHECK_ACK_TIMER { CHECK_ACTIVE = 1
, CHECK_EXPIRED
, CHECK_IDLE
} |
| |
|
| 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 (UWSR_PKT_TYPE type) |
| |
| virtual void | initPkt (Packet *p, UWSR_PKT_TYPE pkt_type, int dest_addr=0) |
| |
| virtual double | getBackoffTime () |
| |
| void | setBackoffCount () |
| |
| int | getBackoffCount () |
| |
| virtual void | statePreTxData () |
| |
| virtual void | txAck (int dest_addr) |
| |
| virtual void | stateIdle () |
| |
| virtual void | stateRxIdle () |
| |
| virtual void | stateTxData () |
| |
| virtual void | stateTxAck (int dest_addr) |
| |
| virtual void | stateBackoff () |
| |
| virtual void | stateRxBackoff () |
| |
| virtual void | stateWaitAck () |
| |
| virtual void | stateRxinPreTxData () |
| |
| virtual void | stateRxWaitAck () |
| |
| virtual void | stateListen () |
| |
| virtual void | stateRxListen () |
| |
| virtual void | stateCheckListenExpired () |
| |
| virtual void | stateCheckAckExpired () |
| |
| virtual void | stateCheckBackoffExpired () |
| |
| virtual void | stateCheckWaitTxExpired () |
| |
| virtual void | stateRxData (Packet *p) |
| |
| virtual void | stateRxAck (Packet *p) |
| |
| virtual void | stateRxPacketNotForMe (Packet *p) |
| |
| virtual void | printStateInfo (double delay=0) |
| |
| virtual void | initInfo () |
| |
| virtual void | refreshState (UWSR_STATUS state) |
| |
| virtual void | refreshReason (UWSR_REASON_STATUS reason) |
| |
| virtual void | exitBackoff () |
| |
| virtual double | getRTT () |
| |
| virtual void | updateLastDataIdRx (int id) |
| |
| virtual void | waitForUser () |
| |
| virtual int | getRemainingPkts () |
| |
| virtual void | incrUpperDataRx () |
| |
| virtual int | getPktSeqNum (Packet *p) |
| |
| virtual int | getMacAddress (Packet *p) |
| |
| bool | chkItemInmapTxRounds (int mac_addr, int seq_num) |
| | handling transmission round
|
| |
| void | setCurrTxRounds (int mac_addr, int seq_num) |
| |
| void | incrCurrTxRounds (int mac_addr, int seq_num) |
| |
| int | getCurrTxRounds (int mac_addr, int seq_num) |
| |
| void | eraseItemFromTxRounds (int mac_addr, int seq_num) |
| |
| void | putPktInQueue (Packet *p) |
| | handling packets
|
| |
| void | eraseItemFromPktQueue (int mac_addr, int seq_num) |
| |
| void | putAckTimerInMap (int mac_addr, int seq_num) |
| | managing ack
|
| |
| void | eraseItemFrommapAckTimer (int mac_addr, int seq_num) |
| |
| void | putStartTxTimeInMap (int mac_addr, int seq_num, double start_tx_time) |
| |
| void | eraseItemFrommapCalcAck (int mac_addr, int seq_num) |
| |
| virtual int | checkAckTimer (CHECK_ACK_TIMER type) |
| |
| virtual void | eraseExpiredItemsFrommapAckandCalc () |
| |
| virtual bool | checkMultipleTx (int rcv_mac_addr) |
| |
| virtual int | getPktsCanSendIn1RTT (int mac_addr) |
| |
| virtual void | putRTTInMap (int mac_addr, double rtt) |
| |
| double | getRTTInMap (int mac_addr) |
| |
| void | incrPktsSentIn1RTT () |
| |
| void | rstPktsSentIn1RTT () |
| |
| int | getPktsSentIn1RTT () |
| |
| void | incrAcksRcvIn1RTT () |
| |
| void | rstAcksRcvIn1RTT () |
| |
| int | getAcksRcvIn1RTT () |
| |
| void | incrPktsLostCount () |
| |
| void | rstPktsLostCount () |
| |
| int | getPktsLostCount () |
| |
| virtual bool | prepBeforeTx (int mac_addr, int seq_num) |
| |
| virtual double | calcWaitTxTime (int mac_addr) |
| |
| void | updateTxStatus (macAddress mac_addr, int rcv_acks) |
| |
| virtual int | calWindowSize (macAddress mac_addr) |
| |
| void | calTotalPktsTx () |
| |
| double | getAvgPktsTxIn1RTT () |
| |
This is the base class of MMacUWSR protocol, which is a derived class of MMac.
◆ CHECK_ACK_TIMER
This enumeration class is employed to know the current acknowledgement timer status. First enumerator is given value 1.
| Enumerator |
|---|
| CHECK_ACTIVE | |
| CHECK_EXPIRED | |
| CHECK_IDLE | |
◆ UWSR_PKT_TYPE
Enumeration class of packet type. First enumerator is given value 1. Three kinds of packets are supported by MMacUWSR protocol.
| Enumerator |
|---|
| UWSR_ACK_PKT | |
| UWSR_DATA_PKT | |
| UWSR_DATAMAX_PKT | |
◆ UWSR_REASON_STATUS
Enumeration class which tells the nodes the reason why it is in this state. First enumerator is given value 1.
| Enumerator |
|---|
| UWSR_REASON_DATA_PENDING | |
| UWSR_REASON_DATA_RX | |
| UWSR_REASON_DATA_TX | |
| UWSR_REASON_ACK_TX | |
| UWSR_REASON_ACK_RX | |
| UWSR_REASON_BACKOFF_TIMEOUT | |
| UWSR_REASON_ACK_TIMEOUT | |
| UWSR_REASON_DATA_EMPTY | |
| UWSR_REASON_NOT_SET | |
| UWSR_REASON_MAX_TX_TRIES | |
| UWSR_REASON_BACKOFF_PENDING | |
| UWSR_REASON_LISTEN | |
| UWSR_REASON_LISTEN_TIMEOUT | |
| UWSR_REASON_LISTEN_PENDING | |
| UWSR_REASON_START_RX | |
| UWSR_REASON_PKT_NOT_FOR_ME | |
| UWSR_REASON_WAIT_ACK_PENDING | |
| UWSR_REASON_PKT_ERROR | |
| UWSR_REASON_WAIT_TX | |
| UWSR_REASON_WAIT_TX_PENDING | |
| UWSR_REASON_WAIT_TX_TIMEOUT | |
◆ UWSR_STATUS
Enumeration class of MMacUWSR status. First enumerator is given value 1.
| Enumerator |
|---|
| UWSR_STATE_IDLE | |
| UWSR_STATE_BACKOFF | |
| UWSR_STATE_TX_DATA | |
| UWSR_STATE_TX_ACK | |
| UWSR_STATE_WAIT_ACK | |
| UWSR_STATE_DATA_RX | |
| UWSR_STATE_ACK_RX | |
| UWSR_STATE_NOT_SET | |
| UWSR_STATE_LISTEN | |
| UWSR_STATE_CHK_ACK_TIMEOUT | |
| UWSR_STATE_CHK_LISTEN_TIMEOUT | |
| UWSR_STATE_CHK_BACKOFF_TIMEOUT | |
| UWSR_STATE_RX_IDLE | |
| UWSR_STATE_RX_LISTEN | |
| UWSR_STATE_RX_BACKOFF | |
| UWSR_STATE_RX_WAIT_ACK | |
| UWSR_STATE_WRONG_PKT_RX | |
| UWSR_STATE_WAIT_TX | |
| UWSR_STATE_CHK_WAIT_TX_TIMEOUT | |
| UWSR_STATE_WAIT_ACK_WAIT_TX | |
| UWSR_STATE_RX_DATA_TX_DATA | |
| UWSR_STATE_PRE_TX_DATA | |
| UWSR_STATE_RX_IN_PRE_TX_DATA | |
◆ UWSR_TIMER_STATUS
Enumeration class of MMacUWSR timer status. First enumerator is given value
- It is employed to know the current status of a timer.
| Enumerator |
|---|
| UWSR_IDLE | |
| UWSR_RUNNING | |
| UWSR_FROZEN | |
| UWSR_EXPIRED | |
◆ MMacUWSR()
◆ ~MMacUWSR()
◆ calcWaitTxTime()
| double MMacUWSR::calcWaitTxTime |
( |
int |
mac_addr | ) |
|
|
protectedvirtual |
Calcultes the time a node has to wait before transmitting another packet in a single RTT.
- Parameters
-
| mac | address of the receiving node. |
- Returns
- waiting time (double)
◆ calTotalPktsTx()
| void MMacUWSR::calTotalPktsTx |
( |
| ) |
|
|
inlineprotected |
◆ calWindowSize()
| int MMacUWSR::calWindowSize |
( |
macAddress |
mac_addr | ) |
|
|
protectedvirtual |
Number of packets a node can transmits to a receving node in a single RTT.
- Returns
- maximum number of packets a node can transmits to a receiving node (integer).
◆ checkAckTimer()
It checks whether any acknowledgement timer expire. Since, in UWSR, we are transmitting multiple packet in a single RTT, we have to check AckTimer container whether any acknowledgement timer expire or not.
- Parameters
-
| type | which is a CHECK_ACK_TIMER data type. |
- Returns
- number of acknowledgements expire in the container.
◆ checkMultipleTx()
| bool MMacUWSR::checkMultipleTx |
( |
int |
rcv_mac_addr | ) |
|
|
protectedvirtual |
This method checks whether the node is capable of sending multiple packets in a single RTT.
- Parameters
-
| mac | address of the receiving node. |
- Returns
- Returns TRUE if multiple packet transmission is possible, FALSE otherwise.
◆ chkItemInmapTxRounds()
| bool MMacUWSR::chkItemInmapTxRounds |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
handling transmission round
It checks whether the same packet is transmitted before.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
- Returns
- boolean data type. Returns TRUE when this packet was not transmitted before and FALSE when it was transmitted.
◆ command()
| int MMacUWSR::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 succesfully or not
◆ computeTxTime()
Compute the transmission time of a packet. It uses a cross-layer message to calculate the duration of that packet.
- Parameters
-
- Returns
- tranmission time of a packet which is a double data type.
◆ eraseExpiredItemsFrommapAckandCalc()
| void MMacUWSR::eraseExpiredItemsFrommapAckandCalc |
( |
| ) |
|
|
protectedvirtual |
Erases those items whose acknowledgement timer expire from AckTimer containter and also from start trasmit time contaioner.
◆ eraseItemFrommapAckTimer()
| void MMacUWSR::eraseItemFrommapAckTimer |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
If a node receives an ACK for its transmitted packet, it erases the related AckTimer object of that packet.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References mapAckTimer.
◆ eraseItemFrommapCalcAck()
| void MMacUWSR::eraseItemFrommapCalcAck |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
Erases the transmission start time of a packet when an ACK is received correctly.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References mapCalcAck.
◆ eraseItemFromPktQueue()
| void MMacUWSR::eraseItemFromPktQueue |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
Erase the packet which is delivered to the destination correctly or other reasons
References mapPacket.
◆ eraseItemFromTxRounds()
| void MMacUWSR::eraseItemFromTxRounds |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
Erase an Item form the container where transmission round of various transmit packet are stored.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References mapTxRounds.
◆ exitBackoff()
| void MMacUWSR::exitBackoff |
( |
| ) |
|
|
protectedvirtual |
It stops the backoff timer.
◆ getAcksRcvIn1RTT()
| int MMacUWSR::getAcksRcvIn1RTT |
( |
| ) |
|
|
inlineprotected |
Returns number of ACK packets receive by a node in single RTT.
- Returns
- number of ACK receive in single RTT.
References acks_rcv_1RTT.
◆ getAvgPktsTxIn1RTT()
| double MMacUWSR::getAvgPktsTxIn1RTT |
( |
| ) |
|
|
inlineprotected |
◆ getBackoffCount()
| int MMacUWSR::getBackoffCount |
( |
| ) |
|
|
inlineprotected |
It returns the number of time backoff counter is run in the whole communication period.
- Returns
- backoff_count which is an integer data type.
References backoff_count.
◆ getBackoffTime()
| double MMacUWSR::getBackoffTime |
( |
| ) |
|
|
protectedvirtual |
This function calculates the backoff duration and return the backoff time.It employs the exponential backoff algorithm.
- Returns
- backoff duration which is a double data type.
◆ getCurrTxRounds()
| int MMacUWSR::getCurrTxRounds |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
Returns the current transmission round of a Data packet.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
- Returns
- an integer data type.
References mapTxRounds.
◆ getMacAddress()
| virtual int MMacUWSR::getMacAddress |
( |
Packet * |
p | ) |
|
|
inlineprotectedvirtual |
This method returns the destination mac address of the node which transmits the packet.
- Parameters
-
- Returns
- it returns the mac address of the node
Referenced by putPktInQueue().
◆ getPktsCanSendIn1RTT()
| int MMacUWSR::getPktsCanSendIn1RTT |
( |
int |
mac_addr | ) |
|
|
protectedvirtual |
Number of packets a node can transmits to a receiving node in a single RTT.
- Parameters
-
| mac | address of the receiving node. |
- Returns
- number of packets can transmit in a single RTT (integer).
◆ getPktSeqNum()
| virtual int MMacUWSR::getPktSeqNum |
( |
Packet * |
p | ) |
|
|
inlineprotectedvirtual |
This method is used to get the sequence number from a packet.
- Parameters
-
- Returns
- it returns sequence number which is an integer data type.
Referenced by putPktInQueue().
◆ getPktsLostCount()
| int MMacUWSR::getPktsLostCount |
( |
| ) |
|
|
inlineprotected |
Returns number of packets lost in single RTT.
- Returns
- number of packets lost in single RTT (integer).
References pkts_lost_counter.
◆ getPktsSentIn1RTT()
| int MMacUWSR::getPktsSentIn1RTT |
( |
| ) |
|
|
inlineprotected |
Returns number of Data packets transmit in single RTT.
- Returns
- packets sent in single RTT (integer).
References pkts_sent_1RTT.
Referenced by calTotalPktsTx().
◆ getRemainingPkts()
| virtual int MMacUWSR::getRemainingPkts |
( |
| ) |
|
|
inlineprotectedvirtual |
Number of packets which MAC layer receives form upper layer(s) but were not transmitted.
- Returns
- an integer value.
References mapPacket.
◆ getRTT()
| virtual double MMacUWSR::getRTT |
( |
| ) |
|
|
inlineprotectedvirtual |
This method is used to get the average RTT over all the receives RTT.
- Returns
- average RTT time which is a double data type.
References rttsamples, and sumrtt.
◆ getRTTInMap()
| double MMacUWSR::getRTTInMap |
( |
int |
mac_addr | ) |
|
|
inlineprotected |
Returns the RTT between a sender-receiver pair.
- Parameters
-
| mac | address of the receiving node. |
- Returns
- RTT which is a double data type.
References mapRTT.
◆ incrAcksRcvIn1RTT()
| void MMacUWSR::incrAcksRcvIn1RTT |
( |
| ) |
|
|
inlineprotected |
Increments the number of ACK packets receive by a node in single RTT.
References acks_rcv_1RTT.
◆ incrCurrTxRounds()
| void MMacUWSR::incrCurrTxRounds |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
Increment the number of times a packet is transmitted.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References mapTxRounds.
◆ incrPktsLostCount()
| void MMacUWSR::incrPktsLostCount |
( |
| ) |
|
|
inlineprotected |
◆ incrPktsSentIn1RTT()
| void MMacUWSR::incrPktsSentIn1RTT |
( |
| ) |
|
|
inlineprotected |
Increments the number of Data packets sent in single RTT.
References pkts_sent_1RTT.
◆ incrUpperDataRx()
| virtual void MMacUWSR::incrUpperDataRx |
( |
| ) |
|
|
inlineprotectedvirtual |
Increment the number of Data packet receive for the upper layer.
◆ initInfo()
| void MMacUWSR::initInfo |
( |
| ) |
|
|
protectedvirtual |
This function is used to initialize the UWAloha protocol.
◆ initPkt()
| void MMacUWSR::initPkt |
( |
Packet * |
p, |
|
|
UWSR_PKT_TYPE |
pkt_type, |
|
|
int |
dest_addr = 0 |
|
) |
| |
|
protectedvirtual |
This method, initialize the packet. If the packet is received from the upper layer, it adds the header (if any). It also sets the fields of ACK packet.
- Parameters
-
| Packet | pointer P. The packet can be Data packet or ACK packet. |
| pkt_type | is an UWSR_PKT_TYPE. Packet can be either Data packet or ACK packet. |
| dest_addr | is a integer data type. It is initialized as 0. |
◆ Mac2PhyStartTx()
| void MMacUWSR::Mac2PhyStartTx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
It informs that a packet transmission started.
- Parameters
-
◆ Phy2MacEndRx()
| void MMacUWSR::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
PHY layer informs the MAC layer that the reception of the packet is over.
- Parameters
-
◆ Phy2MacEndTx()
| void MMacUWSR::Phy2MacEndTx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
It infroms that a packet transmission end.
- Parameters
-
◆ Phy2MacStartRx()
| void MMacUWSR::Phy2MacStartRx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
PHY layer informs the MAC layer that it is receiving a packet. @Param Packet pointer (constant)
◆ prepBeforeTx()
| bool MMacUWSR::prepBeforeTx |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
protectedvirtual |
It checks how many times a packet is transmitted. If it reaches the threshold of retransmission, the packet is deleted from the all containers.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
- Returns
- whether this packet can be transmitted or not. TRUE means its retransmission does not exit the threshold and FALSE otherwise.
◆ printStateInfo()
| void MMacUWSR::printStateInfo |
( |
double |
delay = 0 | ) |
|
|
protectedvirtual |
This methods print the state information of the nodes.
- Parameters
-
| delay | is a double data type. |
◆ putAckTimerInMap()
| void MMacUWSR::putAckTimerInMap |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
managing ack
Put AckTimer Object in the container. For every transmitted packet an AckTimer object is created.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References ack_timer, and mapAckTimer.
◆ putPktInQueue()
| void MMacUWSR::putPktInQueue |
( |
Packet * |
p | ) |
|
|
inlineprotected |
◆ putRTTInMap()
| void MMacUWSR::putRTTInMap |
( |
int |
mac_addr, |
|
|
double |
rtt |
|
) |
| |
|
protectedvirtual |
Put RTT of all the nodes which are whithin the transmission range of a node. Whever a node receives a packet from another node, it put the RTT information of that node in a container.
- Parameters
-
| mac | address of the node which transmits the packet |
| RTT | of the sender and receiver. |
◆ putStartTxTimeInMap()
| void MMacUWSR::putStartTxTimeInMap |
( |
int |
mac_addr, |
|
|
int |
seq_num, |
|
|
double |
start_tx_time |
|
) |
| |
|
inlineprotected |
It stores the initial transmission start time in a container.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References mapCalcAck, and start_tx_time.
◆ recvFromUpperLayers()
| void MMacUWSR::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
This function receives the packet from upper layer and save it in the queue.
- Parameters
-
◆ refreshReason()
To know the reason why a node in this current state.
- Parameters
-
| reason | is an UWSR_REASON_STATUS type. |
References last_reason.
◆ refreshState()
| virtual void MMacUWSR::refreshState |
( |
UWSR_STATUS |
state | ) |
|
|
inlineprotectedvirtual |
Refreshes the states of the node. The node save the information of three states, they are: previous to previous state, previous state and current state of the node.
- Parameters
-
| state | which is an UWSR_STATUS type. |
References curr_state, prev_prev_state, and prev_state.
◆ rstAcksRcvIn1RTT()
| void MMacUWSR::rstAcksRcvIn1RTT |
( |
| ) |
|
|
inlineprotected |
Resets the number of ACK packets receive by a node in single RTT.
References acks_rcv_1RTT.
◆ rstPktsLostCount()
| void MMacUWSR::rstPktsLostCount |
( |
| ) |
|
|
inlineprotected |
◆ rstPktsSentIn1RTT()
| void MMacUWSR::rstPktsSentIn1RTT |
( |
| ) |
|
|
inlineprotected |
Resets the number of Data packets sent in single RTT.
References pkts_sent_1RTT.
◆ setBackoffCount()
| void MMacUWSR::setBackoffCount |
( |
| ) |
|
|
inlineprotected |
It sets the number of times backoff cpounter is run.
References backoff_count.
◆ setCurrTxRounds()
| void MMacUWSR::setCurrTxRounds |
( |
int |
mac_addr, |
|
|
int |
seq_num |
|
) |
| |
|
inlineprotected |
It sets the current tranmission round of a packet.
- Parameters
-
| mac | address of the node |
| sequence | number of the packet. |
References curr_tx_rounds, and mapTxRounds.
◆ stateBackoff()
| void MMacUWSR::stateBackoff |
( |
| ) |
|
|
protectedvirtual |
If ACK packet is not received within the acknowledgement expire time.
◆ stateCheckAckExpired()
| void MMacUWSR::stateCheckAckExpired |
( |
| ) |
|
|
protectedvirtual |
It checks whether the ack timer is already expired while it was busy with other activities.
◆ stateCheckBackoffExpired()
| void MMacUWSR::stateCheckBackoffExpired |
( |
| ) |
|
|
protectedvirtual |
It checks whether the backoff timer is already expired while it was busy with other activities.
◆ stateCheckListenExpired()
| void MMacUWSR::stateCheckListenExpired |
( |
| ) |
|
|
protectedvirtual |
It checks whether the listen timer is already expired while it was busy with other activities.
◆ stateCheckWaitTxExpired()
| void MMacUWSR::stateCheckWaitTxExpired |
( |
| ) |
|
|
protectedvirtual |
It checks whether the wait transmit timer is already expired while it was busy with other activities.
◆ stateIdle()
| void MMacUWSR::stateIdle |
( |
| ) |
|
|
protectedvirtual |
Node is in Idle state. It only changes its state if it has packet(s) to transmit or it receives a packet.
◆ stateListen()
| void MMacUWSR::stateListen |
( |
| ) |
|
|
protectedvirtual |
A short time which is used to sense the channel condision.
◆ statePreTxData()
| void MMacUWSR::statePreTxData |
( |
| ) |
|
|
protectedvirtual |
This method finds out whether there is any packet to be transmitted to the destination.
◆ stateRxAck()
| void MMacUWSR::stateRxAck |
( |
Packet * |
p | ) |
|
|
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.
◆ stateRxBackoff()
| void MMacUWSR::stateRxBackoff |
( |
| ) |
|
|
protectedvirtual |
If a node starts 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.
◆ stateRxData()
| void MMacUWSR::stateRxData |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
It process the packet which is received. After receiving a packet it changes it states according to the previously stored status information.
- Parameters
-
| <i>Data</i> | packet pointer |
◆ stateRxIdle()
| void MMacUWSR::stateRxIdle |
( |
| ) |
|
|
protectedvirtual |
If a node starts receiving a packet in Idle state.
◆ stateRxinPreTxData()
| void MMacUWSR::stateRxinPreTxData |
( |
| ) |
|
|
protectedvirtual |
If a node starts receiving a packet when it was waiting for transmitting another packet in a singlet RTT.
◆ stateRxListen()
| void MMacUWSR::stateRxListen |
( |
| ) |
|
|
protectedvirtual |
If a node starts receiving a packet when it was listening the channel.
◆ stateRxPacketNotForMe()
| void MMacUWSR::stateRxPacketNotForMe |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
The receive packet is not intended for this node. The node returns back to its own state.
- Parameters
-
◆ stateRxWaitAck()
| void MMacUWSR::stateRxWaitAck |
( |
| ) |
|
|
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.
◆ stateTxAck()
| void MMacUWSR::stateTxAck |
( |
int |
dest_addr | ) |
|
|
protectedvirtual |
After receiving a Data packet the node sends an ACK packet.
◆ stateTxData()
| void MMacUWSR::stateTxData |
( |
| ) |
|
|
protectedvirtual |
If a node has packet to transmits. In such case, it moves from Idle state to data transmits state.
◆ stateWaitAck()
| void MMacUWSR::stateWaitAck |
( |
| ) |
|
|
protectedvirtual |
After transmitting a Data packet, a node waits for the ACK packet.
◆ txAck()
| void MMacUWSR::txAck |
( |
int |
dest_addr | ) |
|
|
protectedvirtual |
This methods transmits ACK packet from MAC layer to PHY layer.
- Parameters
-
| dest_addr | which is an integer data type. |
◆ updateLastDataIdRx()
| virtual void MMacUWSR::updateLastDataIdRx |
( |
int |
id | ) |
|
|
inlineprotectedvirtual |
It updates the sequence number of the last data packet rx.
- Parameters
-
| id | is an integer data type. |
References last_data_id_rx.
◆ updateTxStatus()
| void MMacUWSR::updateTxStatus |
( |
macAddress |
mac_addr, |
|
|
int |
rcv_acks |
|
) |
| |
|
inlineprotected |
How many acknowledgements receive for the transmitting packets in a single RTT. It stores this information to calculte the next window size (i.e. number of packets can be exchanged between a sender-receiver pair.
- Parameters
-
| mac | address of the receiving node. |
| number | of receive acknowledgement packets in a single RTT |
◆ waitForUser()
| void MMacUWSR::waitForUser |
( |
| ) |
|
|
protectedvirtual |
◆ ACK_size
◆ ACK_timeout
| double MMacUWSR::ACK_timeout |
|
protected |
ACK timeout for the initial packet
◆ ack_timer
◆ acks_rcv_1RTT
| int MMacUWSR::acks_rcv_1RTT |
|
protected |
◆ alpha_
This variable is used to tune the RTT
◆ backoff_count
| int MMacUWSR::backoff_count |
|
protected |
◆ backoff_timer
◆ backoff_tuner
| double MMacUWSR::backoff_tuner |
|
protected |
Tunes the backoff duration.
◆ buffer_pkts
| int MMacUWSR::buffer_pkts |
|
protected |
Number of packets a node can store in the container
◆ curr_data_pkt
| Packet* MMacUWSR::curr_data_pkt |
|
protected |
Pointer of the latest selected data packet.
◆ curr_state
Enum variable. It stores the current state of a node
Referenced by refreshState().
◆ curr_tx_rounds
| int MMacUWSR::curr_tx_rounds |
|
protected |
◆ fout
An object of ofstream class
◆ guard_time
| double MMacUWSR::guard_time |
|
protected |
A time which is used to componsate variating in timing
◆ has_buffer_queue
| bool MMacUWSR::has_buffer_queue |
|
protected |
Whether the node has buffer to store data or not
◆ HDR_size
◆ hit_count
◆ initialized
| bool MMacUWSR::initialized = false |
|
staticprotected |
It checks whether MMacUWSR protocol is initialized or not. If FALSE means, not initialized and if TRUE means it is initialized
◆ last_data_id_rx
| int MMacUWSR::last_data_id_rx |
|
protected |
◆ last_reason
Enum variable which stores the last reason why a node changes its state
Referenced by refreshReason().
◆ last_sent_data_id
| int MMacUWSR::last_sent_data_id |
|
protected |
sequence number of the latest sent packet
◆ latest_ack_timeout
| double MMacUWSR::latest_ack_timeout |
|
protected |
Latest timeout of an acknowledgement packet.
◆ listen_time
| double MMacUWSR::listen_time |
|
protected |
A short channel sensing time
◆ listen_timer
◆ mapAckTimer
◆ mapCalcAck
◆ mapPacket
| map<usrPair, Packet *> MMacUWSR::mapPacket |
|
protected |
◆ mapRTT
Container where RTT between various sender-receiver pairs are stored
Referenced by getRTTInMap().
◆ mapTxRounds
◆ mapTxStatus
Container which stores the number of packets transmitted in a single RTT to a receiving node and number of acknowledgement receive among them.
◆ max_backoff_counter
| double MMacUWSR::max_backoff_counter |
|
protected |
Maximum number of backoff it will consider while it increases the backoff exponentially
◆ max_payload
| int MMacUWSR::max_payload |
|
protected |
Maximum number of payload in a packet.
◆ max_tx_tries
| int MMacUWSR::max_tx_tries |
|
protected |
Maximum number of retransmissions attempt.
◆ node_speed
| double MMacUWSR::node_speed |
|
protected |
Speed of the mobile node [m/s]
◆ pkt_tx_count
| int MMacUWSR::pkt_tx_count |
|
protected |
Number of packets transmitted
◆ pkt_type_info
Container which stores all the packet type information of MMacUWSR
◆ pkts_lost_counter
| int MMacUWSR::pkts_lost_counter |
|
protected |
◆ pkts_sent_1RTT
| int MMacUWSR::pkts_sent_1RTT |
|
protected |
◆ prev_prev_state
Enum variable. It stores the previous to previous state of a node
Referenced by refreshState().
◆ prev_state
Enum variable. It stores the previous state of a node
Referenced by refreshState().
◆ print_transitions
| bool MMacUWSR::print_transitions |
|
protected |
Whether to print the state of the nodes
◆ prop_speed
| const double MMacUWSR::prop_speed = 1500.0 |
|
staticprotected |
Speed of the sound signal
◆ prv_mac_addr
| int MMacUWSR::prv_mac_addr |
|
protected |
◆ reason_info
Container which stores all the reason information
◆ recv_data_id
| int MMacUWSR::recv_data_id |
|
protected |
The sequence number of the packet which is received
◆ round_trip_time
| double MMacUWSR::round_trip_time |
|
protected |
◆ rttsamples
Number of RTT samples
Referenced by getRTT().
◆ srtt
Smoothed Round Trip Time, calculated as for TCP
◆ start_tx_time
| double MMacUWSR::start_tx_time |
|
protected |
◆ status_info
Container which stores all the status information
◆ sumrtt
Sum of RTT samples
Referenced by getRTT().
◆ sumrtt2
◆ sumwtt
Summation of total waiting time
◆ total_pkts_tx
| int MMacUWSR::total_pkts_tx |
|
protected |
◆ txsn
Sequence number of the transmitted packet.
◆ uwsr_debug
◆ var_k
It is employed to decrease the window size.
◆ wait_constant
| double MMacUWSR::wait_constant |
|
protected |
This fixed time is employed to componsate different time variations.
◆ wait_tx_time
| double MMacUWSR::wait_tx_time |
|
protected |
Waiting time before transmitting a packet in a single RTT.
◆ wait_tx_timer
◆ window_size
| int MMacUWSR::window_size |
|
protected |
Maximum number of packets a node can transmit in a single RTT.
◆ wttsamples
Number of waiting time samples
The documentation for this class was generated from the following files:
- DESERT_Framework/DESERT/data_link/uwsr/uwsr.h
- DESERT_Framework/DESERT/data_link/uwsr/uwsr.cpp