DESERT 4.0.0
uwpolling_AUV.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
38#ifndef UWPOLLING_HDR_AUV_H
39#define UWPOLLING_HDR_AUV_H
40
41#include "uwpolling_cmn_hdr.h"
42
43#include "uwsmposition.h"
44#include <chrono>
45#include <clmessage.h>
46#include <fstream>
47#include <iostream>
48#include <map>
49#include <mmac.h>
50#include <mphy.h>
51#include <ostream>
52#include <queue>
53#include <set>
54#include <string>
55
56#define UWPOLLING_AUV_DROP_REASON_ERROR "DERR"
57#define UWPOLLING_AUV_DROP_REASON_UNKNOWN_TYPE \
58 "DUT"
59#define UWPOLLING_AUV_DROP_REASON_WRONG_RECEIVER \
60 "DWR"
61#define UWPOLLING_AUV_DROP_REASON_WRONG_STATE \
62 "DWS"
63#define UWPOLLING_AUV_DROP_REASON_BUFFER_FULL "ADBF"
64
65#define ENTRY_MAX_SIZE 256
66
71typedef struct probe_cicle_counters {
79 inline void
88 inline void
90 {
93 }
97 inline uint
102};
103
108typedef struct probbed_node {
109 uint id_node;
110 int n_pkts;
113 double time_stamp;
115 // double backoff_time; /**< Backoff time chosen by the node before
116 // transmitting the PROBE */
117 double Tmeasured;
119 bool is_sink_;
121 uint16_t id_ack;
130 inline double &
132 {
133 return (time_stamp);
134 }
135
139 inline uint &
141 {
142 return (id_node);
143 }
144
148 inline int &
150 {
151 return (n_pkts);
152 }
153
157 inline int &
159 {
160 return (mac_address);
161 }
162
166 inline bool &
168 {
169 return is_sink_;
170 }
171
175 inline uint16_t &
177 {
178 return id_ack;
179 }
180
184 inline double &
186 {
187 return policy_weight;
188 }
189
191
195class Uwpolling_AUV : public MMac
196{
197public:
205 virtual ~Uwpolling_AUV();
206
217 virtual int command(int argc, const char *const *argv);
225 virtual int crLayCommand(ClMessage *m);
226
227protected:
228 /***********************************
229 | Internal variable and functions |
230 ***********************************/
231
245
259
267
275
279 class Uwpolling_AUV_Timer : public TimerHandler
280 {
281 public:
287 : TimerHandler()
288 , start_time(0.0)
289 , left_duration(0.0)
290 , counter(0)
291 , module(m)
293 {
294 assert(m != NULL);
295 }
296
301 {
302 }
303
307 virtual void
309 {
311 left_duration -= (NOW - start_time);
312 if (left_duration <= 0.0) {
313 left_duration = module->mac2phy_delay_;
314 }
315 force_cancel();
317 }
318
323 virtual void
325 {
327 start_time = NOW;
328 assert(left_duration > 0);
329 sched(left_duration);
331 }
332
336 virtual void
338 {
340 force_cancel();
341 }
342
347 virtual void
348 schedule(double val)
349 {
350 start_time = NOW;
351 left_duration = val;
353 resched(val);
354 }
355
360 bool
362 {
363 return (timer_status == UWPOLLING_IDLE);
364 }
365
370 bool
372 {
374 }
375
380 bool
382 {
384 }
385
390 bool
392 {
393 return (timer_status == UWPOLLING_FROZEN);
394 }
395
400 bool
402 {
403 return (timer_status == UWPOLLING_FROZEN ||
405 }
406
410 void
412 {
413 counter = 0;
414 }
415
419 void
421 {
422 ++counter;
423 }
424
429 int
431 {
432 return counter;
433 }
434
439 double
441 {
442 return left_duration;
443 }
444
445 protected:
446 double start_time;
450 *module;
452 };
453
464 {
465 public:
474
478 virtual ~DataTimer()
479 {
480 }
481
482 protected:
487 virtual void expire(Event *e);
488 };
489
497 {
498 public:
506
511 virtual ~ProbeTimer()
512 {
513 }
514
515 protected:
520 virtual void expire(Event *e);
521 };
522
524 {
525 public:
533
538 virtual ~PollTimer()
539 {
540 }
541
542 protected:
547 virtual void expire(Event *e);
548 };
549
551 {
552 public:
560
565 virtual ~AckTimer()
566 {
567 }
568
569 protected:
574 virtual void expire(Event *e);
575 };
576
580 double getMaxBackoffTime();
581
592 virtual double linearInterpolator(
593 double x, double x1, double x2, double y1, double y2);
594
600 virtual void Mac2PhyStartTx(Packet *p);
601
607 virtual void Phy2MacEndTx(const Packet *p);
613 virtual void Phy2MacStartRx(const Packet *p);
619 virtual void Phy2MacEndRx(Packet *p);
620
626 inline void
628 {
629 n_trigger_tx++;
630 }
631
636 inline void
638 {
639 n_probe_rx++;
640 }
641
646 inline void
648 {
649 n_ack_rx++;
650 }
651
658 inline void
663
668 inline void
673
678 inline void
683
690 inline void
695
699 inline void
701 {
702 n_poll_tx++;
703 }
704
709 inline int
711 {
712 return n_trigger_tx;
713 }
714
719 inline int
721 {
722 return n_probe_rx;
723 }
724
729 inline int
731 {
732 return n_ack_rx;
733 }
734
740 inline int
745
750 inline int
752 {
753 return n_poll_tx;
754 }
755
760 inline int
762 {
764 }
765
770 inline int
772 {
773 return n_dropped_ack_pkts;
774 }
775
783 inline int
788
793 virtual void
798
803 virtual void
805 {
807 curr_state = state;
808 }
813 virtual void stateRxProbe();
817 virtual void stateRxData();
821 virtual void stateWaitProbe();
825 virtual void stateWaitData();
829 virtual void stateIdle();
833 virtual void stateTxTrigger();
837 virtual void stateTxPoll();
838
842 virtual void DataTOExpired();
846 virtual void ProbeTOExpired();
851 // virtual void printStateInfo(double delay = 0);
859 virtual void initInfo();
863 virtual void TxTrigger();
867 virtual void TxPoll();
873 virtual void SortNode2Poll();
878 virtual void ChangeNodePolled();
885 virtual double GetDataTimerValue();
893 virtual void computeTxTime(UWPOLLING_PKT_TYPE pkt);
899 virtual void UpdateRTT();
905 virtual void stop_count_time();
906
912 inline double
914 {
915 return total_time;
916 }
921 virtual void waitForUser();
926 inline unsigned long int
928 {
929 unsigned long int timestamp =
930 (unsigned long int) (std::chrono::duration_cast<
931 std::chrono::milliseconds>(
932 std::chrono::system_clock::now().time_since_epoch())
933 .count());
934 return timestamp;
935 }
936
942 virtual void recvFromUpperLayers(Packet *p);
943
948 virtual void stateTx();
949
953 virtual void stateTxData();
954
958 virtual void txData();
959
963 virtual void stateWaitAck();
964
969 virtual void ackTOExpired();
970
974 virtual void stateAckRx();
975
980 virtual void handleAck();
981
985 virtual void handleNoAck();
986
990 virtual void handleProbeAck();
991
995 virtual void addNode2List();
996
1000 virtual void addSink2List();
1001
1007 virtual uint16_t getPollTime();
1008
1012 virtual uint getRxPkts(int mac_addr);
1013
1019 bool initBackoffLUT();
1020
1021 // timers
1027 // internal AUV structure for list of polled node
1028 std::vector<probbed_node> list_probbed_node;
1033 // pointer to packets
1041 // input parameters via TCL
1042 double T_probe;
1047 double T_min;
1049 double T_max;
1051 double T_guard;
1061 int n_run; /*< ID of the experiments (used during sea trial) */
1062
1063 // states of protocol and reasons
1069 // mapping
1070 static std::map<UWPOLLING_PKT_TYPE, std::string>
1073 static std::map<UWPOLLING_AUV_STATUS, std::string>
1076 static std::map<UWPOLLING_AUV_REASON, std::string>
1080 static bool initialized;
1089 double distance;
1098 // statistics
1099
1100 // double curr_backoff_time; /**< backoff time of the node polled */
1101 double curr_RTT;
1105 double probe_rtt;
1115 bool begin;
1116 double stop_time;
1118 double pkt_time;
1119 double total_time;
1121 double Tdata;
1122 double Tprobe;
1123 double Ttrigger;
1124 double Tpoll;
1134 std::ofstream fout;
1137 std::ofstream out_file_stats;
1140 std::deque<Packet *> tx_buffer;
1141 std::deque<Packet *> temp_buffer;
1144 uint16_t uid_tx_pkt;
1153 uint16_t last_pkt_uid;
1156 bool acked;
1161 std::map<int, uint> rx_pkts_map;
1165 std::string backoff_LUT_file;
1167 std::map<double, double> backoff_LUT;
1173};
1174#endif
Definition uwpolling_AUV.h:551
virtual void expire(Event *e)
Definition uwpolling_AUV.cpp:378
AckTimer(Uwpolling_AUV *m)
Definition uwpolling_AUV.h:556
virtual ~AckTimer()
Definition uwpolling_AUV.h:565
Definition uwpolling_AUV.h:464
virtual void expire(Event *e)
Definition uwpolling_AUV.cpp:356
DataTimer(Uwpolling_AUV *m)
Definition uwpolling_AUV.h:470
virtual ~DataTimer()
Definition uwpolling_AUV.h:478
Definition uwpolling_AUV.h:524
PollTimer(Uwpolling_AUV *m)
Definition uwpolling_AUV.h:529
virtual ~PollTimer()
Definition uwpolling_AUV.h:538
virtual void expire(Event *e)
Definition uwpolling_AUV.cpp:388
Definition uwpolling_AUV.h:497
ProbeTimer(Uwpolling_AUV *m)
Definition uwpolling_AUV.h:502
virtual void expire(Event *e)
Definition uwpolling_AUV.cpp:369
virtual ~ProbeTimer()
Definition uwpolling_AUV.h:511
Definition uwpolling_AUV.h:280
virtual ~Uwpolling_AUV_Timer()
Definition uwpolling_AUV.h:300
Uwpolling_AUV_Timer(Uwpolling_AUV *m)
Definition uwpolling_AUV.h:286
virtual void freeze()
Definition uwpolling_AUV.h:308
Uwpolling_AUV *UWPOLLING_TIMER_STATUS timer_status
Definition uwpolling_AUV.h:451
bool isExpired()
Definition uwpolling_AUV.h:381
int counter
Definition uwpolling_AUV.h:448
bool isActive()
Definition uwpolling_AUV.h:401
void resetCounter()
Definition uwpolling_AUV.h:411
virtual void schedule(double val)
Definition uwpolling_AUV.h:348
int getCounter()
Definition uwpolling_AUV.h:430
double getDuration()
Definition uwpolling_AUV.h:440
virtual void stop()
Definition uwpolling_AUV.h:337
bool isRunning()
Definition uwpolling_AUV.h:371
double start_time
Definition uwpolling_AUV.h:446
bool isIdle()
Definition uwpolling_AUV.h:361
bool isFrozen()
Definition uwpolling_AUV.h:391
double left_duration
Definition uwpolling_AUV.h:447
virtual void unFreeze()
Definition uwpolling_AUV.h:324
void incrCounter()
Definition uwpolling_AUV.h:420
Definition uwpolling_AUV.h:196
std::deque< Packet * > tx_buffer
Definition uwpolling_AUV.h:1140
virtual void initInfo()
Definition uwpolling_AUV.cpp:1000
virtual void Phy2MacStartRx(const Packet *p)
Definition uwpolling_AUV.cpp:560
PollTimer poll_timer
Definition uwpolling_AUV.h:1024
virtual void refreshState(UWPOLLING_AUV_STATUS state)
Definition uwpolling_AUV.h:804
Packet * curr_data_packet
Definition uwpolling_AUV.h:1036
int n_dropped_ack_pkts
Definition uwpolling_AUV.h:1130
virtual void ChangeNodePolled()
Definition uwpolling_AUV.cpp:800
Packet * curr_tx_data_packet
Definition uwpolling_AUV.h:1038
Packet * curr_probe_packet
Definition uwpolling_AUV.h:1037
probbed_node probbed_sink
Definition uwpolling_AUV.h:1030
void incrPollTx()
Definition uwpolling_AUV.h:700
virtual uint16_t getPollTime()
Definition uwpolling_AUV.cpp:1377
int N_dropped_probe_pkts
Definition uwpolling_AUV.h:1128
int full_knowledge
Definition uwpolling_AUV.h:1170
void incrTriggerTx()
Definition uwpolling_AUV.h:627
std::vector< probbed_node > list_probbed_node
Definition uwpolling_AUV.h:1028
bool sink_inserted
Definition uwpolling_AUV.h:1032
virtual void handleNoAck()
Definition uwpolling_AUV.cpp:1283
double Ttrigger
Definition uwpolling_AUV.h:1123
virtual void Mac2PhyStartTx(Packet *p)
Definition uwpolling_AUV.cpp:430
int modem_data_bit_rate
Definition uwpolling_AUV.h:1057
UWPOLLING_AUV_STATUS prev_state
Definition uwpolling_AUV.h:1065
virtual void TxTrigger()
Definition uwpolling_AUV.cpp:468
uint n_tx_pkts
Definition uwpolling_AUV.h:1151
virtual void stop_count_time()
Definition uwpolling_AUV.cpp:1054
std::string backoff_LUT_file
Definition uwpolling_AUV.h:1165
virtual void stateIdle()
Definition uwpolling_AUV.cpp:985
virtual void waitForUser()
Definition uwpolling_AUV.cpp:1046
uint POLL_uid
Definition uwpolling_AUV.h:1126
uint TRIGGER_uid
Definition uwpolling_AUV.h:1125
double Tdata
Definition uwpolling_AUV.h:1121
static std::map< UWPOLLING_AUV_REASON, std::string > reason_info
Definition uwpolling_AUV.h:1077
UWPOLLING_AUV_REASON
Definition uwpolling_AUV.h:247
@ UWPOLLING_AUV_REASON_PACKET_ERROR
Definition uwpolling_AUV.h:253
@ UWPOLLING_AUV_REASON_RX_DATA_TO
Definition uwpolling_AUV.h:252
@ UWPOLLING_AUV_REASON_PROBE_TO_EXPIRED
Definition uwpolling_AUV.h:257
@ UWPOLLING_AUV_REASON_PROBE_RECEIVED
Definition uwpolling_AUV.h:251
@ UWPOLLING_AUV_REASON_TX_POLL
Definition uwpolling_AUV.h:250
@ UWPOLLING_AUV_REASON_MAX_PROBE_RECEIVED
Definition uwpolling_AUV.h:255
@ UWPOLLING_AUV_REASON_LAST_POLLED_NODE
Definition uwpolling_AUV.h:256
@ UWPOLLING_AUV_REASON_LAST_PACKET_RECEIVED
Definition uwpolling_AUV.h:254
@ UWPOLLING_AUV_REASON_DATA_RX
Definition uwpolling_AUV.h:248
@ UWPOLLING_AUV_REASON_TX_TRIGGER
Definition uwpolling_AUV.h:249
virtual void SortNode2Poll()
Definition uwpolling_AUV.cpp:955
uint n_probe_rx
Definition uwpolling_AUV.h:1112
virtual void stateRxProbe()
Definition uwpolling_AUV.cpp:819
double curr_Tmeasured
Definition uwpolling_AUV.h:1102
AckTimer ack_timer
Definition uwpolling_AUV.h:1025
int last_probe_lost
Definition uwpolling_AUV.h:1172
int sea_trial_
Definition uwpolling_AUV.h:1054
virtual void DataTOExpired()
Definition uwpolling_AUV.cpp:398
static bool initialized
Definition uwpolling_AUV.h:1080
double T_probe
Definition uwpolling_AUV.h:1042
virtual double linearInterpolator(double x, double x1, double x2, double y1, double y2)
Definition uwpolling_AUV.cpp:338
double total_time
Definition uwpolling_AUV.h:1119
Packet * curr_ack_packet
Definition uwpolling_AUV.h:1039
UWPOLLING_AUV_REASON reason
Definition uwpolling_AUV.h:1066
int getDroppedProbeWrongState()
Definition uwpolling_AUV.h:784
void incrDroppedAckPkts()
Definition uwpolling_AUV.h:679
virtual void UpdateRTT()
Definition uwpolling_AUV.cpp:723
int getProbeRx()
Definition uwpolling_AUV.h:720
int getWrongNodeDataSent()
Definition uwpolling_AUV.h:741
int DATA_POLL_guard_time_
Definition uwpolling_AUV.h:1058
uint max_buffer_size
Definition uwpolling_AUV.h:1143
double T_guard
Definition uwpolling_AUV.h:1051
int getPollSent()
Definition uwpolling_AUV.h:751
uint16_t uid_tx_pkt
Definition uwpolling_AUV.h:1144
uint curr_node_id
Definition uwpolling_AUV.h:1096
uint n_pkts_to_tx
Definition uwpolling_AUV.h:1149
virtual void computeTxTime(UWPOLLING_PKT_TYPE pkt)
Definition uwpolling_AUV.cpp:684
virtual void Phy2MacEndRx(Packet *p)
Definition uwpolling_AUV.cpp:579
virtual void stateTxData()
Definition uwpolling_AUV.cpp:1189
int max_polled_node
Definition uwpolling_AUV.h:1052
int ack_enabled
Definition uwpolling_AUV.h:1158
bool curr_is_sink
Definition uwpolling_AUV.h:1146
virtual void ackTOExpired()
Definition uwpolling_AUV.cpp:422
void incrDroppedProbePkts()
Definition uwpolling_AUV.h:669
bool RxProbeEnabled
Definition uwpolling_AUV.h:1085
double probe_rtt
Definition uwpolling_AUV.h:1105
double Tpoll
Definition uwpolling_AUV.h:1124
double T_max
Definition uwpolling_AUV.h:1049
bool enableAckRx
Definition uwpolling_AUV.h:1155
int getTriggerTx()
Definition uwpolling_AUV.h:710
static std::map< UWPOLLING_PKT_TYPE, std::string > pkt_type_info
Definition uwpolling_AUV.h:1071
double T_min
Definition uwpolling_AUV.h:1047
ProbeTimer probe_timer
Definition uwpolling_AUV.h:1023
virtual void refreshReason(UWPOLLING_AUV_REASON reason)
Definition uwpolling_AUV.h:794
std::map< int, uint > rx_pkts_map
Definition uwpolling_AUV.h:1161
int print_stats_
Definition uwpolling_AUV.h:1056
void incrWrongNodeDataSent()
Definition uwpolling_AUV.h:659
std::ofstream fout
Definition uwpolling_AUV.h:1134
static std::map< UWPOLLING_AUV_STATUS, std::string > status_info
Definition uwpolling_AUV.h:1074
probe_cicle_counters probe_counters
Definition uwpolling_AUV.h:1168
virtual void handleAck()
Definition uwpolling_AUV.cpp:1246
UWPOLLING_PKT_TYPE
Definition uwpolling_AUV.h:261
@ UWPOLLING_DATA_PKT
Definition uwpolling_AUV.h:262
@ UWPOLLING_TRIGGER_PKT
Definition uwpolling_AUV.h:264
@ UWPOLLING_POLL_PKT
Definition uwpolling_AUV.h:263
@ UWPOLLING_PROBE_PKT
Definition uwpolling_AUV.h:265
virtual void addNode2List()
Definition uwpolling_AUV.cpp:1332
virtual void stateWaitData()
Definition uwpolling_AUV.cpp:524
virtual void stateTxPoll()
Definition uwpolling_AUV.cpp:895
virtual void stateWaitAck()
Definition uwpolling_AUV.cpp:1217
void incrAckRx()
Definition uwpolling_AUV.h:647
UWPOLLING_AUV_REASON last_reason
Definition uwpolling_AUV.h:1066
void incrDroppedProbeWrongState()
Definition uwpolling_AUV.h:691
int n_trigger_tx
Definition uwpolling_AUV.h:1111
virtual void stateTxTrigger()
Definition uwpolling_AUV.cpp:436
virtual void handleProbeAck()
Definition uwpolling_AUV.cpp:1297
int N_dropped_probe_wrong_state
Definition uwpolling_AUV.h:1131
int getDroppedProbePkts()
Definition uwpolling_AUV.h:761
virtual uint getRxPkts(int mac_addr)
Definition uwpolling_AUV.cpp:1403
double pkt_time
Definition uwpolling_AUV.h:1118
Packet * curr_trigger_packet
Definition uwpolling_AUV.h:1034
bool RxDataEnabled
Definition uwpolling_AUV.h:1083
virtual void stateAckRx()
Definition uwpolling_AUV.cpp:1228
void incrProbeRx()
Definition uwpolling_AUV.h:637
uint16_t last_pkt_uid
Definition uwpolling_AUV.h:1153
DataTimer data_timer
Definition uwpolling_AUV.h:1022
virtual void recvFromUpperLayers(Packet *p)
Definition uwpolling_AUV.cpp:1061
double stop_time
Definition uwpolling_AUV.h:1116
UWPOLLING_TIMER_STATUS
Definition uwpolling_AUV.h:269
@ UWPOLLING_IDLE
Definition uwpolling_AUV.h:270
@ UWPOLLING_FROZEN
Definition uwpolling_AUV.h:272
@ UWPOLLING_RUNNING
Definition uwpolling_AUV.h:271
@ UWPOLLING_EXPIRED
Definition uwpolling_AUV.h:273
uint max_tx_pkts
Definition uwpolling_AUV.h:1147
double distance
Definition uwpolling_AUV.h:1089
double T_probe_guard
Definition uwpolling_AUV.h:1043
int getAckRx()
Definition uwpolling_AUV.h:730
std::ofstream out_file_stats
Definition uwpolling_AUV.h:1137
virtual void addSink2List()
Definition uwpolling_AUV.cpp:1362
UWPOLLING_AUV_STATUS curr_state
Definition uwpolling_AUV.h:1064
int max_payload
Definition uwpolling_AUV.h:1046
std::deque< Packet * > temp_buffer
Definition uwpolling_AUV.h:1141
double Tprobe
Definition uwpolling_AUV.h:1122
int N_expected_pkt
Definition uwpolling_AUV.h:1090
double initial_time
Definition uwpolling_AUV.h:1109
virtual void TxPoll()
Definition uwpolling_AUV.cpp:944
virtual void stateWaitProbe()
Definition uwpolling_AUV.cpp:508
std::map< double, double > backoff_LUT
Definition uwpolling_AUV.h:1167
int packet_index
Definition uwpolling_AUV.h:1092
virtual ~Uwpolling_AUV()
Definition uwpolling_AUV.cpp:76
virtual void ProbeTOExpired()
Definition uwpolling_AUV.cpp:406
double T_ack_timer
Definition uwpolling_AUV.h:1045
double GetTotalReceivingTime()
Definition uwpolling_AUV.h:913
virtual double GetDataTimerValue()
Definition uwpolling_AUV.cpp:538
virtual void Phy2MacEndTx(const Packet *p)
Definition uwpolling_AUV.cpp:479
bool initBackoffLUT()
Definition uwpolling_AUV.cpp:247
bool acked
Definition uwpolling_AUV.h:1156
virtual void txData()
Definition uwpolling_AUV.cpp:1207
int n_poll_tx
Definition uwpolling_AUV.h:1114
int curr_polled_node_address
Definition uwpolling_AUV.h:1094
UWPOLLING_AUV_STATUS
Definition uwpolling_AUV.h:233
@ UWPOLLING_AUV_STATUS_RX_DATA
Definition uwpolling_AUV.h:237
@ UWPOLLING_AUV_STATUS_TX_DATA
Definition uwpolling_AUV.h:240
@ UWPOLLING_AUV_STATUS_IDLE
Definition uwpolling_AUV.h:234
@ UWPOLLING_AUV_STATUS_WAIT_ACK
Definition uwpolling_AUV.h:243
@ UWPOLLING_AUV_STATUS_TX_TRIGGER
Definition uwpolling_AUV.h:235
@ UWPOLLING_AUV_STATUS_RX_PROBES
Definition uwpolling_AUV.h:236
@ UWPOLLING_AUV_STATUS_TX_POLL
Definition uwpolling_AUV.h:239
@ UWPOLLING_AUV_STATUS_WAIT_DATA
Definition uwpolling_AUV.h:242
@ UWPOLLING_AUV_STATUS_RX_ACK
Definition uwpolling_AUV.h:238
@ UWPOLLING_AUV_STATUS_WAIT_PROBE
Definition uwpolling_AUV.h:241
Uwpolling_AUV()
Definition uwpolling_AUV.cpp:89
virtual int crLayCommand(ClMessage *m)
Definition uwpolling_AUV.cpp:347
int wrong_node_data_sent
Definition uwpolling_AUV.h:1107
unsigned long int getEpoch()
Definition uwpolling_AUV.h:927
int polling_index
Definition uwpolling_AUV.h:1031
bool TxEnabled
Definition uwpolling_AUV.h:1087
int getDroppedAckPkts()
Definition uwpolling_AUV.h:771
int n_ack_rx
Definition uwpolling_AUV.h:1113
virtual void stateTx()
Definition uwpolling_AUV.cpp:1095
bool enable_adaptive_backoff
Definition uwpolling_AUV.h:1163
char lut_token_separator
Definition uwpolling_AUV.h:1166
bool begin
Definition uwpolling_AUV.h:1115
virtual void stateRxData()
Definition uwpolling_AUV.cpp:732
Packet * curr_poll_packet
Definition uwpolling_AUV.h:1035
int n_run
Definition uwpolling_AUV.h:1061
virtual int command(int argc, const char *const *argv)
Definition uwpolling_AUV.cpp:185
double curr_RTT
Definition uwpolling_AUV.h:1101
double getMaxBackoffTime()
Definition uwpolling_AUV.cpp:271
Definition uwpolling_AUV.h:108
uint16_t & get_id_ack()
Definition uwpolling_AUV.h:176
bool & is_sink()
Definition uwpolling_AUV.h:167
int n_pkts
Definition uwpolling_AUV.h:110
double time_stamp
Definition uwpolling_AUV.h:113
double & get_time_stamp()
Definition uwpolling_AUV.h:131
uint id_node
Definition uwpolling_AUV.h:109
int & get_n_pkts()
Definition uwpolling_AUV.h:149
double Tmeasured
Definition uwpolling_AUV.h:117
uint & get_id_node()
Definition uwpolling_AUV.h:140
double & get_weight()
Definition uwpolling_AUV.h:185
bool is_sink_
Definition uwpolling_AUV.h:119
uint16_t id_ack
Definition uwpolling_AUV.h:121
int & get_mac_address()
Definition uwpolling_AUV.h:158
double policy_weight
Definition uwpolling_AUV.h:124
int mac_address
Definition uwpolling_AUV.h:112
Definition uwpolling_AUV.h:71
uint n_probe_received
Definition uwpolling_AUV.h:74
uint n_probe_detected
Definition uwpolling_AUV.h:72
void incrementCounters()
Definition uwpolling_AUV.h:80
void resetCounters()
Definition uwpolling_AUV.h:89
uint getNumberOfNeighbors()
Definition uwpolling_AUV.h:98
std::pair< int, int > counter
Definition uwinterference.h:53
struct probbed_node probbed_node
Common structures and variables in the protocol.
Provides the definition of the class UWSMPosition.