|
DESERT 4.0.0
|
#include <uw-mac-DACAP-alter.h>


Public Member Functions | |
| MMacDACAP () | |
| virtual | ~MMacDACAP () |
| virtual int | command (int argc, const char *const *argv) |
| virtual int | crLayCommand (ClMessage *m) |
Protected Member Functions | |
| virtual void | recvFromUpperLayers (Packet *p) |
| virtual void | Phy2MacEndTx (const Packet *p) |
| virtual void | Phy2MacStartRx (const Packet *p) |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual double | computeWaitTime (int mode, double distance) |
| virtual double | computeTxTime (int type) |
| virtual void | initPkt (Packet *p, int pkt_type) |
| virtual double | getBackoffTime () |
| virtual double | getRecontendTime () |
| virtual void | txAck () |
| virtual void | txData () |
| virtual void | txRts () |
| virtual void | txCts () |
| virtual void | txWrn () |
| virtual void | rxStateIdle (Packet *p) |
| virtual void | rxStateBackoff (Packet *p) |
| virtual void | rxStateWaitCTS (Packet *p) |
| virtual void | rxStateWaitACK (Packet *p) |
| virtual void | rxStateWaitData (Packet *p) |
| virtual void | rxStateWaitXCts (Packet *p) |
| virtual void | rxStateWaitXData (Packet *p) |
| virtual void | rxStateWaitXAck (Packet *p) |
| virtual void | rxStateWaitXWarning (Packet *p) |
| virtual void | rxStateWaitWarning (Packet *p) |
| virtual void | rxStateSendWarning (Packet *p) |
| virtual void | rxStateRecontendWindow (Packet *p) |
| virtual void | stateIdle () |
| virtual void | stateSendRTS () |
| virtual void | stateBackoff () |
| virtual void | stateWaitCTS () |
| virtual void | stateDeferData () |
| virtual void | stateSendData () |
| virtual void | stateWaitACK () |
| virtual void | stateCTSReceived () |
| virtual void | stateWaitData () |
| virtual void | stateDataReceived (Packet *data_pkt) |
| virtual void | stateWaitXCts () |
| virtual void | stateWaitXData () |
| virtual void | stateWaitXAck () |
| virtual void | stateWaitXWarning () |
| virtual void | stateSendAck () |
| virtual void | stateSendCTS () |
| virtual void | stateWaitWarning () |
| virtual void | stateSendWarning () |
| virtual void | stateRecontendWindow () |
| virtual void | printStateInfo (double delay=0) |
| virtual void | initInfo () |
| virtual void | refreshState (int state) |
| virtual void | setBackoffNodes (double node, double node_b) |
| virtual void | exitBackoff () |
| virtual void | exitSleep () |
| virtual void | freezeBackoff () |
| virtual int | getQueueSize () |
| virtual void | queuePop (bool flag=true) |
| virtual void | waitForUser () |
| int | getUpLayersDataPktsRx () |
| virtual void | incrWrnPktsTx () |
| virtual void | incrWrnPktsRx () |
| virtual void | incrRtsPktsTx () |
| virtual void | incrRtsPktsRx () |
| virtual void | incrCtsPktsTx () |
| virtual void | incrCtsPktsRx () |
| virtual void | incrTotalDeferTimes () |
| virtual void | resetStats () |
| virtual int | getRemainingPkts () |
| virtual int | getWrnPktsTx () |
| virtual int | getWrnPktsRx () |
| virtual int | getRtsPktsTx () |
| virtual int | getRtsPktsRx () |
| virtual int | getCtsPktsTx () |
| virtual int | getCtsPktsRx () |
| virtual int | getTotalDeferTimes () |
| virtual void | backoffStartTime () |
| virtual void | deferEndTime (double duration) |
| virtual void | backoffEndTime () |
| virtual double | getMeanDeferTime () |
Static Protected Attributes | |
| static int | u_pkt_id |
| static map< int, string > | info |
Friends | |
| class | DACAPTimer |
| class | DACAPBTimer |
Class that represents a DACAP node
| MMacDACAP::MMacDACAP | ( | ) |
Costructor of the MMacDACAP class
References ACK_size, alpha_, backoff_tuner, buffer_pkts, CTS_size, delta_D, delta_data, has_buffer_queue, HDR_size, info, initInfo(), max_backoff_counter, max_payload, max_prop_delay, max_tx_tries, RTS_size, t_min, T_W_min, u_pkt_id, wait_costant, and WRN_size.

|
virtual |
Destructor of the MMacDACAP class
|
inlineprotectedvirtual |
calculates the End Time of the backoff timer
References backoff_first_start.
Referenced by exitBackoff().
|
inlineprotectedvirtual |
Sets the start time of the backoff timer to NOW
References backoff_first_start.
Referenced by stateBackoff().
|
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, backoff_freeze_mode, fout, getCtsPktsRx(), getCtsPktsTx(), getMeanDeferTime(), getQueueSize(), getRtsPktsRx(), getRtsPktsTx(), getTotalDeferTimes(), getUpLayersDataPktsRx(), getWrnPktsRx(), getWrnPktsTx(), multihop_mode, NO_ACK_MODE, op_mode, and print_transitions.

|
protectedvirtual |
Computes the time that is needed to transmit a packet, implementing a CrLayMessage for asking the PHY layer to perform this calculation
| type | of the packet |
References ACK_PKT, ACK_size, CTS_PKT, CTS_size, DATA_PKT, HDR_size, max_payload, Q, RTS_PKT, RTS_size, WRN_PKT, and WRN_size.
Referenced by computeWaitTime(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), stateWaitXAck(), stateWaitXCts(), stateWaitXData(), and stateWaitXWarning().
|
protectedvirtual |
Computes the T_w parameter, that is the minimum time that the sender has to wait between the reception of CTS packet and the effective transmission of data packet
| mode | indicates whether the ACK mode or no_ACK mode is activated |
| distance | between the sender and the receiver |
References computeTxTime(), DATA_PKT, delta_D, delta_data, max_prop_delay, NO_ACK_MODE, t_min, and T_W_min.
Referenced by stateDeferData(), stateWaitData(), and stateWaitXData().

|
virtual |
Cross-Layer messages interpreter
| ClMessage* | an instance of ClMessage that represent the message received |
|
inlineprotectedvirtual |
Sets the end time of the defer summing the duration to the actual duration of defer
| double | duration of the defer time |
References sum_defer_time.
Referenced by stateDeferData().
|
inlineprotectedvirtual |
The backoff timer is stopped
References backoff_duration, backoff_first_start, backoff_freeze_mode, backoff_pending, backoff_remaining, backoff_start_time, backoff_timer, backoffEndTime(), NOT_SET, and timer.
Referenced by rxStateBackoff().

|
protectedvirtual |
This method erase the MAC address of the two nodes that have intiated a handshake procedure if this handshake is done
References NOT_SET, sleep_node_1, and sleep_node_2.
Referenced by rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), and stateIdle().
|
inlineprotectedvirtual |
Freezes the Backoff timer
References backoff_duration, backoff_pending, backoff_remaining, backoff_start_time, NOT_SET, and timer.
Referenced by rxStateBackoff().
|
protectedvirtual |
Calculate the backoff time if the node didn't received the ACK
References backoff_counter, backoff_tuner, max_backoff_counter, and max_prop_delay.
Referenced by stateBackoff().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
References defer_times_no, and sum_defer_time.
Referenced by command().
|
inlineprotectedvirtual |
|
protectedvirtual |
Used in multihop mode
References max_prop_delay, and wait_costant.
Referenced by stateRecontendWindow().
|
inlineprotectedvirtual |
References Q.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotected |
Referenced by command().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Increases the counter of CTS packets received
References cts_pkts_rx.
Referenced by rxStateWaitCTS().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Increases the counter of RTS packets received
References rts_pkts_rx.
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), and rxStateWaitData().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Increases the number of times a transmission is deferred
References defer_times_no.
Referenced by stateDeferData().
|
inlineprotectedvirtual |
Increases the counter of WRN packets received
References wrn_pkts_rx.
Referenced by rxStateWaitWarning().
|
inlineprotectedvirtual |
|
protectedvirtual |
Initializes the protocol at the beginning of the simulation. This method is called by a command in tcl.
References ACK_PKT, CTS_PKT, DATA_PKT, info, print_transitions, REASON_ACK_RECEIVED, REASON_ACK_SENT, REASON_BACKOFF_END, REASON_BACKOFF_PENDING, REASON_CTS_RECEIVED, REASON_CTS_SENT, REASON_DATA_PENDING, REASON_DATA_RECEIVED, REASON_DATA_SENT, REASON_DEFER, REASON_DEFER_END, REASON_INTERFERENCE, REASON_MAX_TX_TRIES, REASON_NOACK, REASON_NOCTS, REASON_NODATA, REASON_NOWRN, REASON_RTS_RECEIVED, REASON_RTS_SENT, REASON_SAME_RTS_RECEIVED, REASON_TX_ENDED, REASON_WAIT_RECONTEND_END, REASON_WAIT_XWRN_END, REASON_WRN_END, REASON_WRN_RECEIVED, REASON_XACK_END, REASON_XACK_RX, REASON_XCTS_END, REASON_XCTS_RX, REASON_XDATA_END, REASON_XDATA_RX, REASON_XRTS_RX, RTS_PKT, STATE_BACKOFF, STATE_CTS_RECEIVED, STATE_DATA_RECEIVED, STATE_DEFER_DATA, STATE_IDLE, STATE_RECONTEND_WINDOW, STATE_SEND_ACK, STATE_SEND_CTS, STATE_SEND_DATA, STATE_SEND_RTS, STATE_SEND_WRN, STATE_WAIT_ACK, STATE_WAIT_CTS, STATE_WAIT_DATA, STATE_WAIT_WRN, STATE_WAIT_XACK, STATE_WAIT_XCTS, STATE_WAIT_XDATA, STATE_WAIT_XWRN, and WRN_PKT.
Referenced by MMacDACAP().
|
protectedvirtual |
Initializes the packet with the correct MAC source address and destination address, the correct type and size
| Pointer | to the packet that we have to initialize |
| type | of the packet that we are going to initialize |
References ACK_PKT, CTS_PKT, CTS_size, curr_data_pkt, curr_dest_addr, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, HDR_size, hdr_dacap::orig_type, PT_DACAP, RTS_PKT, RTS_size, hdr_dacap::sn, hdr_dacap::ts, hdr_dacap::tx_tries, txsn, u_data_id, u_pkt_id, WRN_PKT, and WRN_size.
Referenced by recvFromUpperLayers(), txAck(), txCts(), txRts(), and txWrn().
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet
| const | Packet* Pointer to an object of type Packet that rapresent the packet received |
References curr_state, hdr_dacap::dacap_type, info, PT_DACAP, rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitACK(), rxStateWaitCTS(), rxStateWaitData(), rxStateWaitWarning(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), STATE_BACKOFF, STATE_IDLE, STATE_RECONTEND_WINDOW, STATE_SEND_WRN, STATE_WAIT_ACK, STATE_WAIT_CTS, STATE_WAIT_DATA, STATE_WAIT_WRN, STATE_WAIT_XACK, STATE_WAIT_XCTS, STATE_WAIT_XDATA, and STATE_WAIT_XWRN.

|
protectedvirtual |
Method called when the PHY layer finish to transmit the packet.
| Packet* | Pointer to an object of type Packet that rapresent the Packet transmitted |
References ACK_MODE, backoff_pending, curr_state, info, last_reason, multihop_mode, NO_ACK_MODE, op_mode, Q, REASON_ACK_SENT, REASON_BACKOFF_PENDING, REASON_CTS_SENT, REASON_DATA_SENT, REASON_RTS_SENT, STATE_BACKOFF, STATE_IDLE, STATE_SEND_ACK, STATE_SEND_CTS, STATE_SEND_DATA, STATE_SEND_RTS, STATE_SEND_WRN, STATE_WAIT_ACK, STATE_WAIT_CTS, STATE_WAIT_DATA, stateBackoff(), stateIdle(), stateRecontendWindow(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), and TxActive.

|
protectedvirtual |
Method called when the Phy Layer start to receive a Packet
| const | Packet* Pointer to an object of type Packet that rapresent the Packet that is in reception |
References RxActive.
|
protectedvirtual |
Prints a file with every state change for debug purposes.
| delay | from the call of the method and the effective write process on the file |
References backoff_counter, curr_state, fout, info, last_reason, prev_state, print_transitions, STATE_BACKOFF, STATE_DEFER_DATA, and STATE_RECONTEND_WINDOW.
Referenced by stateBackoff(), stateCTSReceived(), stateDataReceived(), stateDeferData(), stateIdle(), stateRecontendWindow(), stateSendAck(), stateSendCTS(), stateSendData(), stateSendRTS(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), stateWaitXAck(), stateWaitXCts(), stateWaitXData(), and stateWaitXWarning().
|
inlineprotectedvirtual |
Pop the first element of the queue
References Q.
Referenced by rxStateWaitACK(), stateIdle(), and txData().
|
protectedvirtual |
Receive the packet from the upper layer (e.g. IP)
| Packet* | pointer to the packet received |
References buffer_pkts, curr_state, DATA_PKT, has_buffer_queue, initPkt(), last_reason, Q, REASON_DATA_PENDING, RxActive, session_active, STATE_IDLE, and stateSendRTS().

|
inlineprotectedvirtual |
Refresh the state of the protocol
| int | current state of the protcol |
References curr_state, and prev_state.
Referenced by stateBackoff(), stateCTSReceived(), stateDataReceived(), stateDeferData(), stateIdle(), stateRecontendWindow(), stateSendAck(), stateSendCTS(), stateSendData(), stateSendRTS(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), stateWaitXAck(), stateWaitXCts(), stateWaitXData(), and stateWaitXWarning().
|
inlineprotectedvirtual |
Resets all the stats counters
References defer_times_no, wrn_pkts_rx, and wrn_pkts_tx.
|
protectedvirtual |
The case of reception while the protocol is in BACKOFF state is handled
| Packet* | pointer to the packet is reception |
References backoff_freeze_mode, CTS_PKT, curr_dest_addr, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, exitBackoff(), freezeBackoff(), incrRtsPktsRx(), info, last_data_id_rx, last_reason, REASON_RTS_RECEIVED, REASON_XCTS_RX, REASON_XDATA_RX, REASON_XRTS_RX, RTS_PKT, RxActive, session_active, session_distance, setBackoffNodes(), STATE_SEND_CTS, STATE_WAIT_XACK, STATE_WAIT_XCTS, STATE_WAIT_XWRN, stateSendCTS(), stateWaitXAck(), stateWaitXCts(), and stateWaitXWarning().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in IDLE state is handled
| Packet* | pointer to the packet is reception |
References CTS_PKT, curr_dest_addr, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, incrRtsPktsRx(), info, last_data_id_rx, last_reason, REASON_RTS_RECEIVED, REASON_XCTS_RX, REASON_XDATA_RX, REASON_XRTS_RX, RTS_PKT, RxActive, session_active, session_distance, setBackoffNodes(), STATE_SEND_CTS, stateSendCTS(), stateWaitXAck(), stateWaitXCts(), and stateWaitXWarning().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in RecontendWindow state is handled
| Packet* | pointer to the packet is reception |
References CTS_PKT, curr_dest_addr, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, incrRtsPktsRx(), info, last_data_id_rx, last_reason, REASON_RTS_RECEIVED, REASON_XCTS_RX, REASON_XDATA_RX, REASON_XRTS_RX, RTS_PKT, RxActive, session_active, session_distance, setBackoffNodes(), STATE_SEND_CTS, STATE_WAIT_XACK, STATE_WAIT_XCTS, STATE_WAIT_XWRN, stateSendCTS(), stateWaitXAck(), stateWaitXCts(), and stateWaitXWarning().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in SendWarning state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, CTS_PKT, curr_dest_addr, curr_state, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, incrRtsPktsRx(), info, last_data_id_rx, last_reason, max_prop_delay, op_mode, REASON_DATA_RECEIVED, REASON_SAME_RTS_RECEIVED, RTS_PKT, RxActive, session_active, session_distance, stateDataReceived(), stateSendCTS(), t_min, T_W_min, txWrn(), and waitForUser().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitACK state is handled
| Packet* | pointer to the packet is reception |
References ACK_PKT, backoff_pending, curr_dest_addr, hdr_dacap::dacap_type, hdr_dacap::data_sn, info, last_reason, multihop_mode, Q, queuePop(), REASON_ACK_RECEIVED, REASON_BACKOFF_PENDING, RxActive, STATE_BACKOFF, STATE_IDLE, stateBackoff(), stateIdle(), and stateRecontendWindow().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitCTS state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, CTS_PKT, curr_dest_addr, hdr_dacap::dacap_type, hdr_dacap::data_sn, defer_data, incrCtsPktsRx(), info, last_reason, max_prop_delay, NO_ACK_MODE, op_mode, REASON_CTS_RECEIVED, RTS_PKT, RxActive, session_distance, STATE_WAIT_WRN, stateWaitWarning(), t_min, and T_W_min.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitDATA state is handled
| Packet* | pointer to the packet is reception |
References curr_dest_addr, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, incrRtsPktsRx(), info, last_data_id_rx, last_reason, REASON_DATA_RECEIVED, REASON_SAME_RTS_RECEIVED, RTS_PKT, RxActive, session_active, session_distance, STATE_DATA_RECEIVED, stateDataReceived(), and stateSendCTS().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitWarning state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, CTS_PKT, curr_dest_addr, hdr_dacap::dacap_type, hdr_dacap::data_sn, defer_data, incrWrnPktsRx(), max_prop_delay, NO_ACK_MODE, op_mode, RTS_PKT, RxActive, t_min, T_W_min, and WRN_PKT.
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitXAck state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, ACK_PKT, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, exitSleep(), info, last_reason, NO_ACK_MODE, op_mode, REASON_TX_ENDED, RxActive, sleep_node_1, sleep_node_2, STATE_IDLE, and stateIdle().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitXCts state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, ACK_PKT, CTS_PKT, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, exitSleep(), info, last_reason, NO_ACK_MODE, op_mode, REASON_TX_ENDED, REASON_XCTS_RX, REASON_XDATA_RX, RxActive, sleep_node_1, sleep_node_2, STATE_IDLE, STATE_WAIT_XACK, STATE_WAIT_XWRN, stateIdle(), stateWaitXAck(), and stateWaitXWarning().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitXData state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, ACK_PKT, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, exitSleep(), info, last_reason, NO_ACK_MODE, op_mode, REASON_TX_ENDED, REASON_XDATA_RX, RxActive, sleep_node_1, sleep_node_2, STATE_IDLE, STATE_WAIT_XACK, stateIdle(), and stateWaitXAck().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
The case of reception while the protocol is in WaitXWarning state is handled
| Packet* | pointer to the packet is reception |
References ACK_MODE, ACK_PKT, hdr_dacap::dacap_type, DATA_PKT, hdr_dacap::data_sn, exitSleep(), info, last_reason, NO_ACK_MODE, op_mode, REASON_TX_ENDED, REASON_XDATA_RX, RxActive, sleep_node_1, sleep_node_2, STATE_IDLE, STATE_WAIT_XACK, stateIdle(), and stateWaitXAck().
Referenced by Phy2MacEndRx().

|
protectedvirtual |
Saves the MAC address of another couple of nodes that is the handshake procedure in order to access the channel
References info, NOT_SET, sleep_node_1, sleep_node_2, and STATE_BACKOFF.
Referenced by rxStateBackoff(), rxStateIdle(), and rxStateRecontendWindow().
|
protectedvirtual |
The protocol is in Backoff state. The node hasn't received the ACK packet and the backoff timer is set up for the re-transmission of the DATA packet
References backoff_counter, backoff_duration, backoff_freeze_mode, backoff_pending, backoff_remaining, backoff_start_time, backoff_timer, backoffStartTime(), defer_data, getBackoffTime(), NOT_SET, prev_state, printStateInfo(), refreshState(), STATE_BACKOFF, STATE_WAIT_ACK, STATE_WAIT_CTS, timer, and warning_sent.
Referenced by Phy2MacEndTx(), and rxStateWaitACK().

|
protectedvirtual |
The protocol is in the CTSReceived state
References defer_data, printStateInfo(), refreshState(), STATE_CTS_RECEIVED, stateDeferData(), stateSendData(), and timer.

|
protectedvirtual |
The protocol is in the DataReceived state. a Data Packet is received
| Packet* | pointer to the data packet received |
References ACK_MODE, HDR_size, op_mode, hdr_dacap::orig_type, printStateInfo(), refreshState(), STATE_DATA_RECEIVED, stateIdle(), stateSendAck(), and timer.
Referenced by rxStateSendWarning(), and rxStateWaitData().

|
protectedvirtual |
The protocol is in the DeferData state. The node has received a WRN packet or has received a CTS packet coming from other nodes. The scheduled transmission is deferred
References computeWaitTime(), deferEndTime(), incrTotalDeferTimes(), op_mode, printStateInfo(), refreshState(), session_distance, STATE_DEFER_DATA, and timer.
Referenced by stateCTSReceived().

|
protectedvirtual |
The protocol is in the IDLE state. All variables and timers are resetted
References backoff_counter, curr_dest_addr, defer_data, exitSleep(), last_data_id_tx, last_reason, max_tx_tries, NOT_SET, printStateInfo(), Q, queuePop(), REASON_DATA_PENDING, REASON_MAX_TX_TRIES, refreshState(), session_active, session_distance, STATE_IDLE, stateIdle(), stateSendRTS(), timer, and warning_sent.
Referenced by Phy2MacEndTx(), rxStateWaitACK(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), stateDataReceived(), and stateIdle().

|
protectedvirtual |
The protocol is in RecontendWindow state. In multi-hop scenario after a transmission the node enter in a recontention window before return in IDLE state
References getRecontendTime(), printStateInfo(), refreshState(), STATE_RECONTEND_WINDOW, and timer.
Referenced by Phy2MacEndTx(), and rxStateWaitACK().

|
protectedvirtual |
The protocol is in SendAck state. The node is sending an ACK after the reception of a data packet (if the acknowledgement is active)
References printStateInfo(), refreshState(), STATE_SEND_ACK, timer, and txAck().
Referenced by stateDataReceived().

|
protectedvirtual |
The protocol is in SendCTS state. The node is sending CTS afeter the reception of a RTS packet
References printStateInfo(), refreshState(), STATE_SEND_CTS, timer, and txCts().
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), and rxStateWaitData().

|
protectedvirtual |
The protocol is in the SendData state. The handshaking phase is done. The node transmit his data packet
References defer_data, printStateInfo(), refreshState(), STATE_SEND_DATA, timer, and txData().
Referenced by stateCTSReceived().

|
protectedvirtual |
The protocol is in SendRTS state. A RTS packet is prepared to be transmitted
References curr_data_pkt, printStateInfo(), Q, refreshState(), session_active, STATE_SEND_RTS, timer, and txRts().
Referenced by recvFromUpperLayers(), and stateIdle().

|
protectedvirtual |
The protocol is in the SendWarning state. The node has received a CTS or RTS packet from a third node not involved in the transmission. The node is sending the WRN packet to the sender to warning the possibility of a collision is the transmission is occuring
References ACK_MODE, max_prop_delay, op_mode, printStateInfo(), refreshState(), STATE_SEND_WRN, t_min, T_W_min, timer, and wait_costant.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
The protocol is in the WaitACK state.
References ACK_PKT, computeTxTime(), DATA_PKT, max_prop_delay, printStateInfo(), refreshState(), STATE_WAIT_ACK, timer, and wait_costant.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
The protocol is in the WaitCTS state. The node has just sent a RTS packet and now he's waiting for the answer with a CTS packet
References computeTxTime(), CTS_PKT, max_prop_delay, printStateInfo(), refreshState(), RTS_PKT, STATE_WAIT_CTS, timer, and wait_costant.
Referenced by Phy2MacEndTx().

|
protectedvirtual |
The protocol is in the WaitData state. The exchanging of RTS/CTS packets is done. Now the node is waiting for the data packet
References computeTxTime(), computeWaitTime(), DATA_PKT, max_prop_delay, op_mode, printStateInfo(), refreshState(), STATE_WAIT_DATA, timer, and wait_costant.

|
protectedvirtual |
The protocol is in WaitWarning state. The node has received a CTS or RTS packet from a third node not involved in the transmission. The node is waiting the WRN packet from the receiver
References ACK_MODE, computeTxTime(), max_prop_delay, op_mode, printStateInfo(), refreshState(), STATE_WAIT_WRN, t_min, T_W_min, timer, wait_costant, and WRN_PKT.
Referenced by rxStateWaitCTS().

|
protectedvirtual |
The protocol is in WaitXAck state. The node has received a data packet coming from a third node that is not involved in the transmission. Now the node is waiting for the ACK packet coming from the destinatay of the data packet (if the acknowledgement is active)
References ACK_PKT, computeTxTime(), max_prop_delay, printStateInfo(), refreshState(), STATE_WAIT_XACK, and timer.
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateWaitXCts(), rxStateWaitXData(), and rxStateWaitXWarning().

|
protectedvirtual |
The protocol is in WaitXCts state. The node has received a RTS packet coming from a third node that is not involved in the transmission. Now the node is waiting for the CTS coming from the node destinatary of the RTS
References computeTxTime(), CTS_PKT, max_prop_delay, printStateInfo(), refreshState(), STATE_WAIT_XCTS, and timer.
Referenced by rxStateBackoff(), rxStateIdle(), and rxStateRecontendWindow().

|
protectedvirtual |
The protocol is in WaitXData state. The node has received a CTS packet coming from a third node that is not involved in the transmission. Now the node is waiting for the data packet coming from the node destinatary of the CTS
References computeTxTime(), computeWaitTime(), DATA_PKT, max_prop_delay, op_mode, printStateInfo(), refreshState(), STATE_WAIT_XDATA, and timer.

|
protectedvirtual |
The protocol is in WaitXWarning state. The node is waiting for a Warning coming from a third node not involved in the transmission
References ACK_MODE, computeTxTime(), max_prop_delay, op_mode, printStateInfo(), refreshState(), RTS_PKT, STATE_WAIT_XWRN, t_min, T_W_min, timer, wait_costant, and WRN_PKT.
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), and rxStateWaitXCts().

|
protectedvirtual |
Pass an ACK packet to transmit to the PHY layer
References ACK_PKT, initPkt(), and TxActive.
Referenced by stateSendAck().

|
protectedvirtual |
Pass a CTS packet to transmit to the PHY layer
References CTS_PKT, incrCtsPktsTx(), initPkt(), and TxActive.
Referenced by stateSendCTS().

|
protectedvirtual |
Pass a DATA packet to transmit to the PHYl layer
References NO_ACK_MODE, op_mode, Q, queuePop(), and TxActive.
Referenced by stateSendData().

|
protectedvirtual |
Pass a RTS packet to transmit to the PHY layer
References curr_data_pkt, curr_dest_addr, incrRtsPktsTx(), initPkt(), RTS_PKT, start_tx_time, and TxActive.
Referenced by stateSendRTS().

|
protectedvirtual |
Pass a WRN packet to transmit to the PHY layer
References incrWrnPktsTx(), initPkt(), TxActive, warning_sent, and WRN_PKT.
Referenced by rxStateSendWarning().

|
inlineprotectedvirtual |
Used for debug purposes. (Permit to have a "step by step" behaviour of the protocol)
Referenced by rxStateSendWarning().
|
friend |
DACAP Backoff timer
|
friend |
DACAP ACK timer
|
protected |
Size (in bytes) of the ACK packet
Referenced by computeTxTime(), and MMacDACAP().
|
protected |
smoothing factor used for statistics using first order IIR filter
Referenced by MMacDACAP().
|
protected |
Number of times a backoff timer is set up
Referenced by getBackoffTime(), printStateInfo(), stateBackoff(), and stateIdle().
|
protected |
Backoff duration
Referenced by exitBackoff(), freezeBackoff(), and stateBackoff().
|
protected |
Timestamp at which the backoff timer is started for the first time (if the timer has been freezed many times
Referenced by backoffEndTime(), backoffStartTime(), and exitBackoff().
|
protected |
true if the backoff-timer is freezed
Referenced by command(), exitBackoff(), rxStateBackoff(), and stateBackoff().
|
protected |
true if the backoff-timer is active (i.e. there's a backoff process)
Referenced by exitBackoff(), freezeBackoff(), Phy2MacEndTx(), rxStateWaitACK(), and stateBackoff().
|
protected |
Backoff time remaining (if the timer is freezed)
Referenced by exitBackoff(), freezeBackoff(), and stateBackoff().
|
protected |
Backoff starting time
Referenced by exitBackoff(), freezeBackoff(), and stateBackoff().
|
protected |
backoff timer
Referenced by exitBackoff(), and stateBackoff().
|
protected |
Multiplicative factor in the calculation of backoff
Referenced by getBackoffTime(), and MMacDACAP().
|
protected |
Dimension (in packets) of the buffer queue
Referenced by MMacDACAP(), and recvFromUpperLayers().
|
protected |
Counter of CTS packets RX
Referenced by getCtsPktsRx(), and incrCtsPktsRx().
|
protected |
Counter of CTS packets TX
Referenced by getCtsPktsTx(), and incrCtsPktsTx().
|
protected |
Size (in bytes) of the CTS packet
Referenced by computeTxTime(), initPkt(), and MMacDACAP().
|
protected |
Pointer to the current data packet
Referenced by initPkt(), stateSendRTS(), and txRts().
|
protected |
MAC address of the current node involved in this session
Referenced by initPkt(), rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitACK(), rxStateWaitCTS(), rxStateWaitData(), rxStateWaitWarning(), stateIdle(), and txRts().
|
protected |
Current state of the protocol
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), recvFromUpperLayers(), refreshState(), and rxStateSendWarning().
|
protected |
true if a node has to defer the transmission of a data packet
Referenced by rxStateWaitCTS(), rxStateWaitWarning(), stateBackoff(), stateCTSReceived(), stateIdle(), and stateSendData().
|
protected |
Counter of defer times
Referenced by getMeanDeferTime(), getTotalDeferTimes(), incrTotalDeferTimes(), and resetStats().
|
protected |
Value (in m) that indicates how far we want the CTS propagates over the sender before initiate the data transmission process (it determines the T_w value)
Referenced by computeWaitTime(), and MMacDACAP().
|
protected |
Dimension difference (in bytes) among data packets ( 0 if the packets have always the same dimension)
Referenced by computeWaitTime(), and MMacDACAP().
|
protected |
Object that handle the file where the state transitions is written (if the print_transitions option is active)
Referenced by command(), and printStateInfo().
|
protected |
true if the node has a buffer queue to store data packets
Referenced by MMacDACAP(), and recvFromUpperLayers().
|
protected |
Size (in bytes) of the header added by DACAP
Referenced by computeTxTime(), initPkt(), MMacDACAP(), and stateDataReceived().
|
staticprotected |
Relationship between the state and its textual description
Referenced by initInfo(), MMacDACAP(), Phy2MacEndRx(), Phy2MacEndTx(), printStateInfo(), rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitACK(), rxStateWaitCTS(), rxStateWaitData(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), and setBackoffNodes().
|
protected |
Unique ID of the last data packet received
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), and rxStateWaitData().
|
protected |
Unique ID of the last data packet transmitted
Referenced by stateIdle().
|
protected |
last reason for the change of state
Referenced by Phy2MacEndTx(), printStateInfo(), recvFromUpperLayers(), rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitACK(), rxStateWaitCTS(), rxStateWaitData(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), and stateIdle().
|
protected |
Number of times a backoff is calculated
Referenced by getBackoffTime(), and MMacDACAP().
|
protected |
Dimension of the maximum allowed data paylaod in bytes
Referenced by computeTxTime(), and MMacDACAP().
|
protected |
One way maximum propagation delay (in seconds) in the network
Referenced by computeWaitTime(), getBackoffTime(), getRecontendTime(), MMacDACAP(), rxStateSendWarning(), rxStateWaitCTS(), rxStateWaitWarning(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), stateWaitXAck(), stateWaitXCts(), stateWaitXData(), and stateWaitXWarning().
|
protected |
Maximum transmission tries for one packet before discarding the packet
Referenced by MMacDACAP(), and stateIdle().
|
protected |
true if the multihop mode is active to simulate a multihop scenario with routing
Referenced by command(), Phy2MacEndTx(), and rxStateWaitACK().
|
protected |
Indicates if the ACK_mode or no_ACK_mode is activated
Referenced by command(), Phy2MacEndTx(), rxStateSendWarning(), rxStateWaitCTS(), rxStateWaitWarning(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), stateDataReceived(), stateDeferData(), stateSendWarning(), stateWaitData(), stateWaitWarning(), stateWaitXData(), stateWaitXWarning(), and txData().
|
protected |
Previous state of the protocol
Referenced by printStateInfo(), refreshState(), and stateBackoff().
|
protected |
true if the state-transitions of the protocol is printed on a file
Referenced by command(), initInfo(), and printStateInfo().
|
protected |
MAC queue used for packet scheduling
Referenced by computeTxTime(), getQueueSize(), getRemainingPkts(), Phy2MacEndTx(), queuePop(), recvFromUpperLayers(), rxStateWaitACK(), stateIdle(), stateSendRTS(), and txData().
|
protected |
Counter of RTS packets RX
Referenced by getRtsPktsRx(), and incrRtsPktsRx().
|
protected |
Counter of RTS packets TX
Referenced by getRtsPktsTx(), and incrRtsPktsTx().
|
protected |
Timestamp at which the RTS packet is sent
|
protected |
Size (in bytes) of the RTS packet
Referenced by computeTxTime(), initPkt(), and MMacDACAP().
|
protected |
num of RTT samples
|
protected |
true if a reception process is occuring
Referenced by Phy2MacStartRx(), recvFromUpperLayers(), rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitACK(), rxStateWaitCTS(), rxStateWaitData(), rxStateWaitWarning(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), and rxStateWaitXWarning().
|
protected |
true if a session is active (i.e. an hand-shaking process is occurring
Referenced by recvFromUpperLayers(), rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitData(), stateIdle(), and stateSendRTS().
|
protected |
Distance between sender and receiver in the current session
Referenced by rxStateBackoff(), rxStateIdle(), rxStateRecontendWindow(), rxStateSendWarning(), rxStateWaitCTS(), rxStateWaitData(), stateDeferData(), and stateIdle().
|
protected |
MAC address of sleep_node 1
Referenced by exitSleep(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), and setBackoffNodes().
|
protected |
MAC address of sleep_node 2
Referenced by exitSleep(), rxStateWaitXAck(), rxStateWaitXCts(), rxStateWaitXData(), rxStateWaitXWarning(), and setBackoffNodes().
|
protected |
Smoothed Round Trip Time, calculated as for TCP
|
protected |
Timestamp at which a packet is transmitted
Referenced by txRts().
|
protected |
Sum of the defer timers
Referenced by deferEndTime(), and getMeanDeferTime().
|
protected |
sum of RTT samples
|
protected |
sum of (RTT^2)
|
protected |
Minimum time needed to do an hand-shaking
Referenced by computeWaitTime(), MMacDACAP(), rxStateSendWarning(), rxStateWaitCTS(), rxStateWaitWarning(), stateSendWarning(), stateWaitWarning(), and stateWaitXWarning().
|
protected |
Minimum Warning Time in sencods
Referenced by computeWaitTime(), MMacDACAP(), rxStateSendWarning(), rxStateWaitCTS(), rxStateWaitWarning(), stateSendWarning(), stateWaitWarning(), and stateWaitXWarning().
|
protected |
ACK timer
Referenced by exitBackoff(), freezeBackoff(), stateBackoff(), stateCTSReceived(), stateDataReceived(), stateDeferData(), stateIdle(), stateRecontendWindow(), stateSendAck(), stateSendCTS(), stateSendData(), stateSendRTS(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), stateWaitXAck(), stateWaitXCts(), stateWaitXData(), and stateWaitXWarning().
|
protected |
|
protected |
serial number of the DATA packet transmitted
Referenced by initPkt().
|
protected |
simulation-unique DATA packet ID
Referenced by initPkt().
|
staticprotected |
simulation-unique packet ID
Referenced by initPkt(), and MMacDACAP().
|
protected |
Additive factor in the calculation of ACK timer
Referenced by getRecontendTime(), MMacDACAP(), stateSendWarning(), stateWaitACK(), stateWaitCTS(), stateWaitData(), stateWaitWarning(), and stateWaitXWarning().
|
protected |
true if a WRN packet has been just sent
Referenced by stateBackoff(), stateIdle(), and txWrn().
|
protected |
Counter of WRN packets RX
Referenced by getWrnPktsRx(), incrWrnPktsRx(), and resetStats().
|
protected |
Counter of WRN packets TX
Referenced by getWrnPktsTx(), incrWrnPktsTx(), and resetStats().
|
protected |
Size (in bytes) of the WRN packet
Referenced by computeTxTime(), initPkt(), and MMacDACAP().