#include <uw-mac-TLohi.h>
Class that represents the T-LOHI MAC protocol for a node.
Definition at line 239 of file uw-mac-TLohi.h.
◆ MMacTLOHI()
◆ ~MMacTLOHI()
MMacTLOHI::~MMacTLOHI |
( |
| ) |
|
|
virtual |
◆ checkDataPhy()
void MMacTLOHI::checkDataPhy |
( |
| ) |
|
|
protectedvirtual |
Checks if the PHY layer for Data is active.
If not, actives it for a fixed amout of time
Definition at line 1122 of file uw-mac-TLohi.cpp.
◆ checkPhyInit()
void MMacTLOHI::checkPhyInit |
( |
| ) |
|
|
protectedvirtual |
Checks if the PHY layers (for DATA and TONE) are initialized.
Definition at line 405 of file uw-mac-TLohi.cpp.
◆ command()
int MMacTLOHI::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 successfully or not.
Definition at line 285 of file uw-mac-TLohi.cpp.
◆ computeTxTime()
Computes the Transmission Time of a Packet using a CrLayer Message to ask the PHY to perform this calculation.
- Parameters
-
TLOHI_PKT_TYPE | type of the packet |
Definition at line 565 of file uw-mac-TLohi.cpp.
◆ countContenders()
int MMacTLOHI::countContenders |
( |
double |
time | ) |
|
|
protectedvirtual |
Returns the number of Contenders in this Contention Round based on the number of tones received.
- Parameters
-
double | time interval at which count the contenders |
- Returns
- the number of contenders
Definition at line 710 of file uw-mac-TLohi.cpp.
◆ crLayCommand()
int MMacTLOHI::crLayCommand |
( |
ClMessage * |
m | ) |
|
|
virtual |
Cross-Layer messages interpreter.
- Parameters
-
ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
Definition at line 391 of file uw-mac-TLohi.cpp.
◆ exitBackoff()
void MMacTLOHI::exitBackoff |
( |
| ) |
|
|
protectedvirtual |
Reset the timer for Backoff (i.e.
after the reception of an ACK packet
Definition at line 600 of file uw-mac-TLohi.cpp.
◆ getBackoffTime()
void MMacTLOHI::getBackoffTime |
( |
| ) |
|
|
protectedvirtual |
Performs the calculation of the Backoff timer.
Definition at line 610 of file uw-mac-TLohi.cpp.
◆ getCRduration()
virtual double MMacTLOHI::getCRduration |
( |
| ) |
|
|
inlineprotectedvirtual |
Returns the duration of the Contention Round, where the nodes contend the channel.
- Returns
- CR_duration
Definition at line 327 of file uw-mac-TLohi.h.
◆ getRemainingPkts()
virtual int MMacTLOHI::getRemainingPkts |
( |
| ) |
|
|
inlineprotectedvirtual |
returns the number of Packet remained in the queue at the end of the simulation
- Returns
- number of packet remained in the queue
Definition at line 565 of file uw-mac-TLohi.h.
◆ getTonePktsRx()
virtual int MMacTLOHI::getTonePktsRx |
( |
| ) |
|
|
inlineprotectedvirtual |
returns the number of tones received in the simulation
- Returns
- number of tones received
Definition at line 583 of file uw-mac-TLohi.h.
◆ getTonePktsTx()
virtual int MMacTLOHI::getTonePktsTx |
( |
| ) |
|
|
inlineprotectedvirtual |
returns the number of tones transmitted in the simulation
- Returns
- number of tones transmitted
Definition at line 574 of file uw-mac-TLohi.h.
◆ getUpLayersDataPktsRx()
virtual int MMacTLOHI::getUpLayersDataPktsRx |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ incrCurrTxRounds()
virtual void MMacTLOHI::incrCurrTxRounds |
( |
| ) |
|
|
inlineprotectedvirtual |
Increments the number of times a packet has been transmitted.
Definition at line 497 of file uw-mac-TLohi.h.
◆ incrCurrTxTries()
virtual void MMacTLOHI::incrCurrTxTries |
( |
| ) |
|
|
inlineprotectedvirtual |
Increments the number of tries for the transmission of a packet.
Definition at line 545 of file uw-mac-TLohi.h.
◆ incrTonePktsRx()
virtual void MMacTLOHI::incrTonePktsRx |
( |
| ) |
|
|
inlineprotectedvirtual |
Increments the number of the TONE received.
Definition at line 537 of file uw-mac-TLohi.h.
◆ incrTonePktsTx()
virtual void MMacTLOHI::incrTonePktsTx |
( |
| ) |
|
|
inlineprotectedvirtual |
Increments the number of the TONE sended.
Definition at line 529 of file uw-mac-TLohi.h.
◆ initData()
void MMacTLOHI::initData |
( |
| ) |
|
|
protectedvirtual |
Initializes the information of the protocol related to the data PHY layers (i.e.
the duration of the timers, the length of the buffers for data packets)
Definition at line 416 of file uw-mac-TLohi.cpp.
◆ initInfo()
void MMacTLOHI::initInfo |
( |
| ) |
|
|
protectedvirtual |
Initializes the map between the protocol states and the textual description of these states.
Definition at line 449 of file uw-mac-TLohi.cpp.
◆ initMphyIds()
void MMacTLOHI::initMphyIds |
( |
| ) |
|
|
protectedvirtual |
Initializes the ID of the PHY layer for tone and Data.
Definition at line 504 of file uw-mac-TLohi.cpp.
◆ initPkt()
Init the packet with the MAC address of the receiver and the sender, the size of the packet and the type.
- Parameters
-
UWPOLLING_PKT_TYPE | the type of the packet |
Definition at line 665 of file uw-mac-TLohi.cpp.
◆ Phy2MacEndRx()
void MMacTLOHI::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
- Parameters
-
const | Packet* Pointer to an object of type Packet that rapresent the packet received |
Definition at line 841 of file uw-mac-TLohi.cpp.
◆ Phy2MacEndTx()
void MMacTLOHI::Phy2MacEndTx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the PHY layer finish to transmit the packet.
- Parameters
-
Packet* | Pointer to an object of type Packet that rapresent the Packet transmitted |
Definition at line 737 of file uw-mac-TLohi.cpp.
◆ Phy2MacStartRx()
void MMacTLOHI::Phy2MacStartRx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer start to receive a Packet.
- Parameters
-
const | Packet* Pointer to an object of type Packet that rapresent the Packet that is in reception |
Definition at line 818 of file uw-mac-TLohi.cpp.
◆ printStateInfo()
void MMacTLOHI::printStateInfo |
( |
double |
delay = 0 | ) |
|
|
protectedvirtual |
Initializes the protocol at the beginning of the simulation.
This method is called by a command in tcl.
- Parameters
-
- See also
- command method
Definition at line 1365 of file uw-mac-TLohi.cpp.
◆ queuePop()
virtual void MMacTLOHI::queuePop |
( |
bool |
flag | ) |
|
|
inlineprotectedvirtual |
Pop the first element of the data packets queue.
Definition at line 511 of file uw-mac-TLohi.h.
◆ recvFromUpperLayers()
void MMacTLOHI::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Receives the packet from the upper layer (e.g.
IP)
- Parameters
-
Packet* | pointer to the packet received |
Definition at line 632 of file uw-mac-TLohi.cpp.
◆ refreshReason()
Refresh the reason for the change of state of the protocol.
Definition at line 465 of file uw-mac-TLohi.h.
◆ refreshState()
◆ resetSession()
void MMacTLOHI::resetSession |
( |
| ) |
|
|
protectedvirtual |
Resets the variable related to the Session (i.e.
the distance between transmitter and receiver, the MAC address of the destination
Definition at line 556 of file uw-mac-TLohi.cpp.
◆ resetStats()
virtual void MMacTLOHI::resetStats |
( |
| ) |
|
|
inlineprotectedvirtual |
Resets the variables related to the Statiscal computation.
Definition at line 553 of file uw-mac-TLohi.h.
◆ rxAck()
void MMacTLOHI::rxAck |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method that receive an ACK packet.
- Parameters
-
Packet* | pointer to the ACK packet received |
Definition at line 1069 of file uw-mac-TLohi.cpp.
◆ rxElse()
void MMacTLOHI::rxElse |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Receives other types of packets.
- Parameters
-
Packet* | pointer to packet received |
Definition at line 1074 of file uw-mac-TLohi.cpp.
◆ rxTone()
void MMacTLOHI::rxTone |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method that receives a Tone.
- Parameters
-
Packet* | pointer to the tone received |
Definition at line 984 of file uw-mac-TLohi.cpp.
◆ setDestAddr()
virtual void MMacTLOHI::setDestAddr |
( |
int |
mac_addr | ) |
|
|
inlineprotectedvirtual |
Store the MAC address of the destination for this session.
Definition at line 477 of file uw-mac-TLohi.h.
◆ setSessionDistance()
virtual void MMacTLOHI::setSessionDistance |
( |
double |
distance | ) |
|
|
inlineprotectedvirtual |
Set the distance between transmitter and receiver for this session.
Definition at line 485 of file uw-mac-TLohi.h.
◆ stateBackoff()
void MMacTLOHI::stateBackoff |
( |
| ) |
|
|
protectedvirtual |
◆ stateCountContenders()
void MMacTLOHI::stateCountContenders |
( |
| ) |
|
|
protectedvirtual |
◆ stateDataReceived()
void MMacTLOHI::stateDataReceived |
( |
Packet * |
data_pkt | ) |
|
|
protectedvirtual |
◆ stateIdle()
void MMacTLOHI::stateIdle |
( |
| ) |
|
|
protectedvirtual |
◆ stateRecontendWindow()
void MMacTLOHI::stateRecontendWindow |
( |
| ) |
|
|
protectedvirtual |
◆ stateSleep()
void MMacTLOHI::stateSleep |
( |
| ) |
|
|
protectedvirtual |
Simulate the sleep modality of the PHY layer of the node, while the node is waiting for the DATA.
Definition at line 1250 of file uw-mac-TLohi.cpp.
◆ stateStartContention()
void MMacTLOHI::stateStartContention |
( |
| ) |
|
|
protectedvirtual |
◆ stateTxAck()
void MMacTLOHI::stateTxAck |
( |
| ) |
|
|
protectedvirtual |
The node transmit the ACK packet for a received DATA packet (in ACK_MODE modality)
Definition at line 1301 of file uw-mac-TLohi.cpp.
◆ stateTxData()
void MMacTLOHI::stateTxData |
( |
| ) |
|
|
protectedvirtual |
The node has won the CR.
He can now sends a DATA packet
Definition at line 1260 of file uw-mac-TLohi.cpp.
◆ stateWaitAck()
void MMacTLOHI::stateWaitAck |
( |
| ) |
|
|
protectedvirtual |
The node has just sent a DATA packet.
Now he's waiting for the ACK (in ACK_MODE modality)
Definition at line 1274 of file uw-mac-TLohi.cpp.
◆ stateWaitCR()
void MMacTLOHI::stateWaitCR |
( |
| ) |
|
|
protectedvirtual |
Set the duration of the timer of the duration of the Contention Round.
Definition at line 1239 of file uw-mac-TLohi.cpp.
◆ stateWaitEndContention()
void MMacTLOHI::stateWaitEndContention |
( |
| ) |
|
|
protectedvirtual |
The nodes waits the end of Contention listening the channel for possible contenders.
Definition at line 1205 of file uw-mac-TLohi.cpp.
◆ stateWaitXAck()
void MMacTLOHI::stateWaitXAck |
( |
| ) |
|
|
protectedvirtual |
The node has just received a DATA packet intended for another node.
Now he's waiting for the ACK from the receiver of the DATA packet (in ACK_MODE modality)
Definition at line 1287 of file uw-mac-TLohi.cpp.
◆ txAck()
void MMacTLOHI::txAck |
( |
| ) |
|
|
protectedvirtual |
◆ txData()
void MMacTLOHI::txData |
( |
| ) |
|
|
protectedvirtual |
◆ txTone()
void MMacTLOHI::txTone |
( |
| ) |
|
|
protectedvirtual |
◆ waitForUser()
void MMacTLOHI::waitForUser |
( |
| ) |
|
|
protectedvirtual |
Used for debug purposes (permits a step-by-step behaviour of the protocol.
Definition at line 1390 of file uw-mac-TLohi.cpp.
◆ DataTimer
◆ Timer
◆ ack_mode
◆ ACK_size
◆ ACK_timeout
double MMacTLOHI::ACK_timeout |
|
protected |
Time needed for the reception of a ACK packet.
Definition at line 614 of file uw-mac-TLohi.h.
◆ backoff_duration
double MMacTLOHI::backoff_duration |
|
protected |
◆ backoff_pending
bool MMacTLOHI::backoff_pending |
|
protected |
Flag that indicates if a backoff timer is pending.
Definition at line 624 of file uw-mac-TLohi.h.
◆ backoff_remaining
double MMacTLOHI::backoff_remaining |
|
protected |
Remaining time of the backoff (if the timer has been freezed)
Definition at line 664 of file uw-mac-TLohi.h.
◆ backoff_start_time
double MMacTLOHI::backoff_start_time |
|
protected |
◆ backoff_tuner
double MMacTLOHI::backoff_tuner |
|
protected |
Multiplier factor in the calculation of the backoff.
Definition at line 605 of file uw-mac-TLohi.h.
◆ buffer_pkts
int MMacTLOHI::buffer_pkts |
|
protected |
◆ CR_duration
double MMacTLOHI::CR_duration |
|
protected |
◆ curr_contenders
int MMacTLOHI::curr_contenders |
|
protected |
Number of contenders in current Contention Round.
Definition at line 649 of file uw-mac-TLohi.h.
◆ curr_data_pkt
Packet* MMacTLOHI::curr_data_pkt |
|
protected |
◆ curr_dest_addr
int MMacTLOHI::curr_dest_addr |
|
protected |
◆ curr_state
◆ curr_tx_rounds
int MMacTLOHI::curr_tx_rounds |
|
protected |
◆ curr_tx_tries
int MMacTLOHI::curr_tx_tries |
|
protected |
◆ DATA_listen_timeout
double MMacTLOHI::DATA_listen_timeout |
|
protected |
Time needed for the reception of a DATA packet.
Definition at line 612 of file uw-mac-TLohi.h.
◆ data_phy_id
int MMacTLOHI::data_phy_id |
|
protected |
◆ data_phy_timer
Timer that describe the time needed to receive the packet (i.e.
the data PHY layer wake up for the duration of the reception, then go to sleep again
Definition at line 675 of file uw-mac-TLohi.h.
◆ fout
Object that handle the output file for the state transition of the protocol.
Definition at line 691 of file uw-mac-TLohi.h.
◆ has_buffer_queue
bool MMacTLOHI::has_buffer_queue |
|
protected |
Flag that indicates whether the node has a buffer queue.
Definition at line 635 of file uw-mac-TLohi.h.
◆ HDR_size
Dimension of the header added by T-LOHI in bytes.
Definition at line 609 of file uw-mac-TLohi.h.
◆ initialized
bool MMacTLOHI::initialized = false |
|
staticprotected |
Flag that indicates if the protocol is initialized.
Definition at line 631 of file uw-mac-TLohi.h.
◆ last_data_id_rx
int MMacTLOHI::last_data_id_rx |
|
protected |
◆ last_data_id_tx
int MMacTLOHI::last_data_id_tx |
|
protected |
◆ last_reason
Last reason for state transition of the protocol.
Definition at line 654 of file uw-mac-TLohi.h.
◆ max_payload
int MMacTLOHI::max_payload |
|
protected |
Maximum Data payload dimension in number of bytes.
Definition at line 608 of file uw-mac-TLohi.h.
◆ max_prop_delay
double MMacTLOHI::max_prop_delay |
|
protected |
Maximum propagation delay in the network.
Definition at line 602 of file uw-mac-TLohi.h.
◆ max_tx_rounds
int MMacTLOHI::max_tx_rounds |
|
protected |
Maximum transmission round for one packet.
Definition at line 603 of file uw-mac-TLohi.h.
◆ max_tx_tries
double MMacTLOHI::max_tx_tries |
|
protected |
Maximum transmission tries for one packet.
Definition at line 604 of file uw-mac-TLohi.h.
◆ mphy_ids_initialized
bool MMacTLOHI::mphy_ids_initialized |
|
protected |
Flag that indicates if the IDs of the PHY layers is stored.
Definition at line 633 of file uw-mac-TLohi.h.
◆ op_mode
◆ pkt_type_info
Map between the pkt-type and the description of the packet.
Definition at line 686 of file uw-mac-TLohi.h.
◆ prev_state
◆ print_transitions
bool MMacTLOHI::print_transitions |
|
protected |
Flat that indicates if the modality in which the protocol write in a file the state transitions is active.
Definition at line 628 of file uw-mac-TLohi.h.
queue<Packet *> MMacTLOHI::Q |
|
protected |
◆ reason_info
Map between the reason for state transitions and the description of this reason.
Definition at line 684 of file uw-mac-TLohi.h.
◆ recontend_time
double MMacTLOHI::recontend_time |
|
protected |
◆ session_active
bool MMacTLOHI::session_active |
|
protected |
Flag that indicates if a Session is active.
Definition at line 622 of file uw-mac-TLohi.h.
◆ session_distance
double MMacTLOHI::session_distance |
|
protected |
Distance between transmitter and receiver in this session.
Definition at line 659 of file uw-mac-TLohi.h.
◆ sleep_timeout
double MMacTLOHI::sleep_timeout |
|
protected |
Duration of the sleep phase for the PHY layer.
Definition at line 611 of file uw-mac-TLohi.h.
◆ status_info
Map between the state and the textual description of the state.
Definition at line 681 of file uw-mac-TLohi.h.
◆ tcl_modulation
string MMacTLOHI::tcl_modulation |
|
protected |
Type of modulation adopted for data PHY layer.
Definition at line 671 of file uw-mac-TLohi.h.
◆ timer
◆ tone_data_delay
double MMacTLOHI::tone_data_delay |
|
protected |
◆ tone_phy_id
int MMacTLOHI::tone_phy_id |
|
protected |
◆ tone_pkts_rx
int MMacTLOHI::tone_pkts_rx |
|
protected |
◆ tone_pkts_tx
int MMacTLOHI::tone_pkts_tx |
|
protected |
◆ tone_transmitted
bool MMacTLOHI::tone_transmitted |
|
protected |
Flag that indicates if a tone has been transmitted.
Definition at line 626 of file uw-mac-TLohi.h.
◆ TxActive
Flag that indicates if a transmission is occuring.
Definition at line 621 of file uw-mac-TLohi.h.
◆ txsn
◆ u_data_id
◆ u_pkt_id
◆ wait_costant
double MMacTLOHI::wait_costant |
|
protected |
Additive factor in the calculation of ACK timer.
Definition at line 607 of file uw-mac-TLohi.h.
The documentation for this class was generated from the following files: