|
DESERT 4.0.0
|
This is the base class of UWSmartOFDM protocol, which is a derived class of MMac. More...
#include <uw-smart-ofdm.h>


Classes | |
| class | AckTimer |
| class | AssignmentTimer |
| class | AssignmentValidTimer |
| class | BackOffTimer |
| class | CTSTimer |
| class | DATATimer |
| class | RTSTimer |
| class | UWSmartOFDMTimer |
Public Member Functions | |
| UWSmartOFDM () | |
| virtual | ~UWSmartOFDM () |
| virtual int | command (int argc, const char *const *argv) |
| void | init_macofdm_node (int subCarNum, double carSize, int ctrl_subCar, std::string modulation) |
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 (UWSMARTOFDM_PKT_TYPE type) |
| virtual void | initPkt (Packet *p, UWSMARTOFDM_PKT_TYPE pkt_type, int dest_addr=0) |
| virtual double | getBackoffTime () |
| virtual void | txData () |
| virtual void | txAck (int dest_addr) |
| virtual void | txRTS () |
| virtual void | txCTS (int dest_addr, int *rcv_car, int bytesToSend) |
| virtual void | stateIdle () |
| virtual void | stateSendRTS () |
| virtual void | stateSendCTS (Packet *p) |
| virtual void | stateWaitCTS () |
| virtual void | stateBackoffCTS () |
| virtual void | stateRxIdle () |
| virtual void | stateTxData () |
| virtual void | stateTxAck (int dest_addr) |
| virtual void | stateWaitAck () |
| virtual void | stateRxWaitAck () |
| virtual void | stateBackoff (double bt=0) |
| virtual void | stateRxBackoff () |
| virtual void | stateCheckAckExpired () |
| virtual void | stateCheckBackoffExpired () |
| virtual void | stateCheckCTSBackoffExpired () |
| virtual void | stateRxData (Packet *p) |
| virtual void | stateRxAck (Packet *p) |
| virtual void | stateRxRTS (Packet *p) |
| virtual void | stateRxCTS (Packet *p) |
| virtual void | stateWaitData (double t) |
| virtual void | exitBackoff () |
| virtual void | exitCTSBackoff () |
| virtual void | printStateInfo (double delay=0) |
| virtual void | initInfo () |
| virtual void | refreshState (UWSMARTOFDM_STATUS state) |
| virtual void | refreshReason (UWSMARTOFDM_REASON_STATUS reason) |
| virtual void | incrCurrTxRounds () |
| virtual void | resetCurrTxRounds () |
| virtual void | updateRTT (double rtt) |
| virtual double | getRTT () |
| virtual double | getRTSsent () |
| virtual double | getCTSsent () |
| 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 () |
| int | getHighPrioPktsSent () |
| int | getHighPrioPktsRecv () |
| void | carToBeUsed (criticalLevel c, int &top, int &bottom, int &avoid_top, int &avoid_bottom) |
| int | pickFreeCarriers (int *freeC) |
| int | matchCarriers (int *myFree, int *otherFree, int *matching) |
| void | updateOccupancy (int *busyCar, int ntslots) |
| void | clearOccTable () |
| void | resetAssignment () |
| void | printOccTable () |
| void | Mac2PhySetTxBusy (int, int get=0) |
| bool | batchSending () |
| void | addInvalidCarriers (int c) |
| void | removeInvalidCarrier (int c) |
| void | updateInterfTable (Packet *p) |
Static Protected Attributes | |
| static bool | initialized = false |
| static const double | prop_speed = 1500.0 |
| static map< UWSMARTOFDM_STATUS, string > | status_info |
| static map< UWSMARTOFDM_REASON_STATUS, string > | reason_info |
| static map< UWSMARTOFDM_PKT_TYPE, string > | pkt_type_info |
| static map< criticalLevel, string > | clevel_info |
This is the base class of UWSmartOFDM protocol, which is a derived class of MMac.
|
protected |
Enumeration class of UWSmartOFDM 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 | |
|---|---|
| UWSMARTOFDM_ACK_MODE | |
| UWSMARTOFDM_NO_ACK_MODE | |
|
protected |
Enumeration class of UWSmartOFDM packet type. First enumerator is given value
| Enumerator | |
|---|---|
| UWSMARTOFDM_ACK_PKT | |
| UWSMARTOFDM_DATA_PKT | |
| UWSMARTOFDM_DATAMAX_PKT | |
| UWSMARTOFDM_RTS_PKT | |
| UWSMARTOFDM_CTS_PKT | |
|
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 UWSmartOFDM status. First enumerator is given value 1.
|
protected |
Enumeration class of UWSmartOFDM timer status. First enumerator is given value
| Enumerator | |
|---|---|
| UWSMARTOFDM_IDLE | |
| UWSMARTOFDM_RUNNING | |
| UWSMARTOFDM_FROZEN | |
| UWSMARTOFDM_EXPIRED | |
| UWSmartOFDM::UWSmartOFDM | ( | ) |
Constructor of UWSmartOFDM Class
References ACK_size, ACK_timeout, alpha_, backoff_tuner, bitrateCar, buffer_pkts, CTS_size, DATA_size, fullBand, has_buffer_queue, HDR_size, MsgDisplayer::initDisplayer(), max_backoff_counter, max_burst_size, max_car_reserved, max_payload, max_rts_tries, max_tx_tries, msgDisp, nodeNum, print_transitions, req_tslots, RTS_size, timeslot_length, timeslots, uwsmartofdm_debug, and wait_constant.
Referenced by UWSmartOFDM::AckTimer::expire(), and UWSmartOFDM::CTSTimer::expire().

|
virtual |
Destructor of UWSmartOFDM Class
|
inlineprotected |
References nouse_carriers.
Referenced by command().
|
protected |
References batch_sending, and mapPacket.
|
protected |
returns the current free carriers that can be given to a node top and bottom give the range avoid_top and avoid_bottom if a subrange must be avoided, 0 otherwise
References ctrl_car, data_car, HIGH, mac_carVec, mac_ncarriers, nodeNum, and uwsmartofdm_debug.
|
protected |
clears the carriers used in the past moves the index for the current time to the next slot
References assignment_timer, ctrl_car, data_car, nouse_carriers, occupancy_table, oTableIndex, otabmtx, UWSmartOFDM::UWSmartOFDMTimer::schedule(), timeslot_length, and timeslots.

|
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) |
References ack_mode, addInvalidCarriers(), fout, getHighPrioPktsRecv(), getHighPrioPktsSent(), getUpLayersDataPktsRx(), init_macofdm_node(), initialized, initInfo(), mapPacket, print_transitions, UWSMARTOFDM_ACK_MODE, and UWSMARTOFDM_NO_ACK_MODE.

|
protectedvirtual |
Compute the transmission time of a packet. It uses a cross-layer message to calculate the duration of that packet.
| type | is a UWSMARTOFDM_PKT_TYPE |
References ACK_size, HDR_size, mapPacket, max_payload, UWSMARTOFDM_ACK_PKT, and UWSMARTOFDM_DATA_PKT.
|
inlineprotected |
Erase an item from acknowledgement stored container.
| seq_num | which is an integer data type. |
References mapAckTimer.
Referenced by stateRxAck().
|
inlineprotected |
It erases the packet from the container.
| seq_num | which is an integer data type. |
References mapPacket.
Referenced by stateRxAck(), stateSendRTS(), stateTxData(), and txData().
|
protectedvirtual |
It stops the backoff timer.
References backoff_timer, and UWSmartOFDM::UWSmartOFDMTimer::stop().
Referenced by stateCheckBackoffExpired().

|
protectedvirtual |
It stops the CTS backoff timer.
References CTS_timer, and UWSmartOFDM::UWSmartOFDMTimer::stop().
Referenced by stateCheckCTSBackoffExpired().

|
protectedvirtual |
This function calculates the backoff duration and return the backoff time.It employs the exponential backoff algorithm.
References ACK_timeout, backoff_timer, backoff_tuner, UWSmartOFDM::UWSmartOFDMTimer::getCounter(), UWSmartOFDM::UWSmartOFDMTimer::incrCounter(), max_backoff_counter, and uwsmartofdm_debug.
Referenced by stateBackoff().

|
inlineprotectedvirtual |
This method is used to get the total number of sent CTS messages.
References CTSsent.
|
inlineprotected |
References high_prio_pkt_recv.
Referenced by command().
|
inlineprotected |
References high_prio_pkt_sent.
Referenced by command().
|
inlineprotected |
This method is used to get the sequence number from a packet.
| packet | pointer |
Referenced by putPktInQueue(), stateRxAck(), stateSendRTS(), stateTxData(), and txData().
|
inlineprotectedvirtual |
Number of packets which MAC layer receives form upper layer(s) but were not transmitted.
References mapPacket.
|
inlineprotectedvirtual |
This method is used to get the total number of sent RTS messages.
References RTSsent.
|
inlineprotectedvirtual |
This method is used to get the average RTT over all the receives RTT.
References rttsamples, and sumrtt.
|
inlineprotected |
Referenced by command().
|
inlineprotectedvirtual |
Increments the current transmission round of a packet. It keeps track of the number of retransmition of a packet.
References curr_tx_rounds.
Referenced by stateTxData(), and txData().
|
inlineprotectedvirtual |
Increment the number of Data packet receive for the upper layer.
Referenced by recvFromUpperLayers().
| void UWSmartOFDM::init_macofdm_node | ( | int | subCarNum, |
| double | carSize, | ||
| int | ctrl_subCar, | ||
| std::string | modulation | ||
| ) |
References assignment_timer, ctrl_car, data_car, interf_table, mac_carMod, mac_carrierSize, mac_carVec, mac_ncarriers, nouse_carriers, occupancy_table, otabmtx, UWSmartOFDM::UWSmartOFDMTimer::schedule(), timeslot_length, and timeslots.
Referenced by command().

|
protectedvirtual |
This function is used to initialize the UWSmartOFDM protocol.
References initialized, pkt_type_info, print_transitions, reason_info, status_info, UWSMARTOFDM_ACK_PKT, UWSMARTOFDM_CTS_PKT, UWSMARTOFDM_DATA_PKT, UWSMARTOFDM_DATAMAX_PKT, UWSMARTOFDM_REASON_ACK_RX, UWSMARTOFDM_REASON_ACK_TIMEOUT, UWSMARTOFDM_REASON_ACK_TX, UWSMARTOFDM_REASON_BACKOFF_PENDING, UWSMARTOFDM_REASON_BACKOFF_TIMEOUT, UWSMARTOFDM_REASON_CTS_BACKOFF_TIMEOUT, UWSMARTOFDM_REASON_CTS_RX, UWSMARTOFDM_REASON_CTS_TX, UWSMARTOFDM_REASON_DATA_CARASSIGNED, UWSMARTOFDM_REASON_DATA_EMPTY, UWSMARTOFDM_REASON_DATA_NOCAR, UWSMARTOFDM_REASON_DATA_PENDING, UWSMARTOFDM_REASON_DATA_RX, UWSMARTOFDM_REASON_DATA_TX, UWSMARTOFDM_REASON_DATAT_EXPIRED, UWSMARTOFDM_REASON_MAX_RTS_TRIES, UWSMARTOFDM_REASON_MAX_TX_TRIES, UWSMARTOFDM_REASON_PHY_LAYER_RECEIVING, UWSMARTOFDM_REASON_PHY_LAYER_SENDING, UWSMARTOFDM_REASON_PKT_ERROR, UWSMARTOFDM_REASON_PKT_NOT_FOR_ME, UWSMARTOFDM_REASON_PREVIOUS_RTS, UWSMARTOFDM_REASON_RTS_RX, UWSMARTOFDM_REASON_RTS_TX, UWSMARTOFDM_REASON_START_RX, UWSMARTOFDM_REASON_WAIT_ACK_PENDING, UWSMARTOFDM_REASON_WAIT_CTS_PENDING, UWSMARTOFDM_REASON_WAIT_DATA, UWSMARTOFDM_RTS_PKT, UWSMARTOFDM_STATE_ACK_RX, UWSMARTOFDM_STATE_BACKOFF, UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT, UWSMARTOFDM_STATE_CHK_BACKOFF_TIMEOUT, UWSMARTOFDM_STATE_CTRL_BACKOFF, UWSMARTOFDM_STATE_DATA_RX, UWSMARTOFDM_STATE_IDLE, UWSMARTOFDM_STATE_RX_ACTIVE, UWSMARTOFDM_STATE_RX_BACKOFF, UWSMARTOFDM_STATE_RX_CTS, UWSMARTOFDM_STATE_RX_IDLE, UWSMARTOFDM_STATE_RX_RTS, UWSMARTOFDM_STATE_RX_WAIT_ACK, UWSMARTOFDM_STATE_TX_ACK, UWSMARTOFDM_STATE_TX_ACTIVE, UWSMARTOFDM_STATE_TX_CTS, UWSMARTOFDM_STATE_TX_DATA, UWSMARTOFDM_STATE_TX_RTS, UWSMARTOFDM_STATE_WAIT_ACK, UWSMARTOFDM_STATE_WAIT_CTS, UWSMARTOFDM_STATE_WAIT_DATA, and UWSMARTOFDM_STATE_WRONG_PKT_RX.
Referenced by command().
|
protectedvirtual |
This method, initialize the packet. If the packet is received from the upper layer, it adds the header (if any). In case of UWSmartOFDM 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 UWSMARTOFDM_PKT_TYPE. Packet can be either Data packet or ACK packet. |
| dest_addr | is a integer data type. It is initialized as 0. |
References ACK_size, hdr_OFDMMAC::bytesToSend, hdr_OFDM::carMod, hdr_OFDM::carrierNum, hdr_OFDM::carriers, hdr_OFDM::carrierSize, ctrl_car, CTS_size, DATA_size, fullBand, HDR_size, mac_carMod, mac_carrierSize, mac_ncarriers, mapPacket, max_burst_size, hdr_OFDM::nativeOFDM, pkt_type_info, PT_MMAC_ACK, PT_MMAC_CTS, PT_MMAC_RTS, recv_data_id, RTS_size, UWSMARTOFDM_ACK_PKT, UWSMARTOFDM_CTS_PKT, UWSMARTOFDM_DATA_PKT, uwsmartofdm_debug, and UWSMARTOFDM_RTS_PKT.
Referenced by recvFromUpperLayers(), txAck(), txCTS(), and txRTS().
|
protected |
References ClMsgUwPhyTxBusy::setGetOp(), and ClMsgUwPhyTxBusy::setTxBusy().
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxCTS(), stateRxData(), stateRxRTS(), stateSendRTS(), stateTxData(), txCTS(), and txRTS().

|
protectedvirtual |
It informs that a packet transmission started.
| Packet | pointer |
References current_rcvs, msgDisp, MsgDisplayer::printStatus(), and uwsmartofdm_debug.
Referenced by txAck(), txCTS(), txData(), and txRTS().

|
protected |
Returns free Carriers matching between itself and the sender to be used when an RTS is received to find carriers to include into CTS
| myFree | is node's free carriers |
| otherFree | is other node's free carriers |
| matching | is the match between myFree and otherFree |
References data_car, max_car_reserved, msgDisp, and MsgDisplayer::printStatus().
Referenced by txCTS().

|
protectedvirtual |
PHY layer informs the MAC layer that the reception of the packet is over.
| Packet | pointer. |
References ackToSend, curr_state, current_rcvs, Mac2PhySetTxBusy(), msgDisp, nextFreeTime, nextRTS, nextRTSts, pkt_to_ack, MsgDisplayer::printStatus(), prop_speed, refreshReason(), stateBackoff(), stateIdle(), stateRxAck(), stateRxCTS(), stateRxData(), stateRxRTS(), stateTxAck(), status_info, hdr_OFDMMAC::timeReserved, timeslot_length, updateInterfTable(), updateOccupancy(), hdr_OFDMMAC::usage_carriers, uwsmartofdm_debug, UWSMARTOFDM_REASON_ACK_RX, UWSMARTOFDM_REASON_CTS_RX, UWSMARTOFDM_REASON_DATA_RX, UWSMARTOFDM_REASON_PKT_ERROR, UWSMARTOFDM_REASON_PKT_NOT_FOR_ME, UWSMARTOFDM_REASON_RTS_RX, UWSMARTOFDM_STATE_CTRL_BACKOFF, UWSMARTOFDM_STATE_IDLE, and UWSMARTOFDM_STATE_WAIT_DATA.

|
protectedvirtual |
It infroms that a packet transmission end.
| Packet | pointer |
References ack_mode, curr_state, Mac2PhySetTxBusy(), msgDisp, prev_state, MsgDisplayer::printStatus(), refreshReason(), stateBackoff(), stateBackoffCTS(), stateIdle(), stateWaitAck(), stateWaitData(), status_info, UWSMARTOFDM_ACK_MODE, uwsmartofdm_debug, UWSMARTOFDM_REASON_ACK_TX, UWSMARTOFDM_REASON_CTS_TX, UWSMARTOFDM_REASON_DATA_TX, UWSMARTOFDM_REASON_RTS_TX, UWSMARTOFDM_STATE_IDLE, UWSMARTOFDM_STATE_TX_ACK, UWSMARTOFDM_STATE_TX_CTS, UWSMARTOFDM_STATE_TX_DATA, UWSMARTOFDM_STATE_TX_RTS, UWSMARTOFDM_STATE_WAIT_ACK, UWSMARTOFDM_STATE_WAIT_CTS, and UWSMARTOFDM_STATE_WAIT_DATA.

|
protectedvirtual |
PHY layer informs the MAC layer that it is receiving a packet. @Param Packet pointer (constant)
References current_rcvs, and uwsmartofdm_debug.
|
protected |
Returns max 5 carriers that are free in the next n time slots from occupancy table
| n | is for how many timeslots I want them free, |
| freeC | returned carriers |
References data_car, occupancy_table, oTableIndex, and otabmtx.
Referenced by stateIdle(), stateRxCTS(), txCTS(), and txRTS().
|
protected |
prints on terminal the table
References data_car, occupancy_table, oTableIndex, timeslots, and uwsmartofdm_debug.
Referenced by updateOccupancy().
|
protectedvirtual |
This methods print the state information of the nodes.
| delay | is a double data type. |
References curr_state, last_reason, prev_state, reason_info, and status_info.
Referenced by stateBackoff(), stateBackoffCTS(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxBackoff(), stateRxIdle(), stateRxWaitAck(), stateSendCTS(), stateSendRTS(), stateTxAck(), stateTxData(), stateWaitAck(), and stateWaitCTS().
|
inlineprotected |
Put acknowledgement timer in the container.
| seq_num | which is an integer data type. |
References ack_timer, and mapAckTimer.
Referenced by stateTxData().
|
inlineprotected |
A node receives packet(s) from upper layer and store them in the container.
| packet | pointer |
References getPktSeqNum(), and mapPacket.
Referenced by recvFromUpperLayers().

|
protectedvirtual |
This function receives the packet from upper layer and save it in the queue.
| Packet | pointer |
References buffer_pkts, car_assigned, curr_state, current_macDA, current_rcvs, has_buffer_queue, incrUpperDataRx(), initPkt(), Mac2PhySetTxBusy(), mapPacket, msgDisp, MsgDisplayer::printStatus(), putPktInQueue(), refreshReason(), RTSvalid, stateSendRTS(), stateTxData(), status_info, UWSMARTOFDM_DATA_PKT, uwsmartofdm_debug, UWSMARTOFDM_REASON_DATA_PENDING, and UWSMARTOFDM_STATE_IDLE.

|
inlineprotectedvirtual |
To know the reason why a node is in this current state.
| reason | is an UWSMARTOFDM_REASON_STATUS type. |
References last_reason.
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxAck(), stateRxCTS(), stateRxData(), stateRxRTS(), stateSendCTS(), stateSendRTS(), stateTxData(), and stateWaitData().
|
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.
| state | which is an UWSMARTOFDM_STATUS type. |
References curr_state, prev_prev_state, and prev_state.
Referenced by stateBackoff(), stateBackoffCTS(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxAck(), stateRxBackoff(), stateRxCTS(), stateRxData(), stateRxIdle(), stateRxRTS(), stateRxWaitAck(), stateSendCTS(), stateSendRTS(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCTS(), and stateWaitData().
|
protected |
References nouse_carriers.
|
protected |
resets value of car_assigned to FALSE
References car_assigned, and uwsmartofdm_debug.
|
inlineprotectedvirtual |
If a node is going to transmit a new packet, it resets the tx counter.
References curr_tx_rounds.
Referenced by stateTxData().
|
protectedvirtual |
If ACK packet is not received within the acknowledgement expire time.
References backoff_timer, getBackoffTime(), UWSmartOFDM::UWSmartOFDMTimer::getDuration(), UWSmartOFDM::UWSmartOFDMTimer::isFrozen(), msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), UWSmartOFDM::UWSmartOFDMTimer::schedule(), UWSmartOFDM::UWSmartOFDMTimer::unFreeze(), and UWSMARTOFDM_STATE_BACKOFF.
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), stateCheckAckExpired(), stateCheckBackoffExpired(), and stateRxData().

|
protectedvirtual |
Node is in BackoffCTS state. Waits for a CTS from coordinator.
References CTS_timer, curr_rts_tries, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), RTSvalid, UWSmartOFDM::UWSmartOFDMTimer::schedule(), and UWSMARTOFDM_STATE_CTRL_BACKOFF.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
It checks whether the ack timer is already expired while it was busy with other activities.
References curr_state, mapAckTimer, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateBackoff(), stateIdle(), status_info, UWSMARTOFDM_REASON_ACK_TIMEOUT, UWSMARTOFDM_REASON_WAIT_ACK_PENDING, UWSMARTOFDM_STATE_CHK_ACK_TIMEOUT, and UWSMARTOFDM_STATE_WAIT_ACK.
Referenced by stateTxData().

|
protectedvirtual |
It checks whether the backoff timer is already expired while it was busy with other activities.
References backoff_timer, curr_state, exitBackoff(), UWSmartOFDM::UWSmartOFDMTimer::isActive(), UWSmartOFDM::UWSmartOFDMTimer::isExpired(), msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateBackoff(), stateIdle(), status_info, UWSMARTOFDM_REASON_BACKOFF_PENDING, UWSMARTOFDM_REASON_BACKOFF_TIMEOUT, and UWSMARTOFDM_STATE_CHK_BACKOFF_TIMEOUT.

|
protectedvirtual |
It checks whether the CTS backoff timer is already expired while it was busy with other activities.
References CTS_timer, curr_state, exitCTSBackoff(), UWSmartOFDM::UWSmartOFDMTimer::isActive(), UWSmartOFDM::UWSmartOFDMTimer::isExpired(), Mac2PhySetTxBusy(), msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateIdle(), stateSendRTS(), stateWaitCTS(), status_info, UWSMARTOFDM_REASON_CTS_BACKOFF_TIMEOUT, UWSMARTOFDM_REASON_WAIT_CTS_PENDING, and UWSMARTOFDM_STATE_CHK_CTS_BACKOFF_TIMEOUT.

|
protectedvirtual |
Node is in Idle state. It only changes its state if it has packet(s) to transmit or it receives a packet.
References backoff_timer, car_assigned, current_macDA, current_rcvs, data_car, Mac2PhySetTxBusy(), mapAckTimer, mapPacket, msgDisp, nextRTS, nextRTSts, pickFreeCarriers(), print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), RTSvalid, stateSendCTS(), stateSendRTS(), stateTxData(), UWSmartOFDM::UWSmartOFDMTimer::stop(), UWSMARTOFDM_REASON_DATA_CARASSIGNED, UWSMARTOFDM_REASON_PREVIOUS_RTS, and UWSMARTOFDM_STATE_IDLE.
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateRxAck(), stateRxCTS(), stateRxData(), stateSendRTS(), stateTxData(), txCTS(), and txRTS().

|
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.
References current_rcvs, eraseItemFrommapAckTimer(), eraseItemFromPktQueue(), getPktSeqNum(), mapAckTimer, msgDisp, MsgDisplayer::printStatus(), refreshReason(), refreshState(), start_tx_time, stateIdle(), updateAckTimeout(), UWSMARTOFDM_REASON_ACK_RX, UWSMARTOFDM_STATE_ACK_RX, and UWSMARTOFDM_STATE_IDLE.
Referenced by Phy2MacEndRx().

|
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.
References backoff_timer, UWSmartOFDM::UWSmartOFDMTimer::freeze(), print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_BACKOFF.

|
protectedvirtual |
References assignment_valid_timer, car_assigned, CTS_timer, current_rcvs, data_car, Mac2PhySetTxBusy(), mac_carVec, mapPacket, msgDisp, nextAssignment, nextFreeTime, pickFreeCarriers(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), RTSvalid, UWSmartOFDM::UWSmartOFDMTimer::schedule(), stateIdle(), stateTxData(), hdr_OFDMMAC::timeReserved, timeslot_length, updateOccupancy(), hdr_OFDMMAC::usage_carriers, UWSMARTOFDM_REASON_CTS_RX, and UWSMARTOFDM_STATE_RX_CTS.
Referenced by Phy2MacEndRx().

|
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 |
References ack_mode, ack_timer, ackToSend, current_rcvs, DATA_timer, HDR_size, Mac2PhySetTxBusy(), msgDisp, pkt_to_ack, MsgDisplayer::printStatus(), recv_data_id, refreshReason(), refreshState(), stateBackoff(), stateIdle(), stateTxAck(), UWSmartOFDM::UWSmartOFDMTimer::stop(), UWSMARTOFDM_ACK_MODE, UWSMARTOFDM_REASON_DATA_RX, UWSMARTOFDM_STATE_DATA_RX, UWSMARTOFDM_STATE_IDLE, and waitPkt.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
If a node start receiving a packet in Idle state.
References print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_IDLE.

|
protectedvirtual |
References current_rcvs, Mac2PhySetTxBusy(), msgDisp, MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateSendCTS(), uwsmartofdm_debug, UWSMARTOFDM_REASON_RTS_RX, and UWSMARTOFDM_STATE_RX_RTS.
Referenced by Phy2MacEndRx().

|
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.
References print_transitions, printStateInfo(), refreshState(), and UWSMARTOFDM_STATE_RX_WAIT_ACK.

|
protectedvirtual |
Node is in sendRTS state. It has sent a CTS to the node.
References hdr_OFDMMAC::bytesToSend, DATA_size, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), txCTS(), hdr_OFDMMAC::usage_carriers, UWSMARTOFDM_REASON_CTS_TX, UWSMARTOFDM_STATE_TX_CTS, and waitPkt.
Referenced by stateIdle(), and stateRxRTS().

|
protectedvirtual |
Node is in sendRTS state. If a packet needs to be send and the carriers are not yet assigned to that node, an RTS is sent.
References curr_data_pkt, curr_rts_tries, curr_state, eraseItemFromPktQueue(), getPktSeqNum(), Mac2PhySetTxBusy(), mapPacket, max_rts_tries, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshReason(), refreshState(), stateIdle(), txRTS(), uwsmartofdm_debug, UWSMARTOFDM_REASON_DATA_NOCAR, UWSMARTOFDM_REASON_MAX_RTS_TRIES, and UWSMARTOFDM_STATE_TX_RTS.
Referenced by recvFromUpperLayers(), stateCheckCTSBackoffExpired(), and stateIdle().

|
protectedvirtual |
If the protocl uses ARQ technique, in that case, after receiving a Data packet the node sends an ACK packet.
References ackToSend, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), txAck(), and UWSMARTOFDM_STATE_TX_ACK.
Referenced by Phy2MacEndRx(), and stateRxData().

|
protectedvirtual |
If a node has packet to transmits. In such case, it moves from Idle state to data transmits state.
References backoff_timer, hdr_OFDM::carriers, ctrl_car, curr_data_pkt, curr_tx_rounds, eraseItemFromPktQueue(), fullBand, getPktSeqNum(), UWSmartOFDM::UWSmartOFDMTimer::incrCounter(), incrCurrTxRounds(), last_sent_data_id, Mac2PhySetTxBusy(), mac_carVec, mac_ncarriers, mapAckTimer, mapPacket, max_tx_tries, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), putAckTimerInMap(), refreshReason(), refreshState(), UWSmartOFDM::UWSmartOFDMTimer::resetCounter(), resetCurrTxRounds(), start_tx_time, stateCheckAckExpired(), stateIdle(), txData(), UWSMARTOFDM_REASON_MAX_TX_TRIES, and UWSMARTOFDM_STATE_TX_DATA.
Referenced by recvFromUpperLayers(), stateIdle(), and stateRxCTS().

|
protectedvirtual |
After transmitting a Data packet, a node waits for the ACK packet.
References ACK_timeout, mapAckTimer, msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), UWSMARTOFDM_STATE_WAIT_ACK, and wait_constant.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
Node is in waitCTS state. Waits for a CTS from coordinator.
References msgDisp, print_transitions, printStateInfo(), MsgDisplayer::printStatus(), refreshState(), and UWSMARTOFDM_STATE_WAIT_CTS.
Referenced by stateCheckCTSBackoffExpired().

|
protectedvirtual |
References DATA_timer, msgDisp, MsgDisplayer::printStatus(), refreshReason(), refreshState(), UWSmartOFDM::UWSmartOFDMTimer::schedule(), UWSMARTOFDM_REASON_WAIT_DATA, and UWSMARTOFDM_STATE_WAIT_DATA.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
This methods transmits ACK packet from MAC layer to PHY layer.
| dest_addr | which is an integer data type. |
References initPkt(), Mac2PhyStartTx(), and UWSMARTOFDM_ACK_PKT.
Referenced by stateTxAck().

|
protectedvirtual |
This methods transmits CTS packet from MAC layer to PHY layer.
| dest_addr | which is an integer data type. |
| rcv_car | carriers received in the RTS |
| bytesToSend | bytes requested by RTS |
References ack_mode, bitrateCar, CTSsent, data_car, initPkt(), Mac2PhySetTxBusy(), Mac2PhyStartTx(), matchCarriers(), msgDisp, nextFreeTime, nextRTS, pickFreeCarriers(), MsgDisplayer::printStatus(), stateIdle(), hdr_OFDMMAC::timeReserved, timeslot_length, updateOccupancy(), hdr_OFDMMAC::usage_carriers, UWSMARTOFDM_ACK_MODE, UWSMARTOFDM_CTS_PKT, and uwsmartofdm_debug.
Referenced by stateSendCTS().

|
protectedvirtual |
This method transmits Data packets from MAC layer to PHY layer.
References ack_mode, curr_data_pkt, curr_rts_tries, eraseItemFromPktQueue(), getPktSeqNum(), incrCurrTxRounds(), Mac2PhyStartTx(), and UWSMARTOFDM_NO_ACK_MODE.
Referenced by stateTxData().

|
protectedvirtual |
This methods transmits RTS packet from MAC layer to PHY layer.
| dest_addr | which is an integer data type. |
References curr_rts_tries, current_macDA, initPkt(), Mac2PhySetTxBusy(), Mac2PhyStartTx(), msgDisp, nextFreeTime, pickFreeCarriers(), MsgDisplayer::printStatus(), RTS_timer, RTSsent, RTSvalid, UWSmartOFDM::UWSmartOFDMTimer::schedule(), stateIdle(), hdr_OFDMMAC::usage_carriers, and UWSMARTOFDM_RTS_PKT.
Referenced by stateSendRTS().

|
protectedvirtual |
Like updateRTT() function.
References ACK_timeout, updateRTT(), and uwsmartofdm_debug.
Referenced by stateRxAck().

|
protected |
References fullBand, interf_table, mac_ncarriers, msgDisp, nouse_carriers, and MsgDisplayer::printStatus().
Referenced by Phy2MacEndRx().

|
inlineprotectedvirtual |
It updates the sequence number of the last data packet rx.
| id | is an integer data type. |
References last_data_id_rx.
|
protected |
updates occupancy table
| busyCar | carriers to update in occupancy table |
| ntslots | number of timeslots that will be reserved |
References data_car, occupancy_table, oTableIndex, otabmtx, printOccTable(), and timeslots.
Referenced by Phy2MacEndRx(), stateRxCTS(), and txCTS().

|
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. |
References ACK_timeout, alpha_, rttsamples, srtt, sumrtt, and sumrtt2.
Referenced by updateAckTimeout().
|
protectedvirtual |
|
protected |
Enum variable. It tells the node whether to use ARQ technique or not.
Referenced by command(), Phy2MacEndTx(), stateRxData(), txCTS(), and txData().
|
protected |
Size of the ACK, if the node uses ARQ technique
Referenced by computeTxTime(), initPkt(), and UWSmartOFDM().
|
protected |
ACK timeout for the initial packet
Referenced by getBackoffTime(), stateWaitAck(), updateAckTimeout(), updateRTT(), and UWSmartOFDM().
|
protected |
An object of the AckTimer class
Referenced by putAckTimerInMap(), and stateRxData().
|
protected |
Referenced by Phy2MacEndRx(), stateRxData(), and stateTxAck().
|
protected |
This variable is used to tune the RTT
Referenced by updateRTT(), and UWSmartOFDM().
|
protected |
An object of the assignment timer class
Referenced by clearOccTable(), and init_macofdm_node().
|
protected |
An object of the assignment valid timer class
Referenced by stateRxCTS().
|
protected |
An object of the backoff timer class
Referenced by exitBackoff(), getBackoffTime(), stateBackoff(), stateCheckBackoffExpired(), stateIdle(), stateRxBackoff(), and stateTxData().
|
protected |
Tunes the backoff duration.
Referenced by getBackoffTime(), and UWSmartOFDM().
|
protected |
Referenced by batchSending().
|
protected |
Referenced by txCTS(), and UWSmartOFDM().
|
protected |
Number of packets a node can store in the container
Referenced by recvFromUpperLayers(), and UWSmartOFDM().
|
protected |
Referenced by recvFromUpperLayers(), resetAssignment(), stateIdle(), and stateRxCTS().
|
protected |
|
staticprotected |
Container which stores all the packet type information of UWSmartOFDM
|
protected |
|
protected |
Referenced by carToBeUsed(), clearOccTable(), init_macofdm_node(), initPkt(), and stateTxData().
|
protected |
Size of the ACK, if the node uses SMARTOFDM
Referenced by initPkt(), and UWSmartOFDM().
|
protected |
An object of the CTS timer class
Referenced by exitCTSBackoff(), stateBackoffCTS(), stateCheckCTSBackoffExpired(), and stateRxCTS().
|
protected |
Referenced by getCTSsent(), and txCTS().
|
protected |
Pointer of the latest selected data packet.
Referenced by stateSendRTS(), stateTxData(), and txData().
|
protected |
|
protected |
Referenced by stateBackoffCTS(), stateSendRTS(), txData(), and txRTS().
|
protected |
Enum variable. It stores the current state of a node
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), recvFromUpperLayers(), refreshState(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), and stateSendRTS().
|
protected |
How many times a packet is transmitted
Referenced by incrCurrTxRounds(), resetCurrTxRounds(), and stateTxData().
|
protected |
Referenced by recvFromUpperLayers(), stateIdle(), and txRTS().
|
protected |
Referenced by Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacStartRx(), recvFromUpperLayers(), stateIdle(), stateRxAck(), stateRxCTS(), stateRxData(), and stateRxRTS().
|
protected |
|
protected |
Referenced by carToBeUsed(), clearOccTable(), init_macofdm_node(), matchCarriers(), pickFreeCarriers(), printOccTable(), stateIdle(), stateRxCTS(), txCTS(), and updateOccupancy().
|
protected |
Size of the DATA packet, if the node uses SMARTOFDM
Referenced by initPkt(), stateSendCTS(), and UWSmartOFDM().
|
protected |
An object of the DATA timer class
Referenced by stateRxData(), and stateWaitData().
|
protected |
An object of ofstream class
Referenced by command().
|
protected |
Referenced by initPkt(), stateTxData(), updateInterfTable(), and UWSmartOFDM().
|
protected |
Whether the node has buffer to store data or not
Referenced by recvFromUpperLayers(), and UWSmartOFDM().
|
protected |
Size of the HDR if any
Referenced by computeTxTime(), initPkt(), stateRxData(), and UWSmartOFDM().
|
protected |
Referenced by getHighPrioPktsRecv().
|
protected |
Referenced by getHighPrioPktsSent().
|
staticprotected |
It checks whether UWSmartOFDM protocol is initialized or not. If FALSE means, not initialized and if TRUE means it is initialized
Referenced by command(), and initInfo().
|
protected |
Referenced by init_macofdm_node(), and updateInterfTable().
|
protected |
The sequence number of last received packet
Referenced by updateLastDataIdRx().
|
protected |
Enum variable which stores the last reason why a node changes its state
Referenced by printStateInfo(), and refreshReason().
|
protected |
sequence number of the last sent packet
Referenced by stateTxData().
|
protected |
Referenced by init_macofdm_node(), and initPkt().
|
protected |
Referenced by init_macofdm_node(), and initPkt().
|
protected |
Referenced by carToBeUsed(), init_macofdm_node(), stateRxCTS(), and stateTxData().
|
protected |
Referenced by carToBeUsed(), init_macofdm_node(), initPkt(), stateTxData(), and updateInterfTable().
|
protected |
Container where acknowledgement timer(s) is stored
Referenced by eraseItemFrommapAckTimer(), putAckTimerInMap(), stateCheckAckExpired(), stateIdle(), stateRxAck(), stateTxData(), and stateWaitAck().
|
protected |
Container where Data packets are stored
Referenced by batchSending(), command(), computeTxTime(), eraseItemFromPktQueue(), getRemainingPkts(), initPkt(), putPktInQueue(), recvFromUpperLayers(), stateIdle(), stateRxCTS(), stateSendRTS(), and stateTxData().
|
protected |
|
protected |
Maximum number of backoff it will consider while it increases the backoff exponentially
Referenced by getBackoffTime(), and UWSmartOFDM().
|
protected |
Referenced by initPkt(), and UWSmartOFDM().
|
protected |
Referenced by matchCarriers(), and UWSmartOFDM().
|
protected |
Maximum number of payload in a packet.
Referenced by computeTxTime(), and UWSmartOFDM().
|
protected |
Referenced by stateSendRTS(), and UWSmartOFDM().
|
protected |
Maximum number of retransmissions attempt.
Referenced by stateTxData(), and UWSmartOFDM().
|
protected |
Referenced by Mac2PhyStartTx(), matchCarriers(), Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), stateBackoff(), stateBackoffCTS(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxAck(), stateRxCTS(), stateRxData(), stateRxRTS(), stateSendCTS(), stateSendRTS(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCTS(), stateWaitData(), txCTS(), txRTS(), updateInterfTable(), and UWSmartOFDM().
|
protected |
Referenced by stateRxCTS().
|
protected |
Referenced by Phy2MacEndRx(), stateRxCTS(), txCTS(), and txRTS().
|
protected |
Referenced by Phy2MacEndRx(), stateIdle(), and txCTS().
|
protected |
Referenced by Phy2MacEndRx(), and stateIdle().
|
protected |
Referenced by carToBeUsed(), and UWSmartOFDM().
|
protected |
Referenced by addInvalidCarriers(), clearOccTable(), init_macofdm_node(), removeInvalidCarrier(), and updateInterfTable().
|
protected |
Referenced by clearOccTable(), init_macofdm_node(), pickFreeCarriers(), printOccTable(), and updateOccupancy().
|
protected |
Referenced by clearOccTable(), pickFreeCarriers(), printOccTable(), and updateOccupancy().
|
protected |
Referenced by clearOccTable(), init_macofdm_node(), pickFreeCarriers(), and updateOccupancy().
|
protected |
Referenced by Phy2MacEndRx(), and stateRxData().
|
staticprotected |
Container which stores all the packet type information of UWSmartOFDM
Referenced by initInfo(), and initPkt().
|
protected |
Enum variable. It stores the previous to previous state of a node
Referenced by refreshState().
|
protected |
Enum variable. It stores the previous state of a node
Referenced by Phy2MacEndTx(), printStateInfo(), and refreshState().
|
protected |
Whether to print the state of the nodes
Referenced by command(), initInfo(), stateBackoff(), stateBackoffCTS(), stateCheckAckExpired(), stateCheckBackoffExpired(), stateCheckCTSBackoffExpired(), stateIdle(), stateRxBackoff(), stateRxIdle(), stateRxWaitAck(), stateSendCTS(), stateSendRTS(), stateTxAck(), stateTxData(), stateWaitAck(), stateWaitCTS(), and UWSmartOFDM().
|
staticprotected |
Speed of the sound signal
Referenced by Phy2MacEndRx().
|
staticprotected |
Container which stores all the reason information
Referenced by initInfo(), and printStateInfo().
|
protected |
The sequence number of the packet which is received
Referenced by initPkt(), and stateRxData().
|
protected |
Referenced by UWSmartOFDM().
|
protected |
Size of the ACK, if the node uses SMARTOFDM
Referenced by initPkt(), and UWSmartOFDM().
|
protected |
Referenced by getRTSsent(), and txRTS().
|
protected |
Referenced by recvFromUpperLayers(), stateBackoffCTS(), stateIdle(), stateRxCTS(), and txRTS().
|
protected |
Number of RTT samples
Referenced by getRTT(), and updateRTT().
|
protected |
Smoothed Round Trip Time, calculated as for TCP
Referenced by updateRTT().
|
protected |
Time when a packet start transmitting
Referenced by stateRxAck(), and stateTxData().
|
staticprotected |
Container which stores all the status information
Referenced by initInfo(), Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), recvFromUpperLayers(), stateCheckAckExpired(), stateCheckBackoffExpired(), and stateCheckCTSBackoffExpired().
|
protected |
Sum of RTT samples
Referenced by getRTT(), and updateRTT().
|
protected |
Sum of (RTT^2)
Referenced by updateRTT().
|
protected |
Referenced by clearOccTable(), init_macofdm_node(), Phy2MacEndRx(), stateRxCTS(), txCTS(), and UWSmartOFDM().
|
protected |
Referenced by clearOccTable(), init_macofdm_node(), printOccTable(), updateOccupancy(), and UWSmartOFDM().
|
protected |
Sequence number of the packet which is transmitted
|
protected |
Debuging Flag
Referenced by carToBeUsed(), getBackoffTime(), initPkt(), Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), printOccTable(), recvFromUpperLayers(), resetAssignment(), stateRxRTS(), stateSendRTS(), txCTS(), updateAckTimeout(), and UWSmartOFDM().
|
protected |
This fixed time is used to componsate different time variations.
Referenced by stateWaitAck(), and UWSmartOFDM().
|
protected |
Referenced by stateRxData(), and stateSendCTS().