56 : TclClass(
"Module/UW/UFETCH/NODE")
69std::map<uwUFetch_NODE::UWUFETCH_NODE_STATUS, std::string>
71std::map<uwUFetch_NODE::UWUFETCH_NODE_STATUS_CHANGE, std::string>
73std::map<uwUFetch_NODE::UWUFETCH_NODE_PACKET_TYPE, std::string>
75std::map<uwUFetch_NODE::UWUFETCH_TIMER_STATUS, std::string>
86 , BCK_timer_data(this)
87 , BCK_timer_probe(this)
89 , DATA_BEFORE_TX_timer(this)
93 rx_BEACON_start_time(0)
94 , rx_BEACON_finish_time(0)
95 , tx_PROBE_start_time(0)
96 , tx_PROBE_finish_time(0)
97 , rx_POLL_start_time(0)
98 , rx_POLL_finish_time(0)
99 , tx_DATA_start_time(0)
100 , tx_DATA_finish_time(0)
101 , rx_CBEACON_start_time(0)
102 , rx_CBEACON_finish_time(0)
103 , n_tot_BEACON_pck_rx_by_NODE(0)
104 , n_tot_BEACON_pck_rx_corr_by_NODE(0)
105 , n_tot_PROBE_pck_tx_by_NODE(0)
106 , n_tot_POLL_pck_rx_by_NODE(0)
107 , n_tot_POLL_pck_rx_corr_by_NODE(0)
108 , n_tot_DATA_pck_tx_by_NODE(0)
109 , n_tot_CBEACON_pck_rx_by_NODE(0)
110 , n_tot_CBEACON_pck_rx_corr_by_NODE(0)
111 , T_min_bck_probe_node(0)
112 , T_max_bck_probe_node(0)
113 , num_cbeacon_node_rx(0)
114 , mac_addr_HN_in_beacon(0)
115 , bck_before_tx_probe(0)
119 , mac_addr_HN_in_poll(0)
120 , num_pck_to_tx_by_NODE(0)
121 , num_cbeacon_at_now_HN_tx(0)
122 , mac_addr_HN_in_cbeacon(0)
125 n_BEACON_pck_rx_by_NODE(0)
126 , n_PROBE_pck_tx_by_NODE(0)
127 , n_POLL_pck_rx_by_NODE(0)
128 , n_DATA_pck_tx_by_NODE(0)
129 , n_CBEACON_pck_rx_by_NODE(0)
130 , dataAlreadyTransmitted(false)
133 rxBEACONEnabled(false)
134 , txPROBEEnabled(false)
135 , rxPOLLEnabled(false)
136 , txDATAEnabled(false)
137 , rxCBEACONEnabled(false)
138 , curr_BEACON_NODE_pck_rx(NULL)
139 , curr_PROBE_NODE_pck_tx(NULL)
140 , curr_POLL_NODE_pck_rx(NULL)
141 , curr_DATA_NODE_pck_tx(NULL)
142 , curr_CBEACON_NODE_pck_rx(NULL)
146 BeaconBeforeTx_timer(this)
151 tx_BEACON_start_HN_time(0)
152 , tx_BEACON_finish_HN_time(0)
153 , rx_PROBE_start_HN_time(0)
154 , rx_PROBE_finish_HN_time(0)
155 , tx_POLL_start_HN_time(0)
156 , tx_POLL_finish_HN_time(0)
157 , rx_DATA_start_HN_time(0)
158 , rx_DATA_finish_HN_time(0)
159 , tx_CBEACON_start_HN_time(0)
160 , tx_CBEACON_finish_HN_time(0)
161 , rx_TRIGGER_start_HN_time(0)
162 , rx_TRIGGER_finish_HN_time(0)
163 , tx_RTS_start_HN_time(0)
164 , tx_RTS_finish_HN_time(0)
165 , rx_CTS_start_HN_time(0)
166 , rx_CTS_finish_HN_time(0)
167 , tx_DATA_start_HN_time(0)
168 , tx_DATA_finish_HN_time(0)
169 , n_tot_BEACON_pck_tx_by_HN(0)
170 , n_tot_PROBE_pck_rx_by_HN(0)
171 , n_tot_PROBE_pck_corr_rx_by_HN(0)
172 , n_tot_POLL_pck_tx_by_HN(0)
173 , n_tot_DATA_pck_rx_by_HN(0)
174 , n_tot_DATA_pck_rx_corr_by_HN(0)
175 , n_tot_CBEACON_pck_tx_by_HN(0)
176 , n_tot_TRIGGER_pck_rx_by_HN(0)
177 , n_tot_TRIGGER_pck_rx_corr_by_HN(0)
178 , n_tot_DATA_pck_tx_by_HN(0)
179 , mac_addr_NODE_polled(0)
180 , number_data_pck_HN_rx_exact(0)
186 , mac_addr_NODE_in_data(0)
191 , bck_before_tx_data(0)
192 , mac_addr_AUV_in_trigger(0)
193 , mac_addr_AUV_in_CTS(0)
194 , bck_before_tx_RTS(0)
195 , max_data_HN_can_tx(0)
196 , max_pck_HN_can_tx(0)
199 , txRTSbeforeCBEACON(false)
200 , sectionCBeacon(false)
203 n_BEACON_pck_tx_by_HN(0)
204 , n_PROBE_pck_rx_by_HN(0)
205 , n_POLL_pck_tx_by_HN(0)
206 , n_DATA_pck_rx_by_HN(0)
207 , n_CBEACON_pck_tx_by_HN(0)
208 , n_TRIGGER_pck_rx_by_HN(0)
209 , n_RTS_pck_tx_by_HN(0)
210 , n_CTS_pck_rx_by_HN(0)
211 , n_DATA_pck_tx_by_HN(0)
214 txBEACONEnabled(false)
215 , rxPROBEEnabled(false)
216 , txPOLLEnabled(false)
217 , rxDATAEnabled(false)
218 , txCBEACONEnabled(false)
219 , rxTRIGGEREnabled(false)
220 , txRTSEnabled(false)
221 , rxCTSEnabled(false)
222 , txDATAEnabledHN(false)
225 curr_BEACON_HN_pck_tx(NULL)
226 , curr_PROBE_HN_pck_rx(NULL)
227 , curr_POLL_HN_pck_tx(NULL)
228 , curr_DATA_HN_pck_rx(NULL)
229 , curr_CBEACON_HN_pck_tx(NULL)
230 , curr_TRIGGER_HN_pck_rx(NULL)
231 , curr_RTS_HN_pck_tx(NULL)
232 , curr_CTS_HN_pck_rx(NULL)
233 , curr_DATA_HN_pck_tx(NULL)
234 , curr_DATA_NODE_pck_tx_HN(NULL)
237 mac2phy_delay_ = 1e-19;
238 bind(
"TIME_BEFORE_START_COMU_HN_NODE_",
243 bind(
"MAXIMUM_PAYLOAD_SIZE_", (
int *) &
MAX_PAYLOAD);
244 bind(
"TIME_TO_WAIT_PROBES_PCK_", (
double *) &
T_PROBE);
245 bind(
"TIME_TO_WAIT_POLL_PCK_", (
double *) &
T_POLL);
246 bind(
"TIME_BETWEEN_2_DATA_TX_HN_",
248 bind(
"TIME_BETWEEN_2_DATA_TX_NODE_",
251 bind(
"GUARD_INTERVAL_", (
double *) &
T_GUARD);
254 bind(
"MAXIMUM_PCK_WANT_RX_HN_FROM_NODE_",
257 bind(
"NUMBER_OF_RUN_", (
int *) &
N_RUN);
258 bind(
"TIME_TO_WAIT_CTS_", (
double *) &
T_CTS);
268 return MMac::crLayCommand(m);
280 Tcl &tcl = Tcl::instance();
283 if (strcasecmp(argv[1],
"initialize") == 0) {
287 fout.open(
"/tmp/uwUFetch_AUV_stateTransitions.txt",
290 std::stringstream file_logging;
291 file_logging <<
"uwUFetch_NODE_" << addr <<
"_N_RUN_" <<
N_RUN
294 file_logging.str().c_str(), std::ios_base::app);
298 }
else if (strcasecmp(argv[1],
"printTransitions") == 0) {
302 }
else if (strcasecmp(argv[1],
"getDataQueueSize") == 0) {
306 }
else if (strcasecmp(argv[1],
"getBEACONrxByNODE") == 0) {
310 }
else if (strcasecmp(argv[1],
"getBEACONrxCorruptedByNODE") == 0) {
314 }
else if (strcasecmp(argv[1],
"getPROBEtxByNODE") == 0) {
318 }
else if (strcasecmp(argv[1],
"getPOLLrxByNODE") == 0) {
322 }
else if (strcasecmp(argv[1],
"getPOLLrxCorruptedByNODE") == 0) {
326 }
else if (strcasecmp(argv[1],
"getDATAtxByNODE") == 0) {
330 }
else if (strcasecmp(argv[1],
"getCBEACONrxByNODE") == 0) {
334 }
else if (strcasecmp(argv[1],
"getCBEACONrxCorruptedByNODE") == 0) {
338 }
else if (strcasecmp(argv[1],
"SimpleNodeStart") == 0) {
342 }
else if (strcasecmp(argv[1],
"getBEACONtxByHN") == 0) {
346 }
else if (strcasecmp(argv[1],
"getPROBErxByHN") == 0) {
350 }
else if (strcasecmp(argv[1],
"getPROBErxCorruptedByHN") == 0) {
354 }
else if (strcasecmp(argv[1],
"getPOLLtxByHN") == 0) {
358 }
else if (strcasecmp(argv[1],
"getDATArxByHN") == 0) {
362 }
else if (strcasecmp(argv[1],
"getDATArxCorruptedByHN") == 0) {
366 }
else if (strcasecmp(argv[1],
"getCBEACONtxbyHN") == 0) {
370 }
else if (strcasecmp(argv[1],
"getTRIGGERrxByHN") == 0) {
374 }
else if (strcasecmp(argv[1],
"getTRIGGERrxCorrupteByHN") == 0) {
378 }
else if (strcasecmp(argv[1],
"getRTStxByHN") == 0) {
382 }
else if (strcasecmp(argv[1],
"getCTSrxByHN") == 0) {
386 }
else if (strcasecmp(argv[1],
"getCTSrxCorrupteByHN") == 0) {
390 }
else if (strcasecmp(argv[1],
"getDATAtxByHN") == 0) {
394 }
else if (strcasecmp(argv[1],
"HeadNodeStart") == 0) {
398 }
else if (strcasecmp(argv[1],
"BeHeadNode") == 0) {
402 }
else if (argc == 3) {
403 if (strcasecmp(argv[1],
"setMacAddr") == 0) {
404 addr = atoi(argv[2]);
406 std::cout <<
"UWFETCH_NODE MAC address is:" << addr
411 return MMac::command(argc, argv);
420 system(
"rm -f /tmp/uwUFetch_NODE_stateTransitions.txt");
421 system(
"touch /tmp/uwUFetch_NODE_stateTransitions.txt");
426 "NODE has received a BEACON packet from HN";
428 "NODE is transmitting PROBE packet to HN";
430 "NODE is waiting for POLL packet from HN";
432 "NODE has received a POLL packet from HN";
434 "NODE is transmitting DATA packet to HN";
436 "HN has received a TRIGGER packet from the AUV";
438 "HN has transmitted a RTS packet to the AUV";
440 "HN is waiting to the CTS packet from the AUV";
442 " HN has received a CTS packet from the AUV";
444 "HN is transmitting the BEACON packet to the NODE";
446 "HN is waiting to receive a PROBE packet from the NODE";
448 "HN has received a PROBE packet from the NODE";
450 "HN is transmitting the POLL packet to the NODE";
452 "HN is waiting a DATA packet from the NODE";
454 "HN has received a DATA packet from the NODE";
456 "NODE is waiting to receive a CBEACON packet from the HN";
458 "NODE has received a CBEACON packet from the HN";
461 "NODE is in IDLE STATE";
463 "NODE has receive a packet that is corrupted";
465 "NODE has received a packet that is addressed for another node";
467 "NODE has received a packet that the type is unknown";
469 "NODE has received a BEACON packet";
471 "NODE has transmitted a PROBE packet";
473 "POLL timeout is expired";
475 "NODE has received a POLL packet";
477 "NODE has received a CBEACON packet but it has already transmit "
480 "NODE has transmitted the maximum number of packets";
482 "NODE has transmitted a DATA packets";
484 "HN has received a TRIGGER packet";
486 "HN has transmitted a RTS packet to tha AUV";
488 "CTS timeout expired";
490 "HN has received a CTS packet from the AUV";
492 "HN has transmitted a BEACON packet to the NODE";
494 "HN has transmitted a CBEACON packet to the NODe";
496 "HN has received a BEACON packet from the NODE";
499 "HN has 0 NODE to poll and maximum number of CBEACON has "
502 "HN has 0 NODE to poll and another CBEACON can be transmitted";
505 "HN has received the maximum number of PROBE allowed and "
506 "the PROBE timeout is not still expired";
508 "PROBE timeout is expired and at least 1 node can be polled by the "
511 "HN has transmitted a POLL packet to the NODE";
513 "DATA timeout is expire";
516 "DATA timeout is expire and there are 0 node to poll and "
517 "other CBEACONS can not be transmitted";
520 "DATA timeout is expire and there are 0 node to poll and "
521 "at least one CBEACON can be transmitted";
524 "DATA timeout is expire and at least 1 node can be polled";
526 "HN has received a DATA packet from the NODE";
528 "HN has received the last DATA packet from the NODE";
531 "HN has received all the packet from the NODE, there are 0 "
532 "node to polled and it's not possible to transmit other "
536 "HN has received all the packet from the NODE, there are 0 "
537 "node to polled and it's possible to transmit other "
541 "HN has received all the packet from the NODE, there are "
542 "at least one node that can be polled";
544 "HN has transmit the maximum number of CBEACON packets";
546 "BEACON timeout is expired";
548 "Trigger received by the HN, but HN has no DATA available to "
549 "transmit to the AUV";
551 "HN has transmitted all his DATA packet to the AUV";
553 "HN has received a TRIGGER from AUV that is corrupted by the "
557 "HN has finished to transmit a DATA packets to the AUV, "
559 " with the transmission of CBEACON packet";
594 hdr_cmn *cmh = hdr_cmn::access(p);
595 hdr_mac *mach = HDR_MAC(p);
596 int src_mac_addr = mach->macSA();
602 <<
")::Phy2MacStartRx()_________________Start_"
604 <<
"from_HN(" << src_mac_addr <<
")."
610 std::cout << NOW <<
" uwUFetch_NODE (" << addr
611 <<
") ::Phy2MacStartRx() ---->NODE is starting "
613 <<
" BEACON packet from the HN with MAC address: "
614 << src_mac_addr << std::endl;
621 std::cout << NOW <<
" uwUFetch_NODE (" << addr
622 <<
") ::Phy2MacStartRx() ---->NODE is not "
623 "enabled to receive a "
624 <<
"BEACON packet from the HN with MAC address: "
625 << src_mac_addr <<
", so wait"
626 <<
" the end of the reception of the packet and "
633 std::cout << NOW <<
" uwUFetch_NODE (" << addr
634 <<
") ::Phy2MacStartRx() ---->NODE is starting to "
636 <<
" POLL packet from the HN with MAC address: "
637 << src_mac_addr << std::endl;
640 <<
")::Phy2MacStartRx()_________________Start_"
642 <<
"_from HN(" << src_mac_addr <<
")."
650 std::cout << NOW <<
" uwUFetch_NODE (" << addr
651 <<
") ::Phy2MacStartRx() ---->NODE is starting to "
653 <<
" CBEACON packet from the HN with MAC address: "
654 << src_mac_addr << std::endl;
657 <<
")::Phy2MacStartRx()_________________Start_"
659 <<
"_from HN(" << src_mac_addr <<
")."
667 std::cout << NOW <<
" uwUFetch_NODE (" << addr
668 <<
") ::Phy2MacStartRx() ---->NODE is starting to "
670 <<
" PROBE packet from the NODE with MAC address: "
671 << src_mac_addr << std::endl;
676 std::cout << NOW <<
" uwUFetch_NODE (" << addr
677 <<
") ::Phy2MacStartRx() ---->NODE is starting to "
679 <<
" TRIGGER packet from the AUV with MAC address: "
680 << src_mac_addr << std::endl;
686 << NOW <<
" uwUFetch_NODE (" << addr
687 <<
") ::Phy2MacStartRx() ---->NODE is starting to "
689 <<
" DATA packet from the HN or NODE with MAC address: "
690 << src_mac_addr << std::endl;
709 hdr_cmn *cmh = hdr_cmn::access(p);
710 hdr_mac *mach = HDR_MAC(p);
711 int src_mac_addr = mach->macSA();
712 int dest_mac_addr = mach->macDA();
715 hdr_MPhy *ph = HDR_MPHY(p);
716 double gen_time = ph->txtime;
717 double received_time = ph->rxtime;
718 double diff_time = received_time - gen_time;
722 if ((dest_mac_addr == addr) || (dest_mac_addr == MAC_BROADCAST)) {
729 <<
")::Phy2MacEndRx()___________________"
730 "Finished_to_rx_BEACON"
731 <<
"_pck_from_HN(" << src_mac_addr <<
")"
738 std::cout << NOW <<
" uwUFetch_NODE (" << addr
739 <<
") ::Phy2MacEndRx() ---->Node is "
740 "enabled to rx BEACON packet, but the "
742 <<
" is corrupted: DROP IT and return in "
748 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
749 <<
")::Phy2MacEndRx()___________________"
750 "ENABLED_to_rx_BEACON_pck_from_HN("
751 << mach->macSA() <<
")_"
752 <<
"but_pck_It_s_in_ERROR." << std::endl;
768 std::cout << NOW <<
" uwUFetch_NODE (" << addr
769 <<
") ::Phy2MacEndRx() ---->NODE has "
770 "finished to receive a "
771 <<
"BEACON packet from the HN with MAC "
773 << src_mac_addr <<
" and it's not enabled"
774 <<
" to receive It, so DROP IT."
778 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
779 <<
")::Phy2MacEndRx()___________________"
780 "NOT_ENABLED_to_rx_BEACON_pck_from_HN("
781 << mach->macSA() <<
")"
782 <<
"_and_pck_It_s_in_ERROR." << std::endl;
795 std::cout << NOW <<
" uwUFetch_NODE ("
797 <<
") ::Phy2MacEndRx() ---->NODE "
798 "has finished to receive a "
799 <<
"BEACON packet from the HN "
802 <<
" and it's not enabled to rx "
803 "It, but SN it's waiting a "
805 <<
" from this HN, so return in "
806 "IDLE state and wait a BEACON "
811 << NOW <<
"uwUFetch_SENSOR_NODE("
812 << addr <<
")::Phy2MacEndRx()______"
815 <<
")_is_waiting_a_POLL_from_HN("
816 << mach->macSA() <<
")"
817 <<
":return_in_IDLE_STATE."
822 << NOW <<
"uwUFetch_SENSOR_NODE("
824 <<
")::Phy2MacEndRx()______________"
825 "_____RESET_POLL_timeout."
850 std::cout << NOW <<
" uwUFetch_NODE ("
852 <<
") ::Phy2MacEndRx() ---->NODE "
853 "has finished to receive a "
854 <<
"BEACON packet from the HN "
857 <<
" and it's not enabled to rx "
858 "It, but SN it's waiting a "
860 <<
" from this HN, so return in "
861 "IDLE state and wait a BEACON "
867 << NOW <<
"uwUFetch_SENSOR_NODE("
868 << addr <<
")::Phy2MacEndRx()______"
870 << addr <<
")_is_waiting_a_CBEACON_"
872 << mach->macSA() <<
")_"
873 <<
":return_in_IDLE_STATE."
878 << NOW <<
"uwUFetch_SENSOR_NODE("
880 <<
")::Phy2MacEndRx()______________"
881 "_____RESET_CBEACON_timeout."
913 std::cout << NOW <<
" uwUFetch_NODE (" << addr
914 <<
") ::Phy2MacEndRx() ---->NODE has "
915 "finished to receive a "
916 <<
"BEACON packet from the HN with MAC "
918 << src_mac_addr <<
" and it's not enabled"
919 <<
" to receive It, so DROP IT."
923 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
924 <<
")::Phy2MacEndRx()___________________"
925 "NOT_ENABLED_to_rx_BEACON_pck_from_HN("
926 << mach->macSA() <<
")_"
927 <<
"_and_BEACON_It_s_CORRECT:IGNORE_IT."
935 std::cout << NOW <<
" uwUFetch_NODE ("
937 <<
") ::Phy2MacEndRx() ---->NODE "
938 "has finished to receive a "
939 <<
"BEACON packet from the HN "
942 <<
" and it's not enabled to rx "
943 "It, but SN it's waiting a "
945 <<
" from this HN, so return in "
946 "IDLE state and wait a BEACON "
952 << NOW <<
"uwUFetch_SENSOR_NODE("
953 << addr <<
")::Phy2MacEndRx()______"
955 << addr <<
")_is_waiting_a_POLL_"
957 << mach->macSA() <<
")_"
958 <<
":return_in_IDLE_STATE."
962 << NOW <<
"uwUFetch_SENSOR_NODE("
964 <<
")::Phy2MacEndRx()______________"
965 "_____RESET_POLL_timeout."
991 std::cout << NOW <<
" uwUFetch_NODE ("
993 <<
") ::Phy2MacEndRx() ---->NODE "
994 "has finished to receive a "
995 <<
"BEACON packet from the HN "
998 <<
" and it's not enabled to rx "
999 "It, but SN it's waiting a "
1001 <<
" from this HN, so return in "
1002 "IDLE state and wait a BEACON "
1003 "from another node."
1007 << NOW <<
"uwUFetch_SENSOR_NODE("
1008 << addr <<
")::Phy2MacEndRx()______"
1010 << addr <<
")_is_waiting_a_CBEACON_"
1012 << mach->macSA() <<
")"
1013 <<
":return in IDLE STATE."
1017 << NOW <<
"uwUFetch_SENSOR_NODE("
1019 <<
")::Phy2MacEndRx()______________"
1020 "_____RESET_CBEACON_timeout."
1053 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1054 <<
") ::Phy2MacEndRx() ---->NODE has "
1055 "finished to receive a "
1056 <<
"BEACON packet from the HN with MAC "
1058 << src_mac_addr <<
" and it's enabled"
1059 <<
" to receive It." << std::endl;
1063 std::cout << NOW <<
" uwUFetch_NODE( " << addr
1064 <<
") ::Phy2MacEndRx() ---->BEACON packet "
1065 "received by the NODE"
1066 <<
" is CORRECT, so COMPUTE IT" << std::endl;
1073 <<
")::Phy2MacEndRx()_________________"
1074 "__BEACON_rx_from_HN("
1075 << mach->macSA() <<
")_:It_s_CORRECT."
1091 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1092 <<
") ::Phy2MacEndRx() ---->NODE has finished to "
1094 <<
" POLL packet from the HN with MAC address: "
1095 << src_mac_addr << std::endl;
1099 <<
")::Phy2MacEndRx()___________________"
1100 "Finished_to_rx_POLL_pck"
1101 <<
"_from_HN(" << src_mac_addr <<
")."
1108 std::cout << NOW <<
" uwUFetch_NODE( " << addr
1109 <<
") ::Phy2MacEndRx() ---->POLL packet "
1110 "received by the NODE"
1111 <<
" is corrupted: DROP IT." << std::endl;
1114 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1115 <<
")::Phy2MacEndRx()___________________"
1116 "POLL_pck_rx_from_HN("
1117 << src_mac_addr <<
")_It_s_in_ERROR."
1142 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1143 <<
") ::Phy2MacEndRx() ---->POLL packet "
1144 "received by the NODE"
1145 <<
" is CORRECT." << std::endl;
1149 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1150 <<
")::Phy2MacEndRx()___________________"
1151 "POLL_pck_rx_from_HN("
1152 << src_mac_addr <<
")_It_s_CORRECT."
1158 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1159 <<
") ::Phy2MacEndRx() ---->POLL timer "
1176 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1177 <<
") ::Phy2MacEndRx() ---->NODE has "
1178 "received a POLL packet"
1179 <<
" from the HN from which it's not waiting "
1180 "a POLL, so DROP IT."
1184 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1185 <<
")::Phy2MacEndRx()___________________POLL_"
1188 <<
")_It_s_not_addressed_to_me:_DROP_IT."
1200 << NOW <<
" uwUFetch_NODE (" << addr
1201 <<
") ::Phy2MacEndRx() ---->NODE has finished to "
1203 <<
" CBEACON packet from the HN with MAC address: "
1204 << src_mac_addr << std::endl;
1208 <<
")::Phy2MacEndRx()___________________"
1209 "NODE_has_finished_to_rx_CBEACON_packet"
1210 <<
"_from HN(" << src_mac_addr <<
")."
1219 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1220 <<
") ::Phy2MacEndRx() ---->CBEACON rx from "
1226 <<
")::Phy2MacEndRx()_________________"
1227 "__CBEACON_rx_from_the_correct_HN("
1228 << src_mac_addr <<
")." << std::endl;
1237 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1238 <<
") ::Phy2MacEndRx() ---->CBEACON "
1239 "received by the NODE"
1240 <<
" is corrupted: DROP IT." << std::endl;
1243 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1244 <<
")::Phy2MacEndRx()___________________"
1245 "CBEACON_rx_from_HN("
1246 << mach->macSA() <<
")_It_s_in_ERROR."
1253 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1254 <<
") ::Phy2MacEndRx() ---->CBEACON "
1262 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1263 <<
") ::Phy2MacEndRx() ---->NODE has "
1264 "received the maximum"
1265 <<
" number of CBEACON packet from "
1266 "the HN with MAC address: "
1268 <<
" return in IDLE STATE."
1272 << NOW <<
"uwUFetch_SENSOR_NODE("
1274 <<
")::Phy2MacEndRx()__________________"
1275 "_MAX_number_of_CBEACON_received."
1296 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1297 <<
") ::Phy2MacEndRx() ---->NODE has "
1298 "not received the maximum"
1299 <<
" number of CBEACON packet from "
1300 "the HN with MAC address: "
1302 <<
" wait other CBEACON packets."
1306 << NOW <<
"uwUFetch_SENSOR_NODE("
1308 <<
")::Phy2MacEndRx()__________________"
1309 "_Other_CBEACON_can_be_rx."
1323 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1324 <<
") ::Phy2MacEndRx() ---->CBEACON "
1325 "packet received by the NODE"
1326 <<
" is CORRECT." << std::endl;
1328 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1329 <<
") ::Phy2MacEndRx() ---->CBEACON "
1330 "received is the number: "
1335 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1336 <<
")::Phy2MacEndRx()___________________"
1337 "CBECON_rx_from_HN("
1338 << mach->macSA() <<
")_It_s_CORRECT."
1352 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1353 <<
") ::Phy2MacEndRx() ---->CBEACON packet "
1354 "received by the NODE"
1355 <<
" is received from the HN from which I "
1356 "never received the BEACON: IGNORE IT"
1360 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1361 <<
")::Phy2MacEndRx()___________________"
1362 "CBEACON_rx_It_s_not_for_me_SENSOR_NODE."
1372 << NOW <<
" uwUFetch_NODE (" << addr
1373 <<
") ::Phy2MacEndRx() ---->NODE has finished to "
1375 <<
" PROBE packet from the NODE with MAC address: "
1376 << src_mac_addr <<
". DROP IT" << std::endl;
1384 << NOW <<
" uwUFetch_NODE (" << addr
1385 <<
") ::Phy2MacEndRx() ---->NODE has finished to "
1387 <<
" TRIGGER packet from the AUV with MAC address: "
1388 << src_mac_addr << std::endl;
1394 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1395 <<
") ::Phy2MacEndRx() ---->NODE has finished to "
1397 <<
" DATA packet from the HN or NODE with MAC "
1399 << src_mac_addr <<
" .DROP IT" << std::endl;
1405 << NOW <<
" uwUFetch_NODE (" << addr
1406 <<
") ::Phy2MacEndRx() ---->NODE has "
1407 "finished to receive a "
1408 <<
"DATA packet from the HN with MAC "
1411 <<
" and it's not enabled to rx It, but SN "
1412 "it's waiting a POLL packet"
1413 <<
" from this HN, so return in IDLE state "
1414 "and wait a BEACON from another node."
1419 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1420 <<
")::Phy2MacEndRx()___________________"
1421 "Received_DATA_from_HN_from_which_"
1422 <<
"SN(" << addr <<
")_is_waiting_a_POLL."
1427 <<
")::Phy2MacEndRx()_____________"
1428 "______RESET_POLL_timeout_and_"
1429 "return_in_IDLE_STATE."
1457 << NOW <<
" uwUFetch_NODE (" << addr
1458 <<
") ::Phy2MacEndRx() ---->NODE has "
1459 "finished to receive a "
1460 <<
"DATA packet from the HN with MAC "
1463 <<
" and it's not enabled to rx It, but SN "
1464 "it's waiting a CBEACON packet"
1465 <<
" from this HN, so return in IDLE state "
1466 "and wait a BEACON from another node."
1470 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1471 <<
")::Phy2MacEndRx()___________________"
1472 "Received_DATA_from_HN_from_which_"
1474 <<
")_is_waiting_a_CBEACON." << std::endl;
1478 <<
")::Phy2MacEndRx()_____________"
1479 "______RESET_CBEACON_timeout_"
1480 "and_return_in_IDLE_STATE."
1523 <<
")::Phy2MacEndRx()___________________"
1524 "Finished_to_rx_POLL"
1525 <<
"_pck_from_HN(" << src_mac_addr <<
")"
1531 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1532 <<
") ::Phy2MacEndRx() ---->NODE has "
1533 "received a POLL packet"
1534 <<
" from the HN from which it waiting a "
1535 "POLL, but it's not my turn, so reset the "
1537 <<
" restart to waiting a POLL." << std::endl;
1540 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1541 <<
")::Phy2MacEndRx()___________________SN("
1542 << addr <<
")_is_waiting_a_POLL_from"
1543 <<
"_HN(" << src_mac_addr
1544 <<
")_but_It_s_NOT_ITS_TURN." << std::endl;
1548 <<
")::Phy2MacEndRx()_________________"
1549 "__RESET_and_RESTART_POLL_timeout."
1553 hdr_mac *mach = HDR_MAC(p);
1564 double poll_waiting_time =
1567 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1568 <<
") ::Phy2MacEndRx() ---->The new waiting "
1570 << poll_waiting_time << std::endl;
1573 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1574 <<
")::Phy2MacEndRx()___________________POLL_"
1576 << poll_waiting_time <<
"_[s]." << std::endl;
1585 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1586 <<
") ::Phy2MacEndRx() ---->The packet "
1587 "received is not for me NODE:"
1588 <<
" DROP IT." << std::endl;
1615 hdr_cmn *cmh = hdr_cmn::access(p);
1616 hdr_mac *mach = HDR_MAC(p);
1621 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1622 <<
") ::Mac2PhyStartTx() ---->MAC layer of the NODE "
1624 <<
" packet to its physical layer." << std::endl;
1627 <<
")::Mac2PhyStartTx()_________________Start_"
1630 <<
")." << std::endl;
1634 MMac::Mac2PhyStartTx(p);
1639 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1640 <<
") ::Mac2PhyStartTx() ---->MAC layer of the NODE "
1642 <<
" packet to its physical layer." << std::endl;
1646 <<
")::Mac2PhyStartTx()_________________Start_"
1648 <<
"to_the_HN(" << mach->macDA() <<
")."
1656 MMac::Mac2PhyStartTx(p);
1674 hdr_cmn *cmh = hdr_cmn::access(p);
1679 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1680 <<
") ::Phy2MacEndTx() ---->Physical layer of the "
1682 <<
" to transmit a PROBE packet to the HN with MAC "
1687 <<
")::Phy2MacEndTx()___________________"
1688 "Finished_to_tx_PROBE_pck"
1690 <<
")." << std::endl;
1704 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1705 <<
") ::Phy2MacEndTx() ---->Physical layer of the "
1707 <<
" to transmit a DATA packet to the HN with MAC "
1718 <<
")::Phy2MacEndTx()___________________"
1719 "Finished_to_tx_DATA_pck"
1721 <<
")." << std::endl;
1741 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1742 <<
") ::stateIdle_NODE() ---->NODE is in IDLE STATE"
1747 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1748 <<
")::stateIdle_NODE()_________________NODE_is_IDLE_STATE."
1758 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1759 <<
") ::stateIdle_NODE() ---->NODE is waiting a BEACON packet"
1760 <<
" from an HN." << std::endl;
1763 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1764 <<
")::stateIdle_NODE()_________________....Waiting_BEACON_pck."
1768 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1769 <<
")::stateIdle_NODE()_________________....Waiting_BEACON_pck."
1773 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1774 <<
")::stateIdle_NODE()_________________....Waiting_BEACON_pck."
1802 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1803 <<
") ::BEACON_rx() ---->NUMERO DI CBEACON: "
1811 <<
")::BEACON_rx()______________________PARAMETERS_of_"
1816 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1817 <<
")::BEACON_rx()______________________Source_address:_"
1818 << mach->macSA() <<
"." << std::endl;
1819 if (mach->macDA() == -1) {
1822 <<
")::BEACON_rx()______________________"
1823 "Destination_address:_BROADCAST."
1828 <<
")::BEACON_rx()______________________"
1829 "Destination_address:_"
1830 << mach->macDA() <<
"." << std::endl;
1834 <<
")::BEACON_rx()______________________MIN_backoff_"
1839 <<
")::BEACON_rx()______________________MAX_backoff_"
1844 <<
")::BEACON_rx()______________________MAX_number_of_"
1845 "CBEACON_that_HN_will_tx:_"
1853 <<
")::BEACON_rx()______________________Backoff_"
1854 "choice_before_tx_PROBE:_"
1873 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1874 <<
") ::BCKTOExpired() ---->Back-off timeout is expired:"
1875 <<
" so the PROBE packet now can be transmitted by the "
1880 <<
")::BCKTOExpired()___________________PROBE_"
1894 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1895 <<
") ::state_PROBE_tx() ---->NODE create a PROBE packet"
1896 <<
" that will then transmit at the HN with MAC address: "
1903 Packet *p = Packet::alloc();
1904 hdr_cmn *cmh = hdr_cmn::access(p);
1905 hdr_mac *mach = HDR_MAC(p);
1912 mach->macSA() = addr;
1926 <<
")::state_PROBE_tx()_________________PARAMETER_"
1931 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1932 <<
")::state_PROBE_tx()_________________Source_address:_"
1933 << mach->macSA() <<
"." << std::endl;
1936 <<
")::state_PROBE_tx()_________________"
1937 "Destination_address:_"
1938 << mach->macDA() <<
"." << std::endl;
1941 <<
")::state_PROBE_tx()_________________DATA_pck_"
1947 <<
")::state_PROBE_tx()_________________Backoff_"
1952 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
1953 <<
")::state_PROBE_tx()_________________Size_of_PROBE_pck:_"
1954 << cmh->size() <<
"[byte]." << std::endl;
1971 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1972 <<
") ::state_PROBE_tx() ----> NODE has no DATA packet "
1974 <<
" to the HN, then ignore the BEACON received from the "
1975 "HN with MAC address: "
1979 <<
")::state_PROBE_tx()_________________0_DATA_to_"
1980 "tx_so_NO_tx_PROBE_pck."
1986 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1987 <<
") ::state_PROBE_tx() ---->NODE has received the "
1989 <<
" number of CBEACON packet from the HN with MAC "
1992 <<
" return in IDLE STATE." << std::endl;
2026 std::cout << NOW <<
" uwUFetch_NODE(" << addr
2027 <<
") ::PROBE_tx() ---->NODE is transmitting a PROBE packet "
2047 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2048 <<
") ::state_wait_POLL() ---->NODE is waiting for a POLL "
2051 <<
". The maximum waiting time is: " <<
T_POLL << std::endl;
2055 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2056 <<
")::state_wait_POLL()________________Waiting_POLL_pck"
2061 <<
")::state_wait_POLL()________________Waiting_time:_"
2062 <<
T_POLL <<
"[s]." << std::endl;
2065 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2066 <<
")::state_wait_POLL()________________....Waiting_POLL."
2070 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2071 <<
")::state_wait_POLL()________________....Waiting_POLL."
2075 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2076 <<
")::state_wait_POLL()________________....Waiting_POLL."
2099 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2100 <<
") ::PollTOExpired() ---->NODE has received the "
2102 <<
" CBEACON packet from the HN with MAC address: "
2104 <<
" return in IDLE STATE." << std::endl;
2108 <<
")::PollTOExpired()_______________POLL_timeout_"
2109 "EXPIRED:_Max_CBEACON_pck_rx."
2132 <<
")::PollTOExpired()_______________POLL_timeout_"
2133 "EXPIRED:_another_CBEACON_can_be_rx."
2173 <<
")::POLL_rx()________________________"
2174 "PARAMETERS_of_POLL_PACKET:"
2178 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2179 <<
")::POLL_rx()________________________Source_address:_"
2180 << mach->macSA() << std::endl;
2183 <<
")::POLL_rx()________________________"
2184 "Destination_address:_"
2185 << mach->macDA() << std::endl;
2188 <<
")::POLL_rx()________________________DATA_pck_"
2193 <<
")::POLL_rx()________________________MAC_"
2194 "address_of_POLL_rx_("
2205 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2206 <<
") ::POLL_rx() ---->NODE is not enabled to receive the"
2207 <<
" POLL packet: DROP IT." << std::endl;
2211 <<
")::POLL_rx()________________________Not_"
2212 "ENABLED_to_rx_POLL_pck_from_HN("
2213 << mach->macSA() <<
")." << std::endl;
2223 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2224 <<
") ::state_DATA_NODE_first_tx() ---->NODE is starting "
2225 "transmission of the"
2226 <<
" FIRST DATA packet to the HN with MAC address: "
2238 mach->macSA() = addr;
2246 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2247 <<
")::state_DATA_NODE_first_tx()_______DATA_pck_tx:_source("
2248 << mach->macSA() <<
")_"
2249 <<
"destination(" << mach->macDA() <<
")_id_pck:" << cbrh->
sn()
2250 <<
"_size:" << cmh->size() <<
"[byte]" << std::endl;
2262 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2263 <<
") ::DATA_NODE_tx() ---->NODE is transmitting a DATA "
2284 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2285 <<
") ::DataBeforeTxTOExpired() ---->NODE can transmit "
2287 <<
" DATA packet." << std::endl;
2298 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2299 <<
") ::state_DATA_NODE_tx() ---->NODE is starting "
2300 "transmission of the DATA"
2302 <<
" to the HN with MAC"
2314 mach->macSA() = addr;
2322 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2323 <<
")::state_DATA_NODE_tx()_____________DATA_pck_tx:_source("
2324 << mach->macSA() <<
")_"
2325 <<
"destination(" << mach->macDA() <<
")_id_pck:" << cbrh->
sn()
2326 <<
"_size:" << cmh->size() <<
"[byte]" << std::endl;
2338 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2339 <<
") ::state_DATA_NODE_finish_tx() ---->NODE has "
2340 "transmitted all his DATA"
2341 <<
" packets to the HN with MAC address: "
2345 <<
")::state_DATA_NODE_finish_tx()______NODE_has_"
2346 "finished_to_tx_all_DATA_packets_to_the_HN("
2354 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2355 <<
") ::state_DATA_NODE_finish_tx() ---->NODE has "
2356 "received the maximum"
2357 <<
" number of CBEACON packet from the HN with MAC "
2360 <<
" return in IDLE STATE." << std::endl;
2379 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2380 <<
") ::state_DATA_NODE_finish_tx() ---->NODE has not "
2381 "received the maximum"
2382 <<
" number of CBEACON packet from the HN with MAC "
2385 <<
" wait a CBEACON." << std::endl;
2402 double T_CBEACON = 500;
2405 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2406 <<
") ::state_wait_CBEACON() ---->NODE is scheduling CBEACON "
2408 << T_CBEACON <<
"[s]" << std::endl;
2418 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2419 <<
")::state_wait_CBEACON()_____________Waiting_CBEACON_pck"
2423 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2424 <<
")::state_wait_CBEACON()_____________....Waiting_CBEACON_pck"
2428 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2429 <<
")::state_wait_CBEACON()_____________....Waiting_CBEACON_pck"
2433 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2434 <<
")::state_wait_CBEACON()_____________....Waiting_CBEACON_pck"
2445 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2446 <<
") ::CBeaconTOExpired() ---->NODE can not receive other "
2448 <<
" packet from the HN with MAC address: "
2450 <<
" return in IDLE STATE." << std::endl;
2453 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2454 <<
")::CBeaconTOExpired()_______NODE_CBEACON_timeout_expired."
2506 <<
")::CBEACON_rx()_____________________"
2507 "PARAMETERS_of_CBEACON_pck:"
2511 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2512 <<
")::CBEACON_rx()_____________________Source_address:_"
2513 << mach->macSA() <<
". " << std::endl;
2514 if (mach->macDA() == -1) {
2517 <<
")::CBEACON_rx()_____________________"
2518 "Destination_address:_BROADCAST."
2523 <<
")::CBEACON_rx()_____________________"
2524 "Destination address:_"
2525 << mach->macDA() <<
". " << std::endl;
2529 <<
")::CBEACON_rx()_____________________MIN_"
2530 "backoff_time_PROBE_pck:_"
2534 <<
")::CBEACON_rx()_____________________MAX_"
2535 "backoff_time_PROBE_pck:_"
2543 <<
")::CBEACON_rx()_____________________NODE_"
2544 "has_not_yet_tx_DATA_in_this_cycle"
2545 "_so_start_the_tx_of_PROBE."
2561 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2562 <<
") ::CBEACON_rx() ---->NODE has received a "
2564 <<
" has already transmit his DATA packets in the "
2565 "previous cycle: DROP IT."
2575 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2576 <<
") ::CBEACON_rx() ---->NODE has received the "
2578 <<
" number of CBEACON packet from the HN with "
2581 <<
" return in IDLE STATE." << std::endl;
2584 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2585 <<
")::CBEACON_rx()_____________________NODE_has_"
2586 "already_tx_DATA_in_this_cycle_"
2587 <<
"_and_maximum_number_of_CBEACON_rx."
2607 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2608 <<
") ::CBEACON_rx() ---->NODE has not received "
2610 <<
" number of CBEACON packet from the HN with "
2613 <<
" wait other CBEACON packets." << std::endl;
2616 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2617 <<
")::CBEACON_rx()_____________________NODE_has_"
2618 "already_tx_DATA_in_this_cycle_"
2619 <<
"_wait_another_CBEACON." << std::endl;
2630 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2631 <<
") ::CBEACON_r() ---->NODE is not enabled to receive"
2632 <<
" the CBEACON packet: DROP IT." << std::endl;
2645 <<
")::CBEACON_rx()_____________________SN_is_"
2646 "waiting_a_POLL_from_HN("
2647 << mach->macSA() <<
")"
2648 <<
"_but_it_has_rx_CBEACON_from_this_HN."
2652 <<
")::CBEACON_rx()_____________________RESET_"
2653 "POLL_timeout_and_analyzed_CBEACON_pck."
2671 <<
")::CBEACON_rx()_____________________"
2672 "PARAMETERS_of_CBEACON_pck:"
2676 << NOW <<
"uwUFetch_SENSOR_NODE(" << addr
2677 <<
")::CBEACON_rx()_____________________Source_address:_"
2678 << mach->macSA() <<
". " << std::endl;
2679 if (mach->macDA() == -1) {
2682 <<
")::CBEACON_rx()_____________________"
2683 "Destination_address:_BROADCAST."
2688 <<
")::CBEACON_rx()_____________________"
2689 "Destination_address:_"
2690 << mach->macDA() <<
". " << std::endl;
2694 <<
")::CBEACON_rx()_____________________MIN_"
2695 "backoff_time_PROBE_pck:_"
2699 <<
")::CBEACON_rx()_____________________MAX_"
2700 "backoff_time_PROBE_pck:_"
2708 <<
")::CBEACON_rx()_____________________Not_"
2709 "yet_tx_DATA_in_this_cycle"
2710 "_start_tx_of_another_PROBE_pck."
2726 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2727 <<
") ::CBEACON_rx() ---->NODE has received a "
2729 <<
" has already transmit his DATA packets in the "
2730 "previous cycle: DROP IT."
2740 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2741 <<
") ::CBEACON_rx() ---->NODE has received the "
2743 <<
" number of CBEACON packet from the HN with "
2746 <<
" return in IDLE STATE." << std::endl;
2749 <<
")::CBEACON_rx()_____________________"
2750 "DATA_pck_already_tx_in_this_cycle_"
2751 <<
"and_maximum_number_of_CBEACON_pck_rx."
2771 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2772 <<
") ::CBEACON_rx() ---->NODE has not received "
2774 <<
" number of CBEACON packet from the HN with "
2777 <<
" wait other CBEACON packets." << std::endl;
2780 <<
")::CBEACON_rx()_____________________"
2781 "DATA_pck_already_tx_in_this_cycle_"
2782 <<
"and_wait_another_CBEACON_pck."
2786 <<
")::CBEACON_rx()_____________________.."
2787 "..Waiting_CBEACON_pck."
2791 <<
")::CBEACON_rx()_____________________.."
2792 "..Waiting_CBEACON_pck."
2796 <<
")::CBEACON_rx()_____________________.."
2797 "..Waiting_CBEACON_pck."
2828 std::cout << NOW <<
"uwUFetch_NODE(" << addr
2829 <<
") getting Backoff time...Value = " << 0.883 * random
2831 return (0.833 * random);
2837 Packet *simple_pck = Packet::alloc();
2840 hdr_cmn *cmh = HDR_CMN(simple_pck);
2841 hdr_mac *mach = HDR_MAC(simple_pck);
2844 mach->macSA() = addr;
2846 Tprobe = Mac2PhyTxDuration(simple_pck);
2848 hdr_mac *mach = HDR_MAC(simple_pck);
2849 hdr_cmn *cmh = HDR_CMN(simple_pck);
2852 mach->macSA() = addr;
2855 Packet::free(simple_pck);
2874 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2875 <<
") ::recvFromUpperLayers() ---->NODE is queuing a "
2877 <<
" generated by the APPLICATION layer" << std::endl;
2881 <<
")::recvFromUpperLayers()____________DATA_"
2882 "rx_from_upper_layer:id_pck_"
2883 << cbrh->
sn() <<
"_STORE_IT." << std::endl;
2888 std::cout << NOW <<
" uwUFetch_NODE(" << addr
2889 <<
") ::recvFromUpperLayers()--->NODE dropped DATA "
2891 <<
" its buffer is full" << std::endl;
2895 <<
")::recvFromUpperLayers()____________DATA_"
2896 "rx_from_upper_layer:id_pck_"
2897 << cbrh->
sn() <<
"_MEMORY_IS_FULL:_DROP_IT."
2911 if ((module->debug_))
2912 std::cout << NOW <<
"uwUFetch_NODE (" <<
module->addr
2913 << ") ::uwUFetch_BackOffTimer::expire() ---->BACK-OFF "
2918 module->BCKTOExpired();
2924 if ((module->debug_))
2926 << NOW <<
" uwUFetch_NODE (" <<
module->addr
2927 << ")::uwUFetch_POLL_timer::expire() ---->POLL timeout expired"
2931 module->PollTOExpired();
2937 if ((module->debug_))
2938 std::cout << NOW <<
" uwUFetch_NODE (" <<
module->addr
2939 << ") ::uwUFetch_DATA_BEFORE_TX_timer::expire() ---->SINGLE "
2940 "DATA timeout expired"
2944 module->DataBeforeTxTOExpired();
2950 if ((module->debug_))
2951 std::cout << NOW <<
" uwUFetch_NODE (" <<
module->addr
2952 << ") ::uwUFetch_CBeacon_timer::expire() ---->CBEACON "
2957 module->CBeaconTOExpired();
2963 std::string response;
2964 std::cout <<
"Press Enter to continue";
2965 std::getline(std::cin, response);
2971 fout << NOW <<
" uwUFetch_NODE (" << addr <<
") ::printStateInfo() "
< class uwUFetchNODEModuleClass
TclObject * create(int, const char *const *)
uwUFetchNODEModuleClass()
Constructor of uwUFetchNODEModuleClass class.
virtual void expire(Event *e)
Method called when the timer expire.
virtual void expire(Event *e)
Method called when the timer expire.
virtual void expire(Event *e)
Method called when the timer expire.
uwUFetch_NODE *UWUFETCH_TIMER_STATUS timer_status
< Pointer to an object of type uwUFetch_NODE
virtual void schedule(double val)
schedule a timer
virtual void expire(Event *e)
Method called when the timer expire.
Packet * curr_PROBE_NODE_pck_tx
Pointer to the PROBE packet that is being transmitted by SN.
int N_RUN
Indicate the number of the run in execution.
void incrTotalCBeaconPckRx_corrupted_by_NODE()
Increase the total number of corrupted CBEACON packets received by SN during an entire duration of si...
double rx_POLL_finish_time
Indicates when SN finished the reception of POLL packet from HN.
double rx_BEACON_finish_time
Indicates when SN finished the reception of BEACON packet from HN.
int getCBeaconPckRx_by_NODE()
Number of CBEACON packets received by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of ...
uwUFetch_NODE()
Constructor of uwUFetch_NODE class.
bool rxCBEACONEnabled
true if SN is enabled to receive a CBEACON packet from the HN
uwUFetch_CBeacon_timer CBEACON_timer
int getTotalBeaconPckRx_by_NODE()
Total number of BEACON packets received correctly or not by SN during an entire duration of simulatio...
int n_POLL_pck_rx_by_NODE
Number of POLL received by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the simulat...
void incrBeaconPckRx_by_NODE()
Increase the number of BEACON packets received by the SN during a single cycle BEACON-PROBE-POLL-DATA...
UWUFETCH_NODE_STATUS_CHANGE last_reason
Last reason because the SN or HN change its state.
int getTotalPollPckTx_by_HN()
Total number of POLL packets transmitted by the HN during an entire simulation.
int getTotalCtsPckRx_corrupted_HN()
Total number of corrupted CTS packets received by the HN during an entire simulation.
virtual void state_DATA_NODE_finish_tx()
SN has finished to transmit the last DATA packet promises with a PROBE packet to a specif HN.
void incrTotalBeaconPckRx_corrupted_by_NODE()
Increase the total number of corrupted BEACON packets received by SN during an entire duration of sim...
double T_MIN_BACKOFF_PROBE
Lower bound timer interval of back-off value used by the SN to choice its back-off time before to tra...
virtual void DataBeforeTxTOExpired_HN()
Backoff timeout is expired.
virtual void BEACON_rx()
SN received a BEACON packet.
void incrCBeaconPckRx_by_NODE()
Increase the number of CBEACON packets received by the SN during a single cycle BEACON-PROBE-POLL-DAT...
UWUFETCH_NODE_STATUS prev_state
Previous state in which the SN or HN it was located.
double T_GUARD
Guard interval used for successive transmission of DATA packets.
int getTotalTriggerPckRx_corrupted_HN()
Total number of corrupted TRIGGER packets received by the HN during an entire simulation.
void incrDataPckTx_by_NODE()
Increase the number of DATA packets transmitted by the SN during a single cycle BEACON-PROBE-POLL-DAT...
virtual void Phy2MacEndTx_HN(const Packet *p)
Handle the end-of-PHY-transmission event for HEAD NODE.
int n_DATA_pck_tx_by_NODE
Number of DATA transmitted by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the simu...
int MAX_POLLED_NODE
Maximum number of PROBE packets that the HN can receive from the SN after the transmission of a BEACO...
virtual void Phy2MacStartRx_HN(const Packet *p)
Handle the detected-start-of-PHY-reception event for HEAD NODE.
int getTotalProbePckRx_corrupted_HN()
Total number of corrupted PROBE packets received by the HN during an entire simulation.
double T_POLL
Interval time in which the SN wait a POLL packet from the HN.
virtual void stateIdle_HN()
Idle state for HN.
double T_PROBE
Interval time in which HN is enabled to received PROBE packets from SNs after the transmission of TRI...
@ UWUFETCH_TIMER_STATUS_FROZEN
@ UWUFETCH_TIMER_STATUS_IDLE
@ UWUFETCH_TIMER_STATUS_RUNNING
@ UWUFETCH_TIMER_STATUS_EXPIRED
static std::map< UWUFETCH_TIMER_STATUS, std::string > statusTimer
Map the UWUFETCH_TIMER_STATUS to the description of the timers.
bool txDATAEnabled
true if SN is enabled to transmit a DATA packet to the HN
int num_pck_to_tx_by_NODE
Number of DATA packets that the SN at the instant time of BEACON reception has available to transmit ...
virtual int crLayCommand(ClMessage *m)
Cross-Layer messages interpreter.
int MAX_ALLOWED_CBEACON_TX
virtual void BCKTOExpired_HN()
Backoff timeout is expired.
virtual void BCKTOExpired()
Handle the.
virtual void printStateInfo(double delay=0)
Prints a file with every state change for debug purposes.
std::ofstream out_file_logging
Variable that handle the file in which the protocol write the statistics.
virtual void Phy2MacEndRx_HN(Packet *p)
Handle the end-of-PHY-reception event for HEAD NODE.
double T_max_bck_probe_node
Upper bound timer interval used by the SN to choice the interval time before to transmit a PROBE pack...
double TIME_BETWEEN_2_TX_DATA_NODE_HN
Interval time used by the SN before to transmit the next DATA packet to the HN.
double TIME_BETWEEN_2_TX_DATA_HN_AUV
Interval time used by HN before to transmit the next DATA packet to the AUV.
int mac_addr_HN_in_beacon
HN MAC address from which the SN has received PROBE packet.
static bool initialized
Indicate if the protocol has been initialized or not.
int getTotalDataPckRx_by_HN()
Total number of DATA packets correctly or not received by the HN during an entire simulation.
int getTotalPollPckRx_by_NODE()
Total number of POLL packets received correctly or not by SN during an entire duration of simulation.
int debugMio_
Used if we want to create the logging file.
virtual void Mac2PhyStartTx_HN(Packet *p)
This method must be called by the HN-MAC to instruct the PHY to start the transmission of a packet.
int getTotalCBeaconPckTx_by_HN()
Total number of CBEACON packets transmitted by the HN during an entire simulation.
int getTotalDataPckTx_by_NODE()
Total number of DATA packets transmitted by SN during an entire duration of simulation.
int getTotalTriggerPckRx_HN()
Total number of TRIGGER packets correctly or not received by the HN during an entire simulation.
virtual void refreshReason(UWUFETCH_NODE_STATUS_CHANGE reason)
Refresh the reason for the changing of the state.
int getTotalDataPckRx_corrupted_by_HN()
Total number of corrupted DATA packets received by the HN during an entire simulation.
int mac_addr_HN_in_cbeacon
HN MAC address from which the SN has received the CBEACON packet.
Packet * curr_POLL_NODE_pck_rx
Pointer to the POLL packet that is being received by SN.
int HEADNODE
Indicate if the node work as HEAD NODE or SENSOR NODE.
int MODE_COMM_HN_AUV
Indicate the type of communication between HN and AUV, 0 = communication with RTS-CTS,...
int getTotalProbePckRx_HN()
Total number of PROBE packets correctly or not received by the HN during an entire simulation.
int getTotalBeaconPckRx_corrupted_by_NODE()
Total number of corrupted BEACON packets received by SN during an entire duration of simulation.
virtual void Phy2MacEndRx(Packet *p)
Handle the end-of-PHY-reception event.
bool txPROBEEnabled
true if SN is enabled to transmit a PROBE packet to the HN
void incrTotalPollPckRx_corrupted_by_NODE()
Increase the total number of corrupted POLL packets received by SN during an entire duration of simul...
int getDataPckTx_by_NODE()
Number of DATA packets transmitted by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of ...
int getTotalBeaconTx_by_HN()
Total number of BEACON packets transmitted by the HN during an entire simulation.
double tx_DATA_start_time
Indicates when SN start a transmission of DATA packet to the HN.
int MAXIMUM_BUFFER_DATA_PCK_NODE
Maximum number of DATA packets that the SN can store in Its queue.
virtual void DATA_NODE_tx()
SN transmit a DATA packet to a specific HN.
std::ofstream fout
Variable that handle the file in which the protocol write the state transition for debug purposes.
double T_MAX_BACKOFF_PROBE
Upper bound timer interval of back-off value used by the SN to choice its back-off time before to tra...
int n_BEACON_pck_rx_by_NODE
Number of BEACON receive by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the simula...
virtual void initInfo()
Initialize the protocol at the beginning of the simulation.
double rx_CBEACON_start_time
Indicates when SN started the reception of CBEACON packet from HN.
virtual void Mac2PhyStartTx(Packet *p)
This method must be called by the SN-MAC to instruct the PHY to start the transmission of a packet.
virtual void CBeaconTOExpired()
CBEACON timeout is expired.
int num_cbeacon_at_now_HN_tx
NUmber of CBEACON packets transmitted by the HN during the single cycle BEACON-PROBE-POLL-DATA-CBEACO...
int getTotalCBeaconPckRx_by_NODE()
Total number of CBEACON packets received correctly or not by SN during an entire duration of simulati...
void incrTotalBeaconPckRx_by_NODE()
Increase the total number of BEACON packets received correctly or not by SN during an entire duration...
double bck_before_tx_probe
Backoff time choiced by SN before to transmit a PROBE packet to the HN.
int n_CBEACON_pck_rx_by_NODE
Number of CBEACON received by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the simu...
double T_min_bck_probe_node
Lower bound timer interval used by the SN to choice the interval time before to transmit a PROBE pack...
UWUFETCH_NODE_STATUS curr_state
Current state in which the SN or HN is located.
static std::map< UWUFETCH_NODE_PACKET_TYPE, std::string > packetType
Map the UWUFETCH_NODE_PACKET_TYPE to the description of packet type.
void incrTotalPollPckRx_by_NODE()
Increase the total number of POLL packets received correctly or not by SN during an entire duration o...
int mac_addr_HN_in_poll
HN MAC address from which the SN has received the POLL packet.
int getTotalPollPckRx_corrupted_by_NODE()
Total number of corrupted POLL packets received by SN during an entire duration of simulation.
virtual void computeTxTime(UWUFETCH_NODE_PACKET_TYPE tp)
Compute the transmission time for the packets transmitted by the SNs.
void incrProbePckTx_by_NODE()
Increase the number of PROBE packets transmitted by the SN during a single cycle BEACON-PROBE-POLL-DA...
int getTotalCBeaconPckRx_corrupted_by_NODE()
Total number of corrupted CBEACON packets received by SN during an entire duration of simulation.
Packet * curr_BEACON_NODE_pck_rx
Pointer to the BEACON packet that is being received by SN.
int getTotalCtsPckRx_HN()
Total number of CTS packets correctly or not received by the HN during an entire simulation.
uwUFetch_BackOffTimer BCK_timer_probe
Interval time in which HN is enabled to receive PROBE packets from SNs.
double tx_DATA_finish_time
Indicates when SN finished a transmission of DATA packet to the HN.
int getTotalDataPckTx_by_HN()
Total number of DATA packets transmitted by the HN during an entire simulation.
uwUFetch_DATA_BEFORE_TX_timer DATA_BEFORE_TX_timer
virtual void CBEACON_rx()
SN has received a CBEACON packet from HN.
double rx_POLL_start_time
Indicates when SN started the reception of POLL packet from HN.
virtual void state_PROBE_tx()
SN initialize the PROBE packet that will be forwarded to a specific HN.
bool rxPOLLEnabled
true if SN is enabled to receive a POLL packet from the HN
double rx_BEACON_start_time
Indicates when SN started the reception of BEACON packet from HN.
virtual void recvFromUpperLayers_HN(Packet *p)
Handle a packet coming from upper layers of HN.
int MAX_PAYLOAD
Maximum size of payload DATA packet.
virtual void PollTOExpired()
POLL timeout is expired.
virtual void recvFromUpperLayers(Packet *p)
Handle a packet coming from upper layers of SN.
double tx_PROBE_start_time
Indicates when SN start a transmission of PROBE packet.
double Tdata_NODE_pck
Time duration need for SN for transmit a DATA packet to the HN.
double Tdata_NODE
Time duration needed for SN to transmit a DATA packet to the HN.
void incrTotalCBeaconPckRx_by_NODE()
Increase the total number of CBEACON packets received correctly or not by SN during an entire duratio...
virtual void state_wait_CBEACON()
SN wait a CBEACON packet for a pre-established interval time.
virtual bool isHeadNode()
Indicate if the node created work as head node or sensor node.
double tx_PROBE_finish_time
Indicates when SN finished a transmission of PROBE packet.
UWUFETCH_NODE_PACKET_TYPE
@ UWUFETCH_NODE_PACKET_TYPE_CTS
@ UWUFETCH_NODE_PACKET_TYPE_PROBE
@ UWUFETCH_NODE_PACKET_TYPE_BEACON
@ UWUFETCH_NODE_PACKET_TYPE_RTS
@ UWUFETCH_NODE_PACKET_TYPE_DATA
@ UWUFETCH_NODE_PACKET_TYPE_POLL
@ UWUFETCH_NODE_PACKET_TYPE_TRIGGER
virtual double choiceBackOffTimer()
Choose the backoff timeout used by SN before to transmit a PROBE packet.
int MODE_BURST_DATA
Indicate if it's used or not the burst data.
void incrTotalDataPckTx_by_NODE()
Increase the total number of DATA packets transmitted by SN during an entire duration of simulation.
virtual void stateIdle_NODE()
Idle state for SN.
virtual void Phy2MacStartRx(const Packet *p)
Handle the detected-start-of-PHY-reception event for SENSOR NODE.
virtual ~uwUFetch_NODE()
Destructor of uwUFetch_NODE class.
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_MAX_ALLOWED_PCK_RX_0_NODE_TO_POLL_NO_OTHER_CBEACON
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_PCK_TX
@ UWUFETCH_NODE_STATUS_CHANGE_MAX_DATA_PCK_TX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_MAX_ALLOWED_PCK_RX_0_NODE_TO_POLL_YES_OTHER_CBEACON
@ UWUFETCH_NODE_STATUS_CHANGE_TRIGGER_RX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_RX
@ UWUFETCH_NODE_STATUS_CHANGE_PROBE_TX
@ UWFETCH_NODE_STATUS_CHANGE_CBEACON_RX_DATA_ALREADY_TX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_TO_EXPIRED_ANOTHER_NODE_TO_POLL
@ UWUFETCH_NODE_STATUS_CHANGE_TO_WAIT_POLL_EXPIRED
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_ALLOWED_TX_0_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_TO_EXPIRED_0_NODE_TO_POLL_YES_OTHER_CBEACON
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_TX
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_MAX_ALLOWED_TX
@ UWUFETCH_NODE_STATUS_CHANGE_HN_RX_TRIGGER_FROM_AUV_CORRUPTED
@ UWUFETCH_NODE_STATUS_CHANGE_RTS_TX
@ UWFETCH_NODE_STATUS_CHANGE_PACKET_UNKNOWN_TYPE
@ UWUFETCH_NODE_STATUS_CHANGE_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_LAST_DATA_PCK_RX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_TO_EXPIRED
@ UWFETCH_NODE_STATUS_CHANGE_STATE_IDLE
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_TO_EXPIRED_0_NODE_TO_POLL_NO_OTHER_CBEACON
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_MAX_ALLOWED_TX_0_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_POLL_TX
@ UWUFETCH_NODE_STATUS_CHANGE_POLL_RX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_MAX_ALLOWED_PCK_RX_YES_NODE_TO_POLL
@ UWUFETCH_NODE_STATUS_CHANGE_CTS_RX
@ UWUFETCH_NODE_STATUS_CHANGE_BEACON_RX
@ UWUFETCH_NODE_STATUS_CHANGE_BEACON_TO_EXPIRED
@ UWUFETCH_NODE_STATUS_CHANGE_TO_WAIT_CTS_EXPIRED
@ UWUFETCH_NODE_STATUS_CHANGE_TO_EXPIRED_AT_LEAST_1_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_TRIGGER_RX_BUT_HN_NO_DATA_TO_TX
@ UWFETCH_NODE_STATUS_CHANGE_PACKET_FOR_ANOTHER_NODE
@ UWFETCH_NODE_STATUS_CHANGE_PACKET_ERROR
@ UWUFETCH_NODE_STATUS_CHANGE_BEACON_TX
@ UWUFETCH_NODE_STATUS_CHANGE_HN_FINISH_TX_DATA_PCK_TO_AUV_RETURN_CBEACON_TX
@ UWUFETCH_NODE_STATUS_CHANGE_HN_TX_ALL_DATA_TO_AUV
@ UWUFETCH_NODE_STATUS_CHANGE_MAX_PROBE_RX_PROBE_TO_NOT_EXPIRED
Packet * curr_CBEACON_NODE_pck_rx
Pointer to the CBEACON packet that is being received by SN
bool rxBEACONEnabled
true if SN is enabled to receive a BEACON packet from the HN
bool dataAlreadyTransmitted
Indicate whether the SN has transmit at least one DATA packets during the cycle BEACON-PROBE-POLL-DAT...
int getTotalRtsPckTx_by_HN()
Total number of RTS packets transmitted by the HN during an entire simulation.
double Tprobe
Time duration needed for SN to transmit a PROBE packet to the HN.
int MAX_PCK_HN_WANT_RX_FROM_NODE
int getTotalProbePckTx_by_NODE()
Total number of PROBE packets transmitted by SN during an entire duration of simulation.
static std::map< UWUFETCH_NODE_STATUS_CHANGE, std::string > statusChange
Map the UWUFETCH_NODE_STATUS_CHANGE to the description the reason of changing state.
static std::map< UWUFETCH_NODE_STATUS, std::string > statusInfo
Map the UWUFETCH_NODE_STATUS to the description of each state.
int PRINT_TRANSITIONS_INT
0 reason because the SN or HN is passed from a state to another state is not logged in a file
virtual void state_DATA_NODE_first_tx()
SN initialize the FIRST DATA packet that will be forwarded to a specific HN.
void incrTotalProbePckTx_by_NODE()
Increase the total number of PROBE packets transmitted by SN during an entire duration of simulation.
double T_START_PROCEDURE_HN_NODE
Time within HN is enabled to received a TRIGGER packet from AUV.
virtual void state_wait_POLL()
SN wait a POLL packet from a specific HN.
std::queue< Packet * > Q_data
Queue of DATA packets stored by the SN.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
uwUFetch_POLL_timer POLL_timer
Interval time in which SN is enabled to receive POLL packet from the specific HN.
int n_PROBE_pck_tx_by_NODE
Number of PROBE transmitted by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the sim...
virtual void PROBE_tx()
Transmission of PROBE packet by SN to the specific HN.
void incrPollPckRx_by_NODE()
Increase the number of POLL packets received by the SN during a single cycle BEACON-PROBE-POLL-DATA-C...
virtual void waitForUser()
Method used for debug.
Packet * curr_DATA_NODE_pck_tx
Pointer to the DATA packet that is being transmitted by SN.
virtual void state_DATA_NODE_tx()
SN initialize the second or successive DATA packet that will be forwarded to a specific HN.
virtual void POLL_rx()
SN has received a POLL packet from a specific HN.
bool print_transitions
true if the writing of state transitions in the file is enabled.
int getProbePckTx_by_NODE()
Number of PROBE packets transmitted by the SN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of...
virtual void refreshState(UWUFETCH_NODE_STATUS state)
virtual void Phy2MacEndTx(const Packet *p)
Handle the end-of-PHY-transmission event.
virtual void DataBeforeTxTOExpired()
Data timeout.
@ UWUFETCH_NODE_STATUS_PROBE_RX
@ UWUFETCH_NODE_STATUS_WAIT_CBEACON_PACKET
@ UWUFETCH_NODE_STATUS_POLL_TX
@ UWUFETCH_NODE_STATUS_WAIT_CTS_PACKET
@ UWUFETCH_NODE_STATUS_CBEACON_RECEIVE
@ UWUFETCH_NODE_STATUS_TRIGGER_RECEIVE
@ UWUFETCH_NODE_STATUS_POLL_RECEIVE
@ UWUFETCH_NODE_STATUS_BEACON_RECEIVE
@ UWUFETCH_NODE_STATUS_CTS_RECEIVE
@ UWUFETCH_NODE_STATUS_WAIT_DATA_NODE
@ UWUFETCH_NODE_STATUS_WAIT_POLL_PACKET
@ UWUFETCH_NODE_STATUS_TRANSMIT_PROBE
@ UWUFETCH_NODE_STATUS_WAIT_PROBE_PACKET
@ UWUFETCH_NODE_STATUS_DATA_RX
@ UWUFETCH_NODE_STATUS_TRANSMIT_DATA
@ UWUFETCH_NODE_STATUS_TRANSMIT_BEACON
@ UWUFETCH_NODE_STATUS_IDLE
@ UWUFETCH_NODE_STATUS_RTS_TRANSMIT
int num_cbeacon_node_rx
Number of CBEACON that the node have received from the specific HN before to receive an another BEACO...
Content header of BEACON packet.
int & t_max_bc()
Reference to t_max_bc_ variable.
int & num_Max_CBEACON_tx_by_HN()
Reference to num_Max_CBEACON_tx_by_HN_ variable.
int & t_min_bc()
Reference to t_min_bc_ variable.
Content header of CBEACON packet.
int & t_max_bc()
Reference to t_max_bc_ variable.
int & t_min_bc()
Reference to t_min_bc_ variable.
int & num_Max_CBEACON_tx_by_HN()
Reference to num_Max_CBEACON_tx_by_HN_ variable.
Content header of POLL packet.
int & num_DATA_pcks_MAX_rx()
Reference to num_DATA_pcks_MAX_rx variable.
Content header of PROBE packet.
int & n_DATA_pcks_Node_tx()
Reference to n_DATA_pcks_Node_tx_ variable.
int & backoff_time_PROBE()
Reference to backoff_time_PROBE_ variable.
hdr_uwcbr describes UWCBR packets.
uint16_t & sn()
Reference to the sn_ variable.
Declaration of uwUFetch_NODE class.
packet_t PT_POLL_UFETCH
POLL packet type for UFetch protocol.
#define UWFETCH_NODE_DROP_REASON_ERROR
Packet dropped: packet is corrupted.
#define UWUFETCH_NODE_DROP_REASON_BUFFER_FULL
Packet dropped: buffer of the node is completely full.
packet_t PT_CBEACON_UFETCH
CBEACON packet type for UFetch protocol.
packet_t PT_TRIGGER_UFETCH
TRIGGER packet type for UFetch protocol.
packet_t PT_BEACON_UFETCH
BEACON packet type for UFetch protocol.
#define UWUFETCH_NODE_DROP_CAN_NOT_RX_THIS_PCK
Packet dropped: node can not receive this type of node.
#define UWFETCH_NODE_DROP_REASON_WRONG_RECEIVER
Packet dropped: Packet is addressed to another node.
packet_t PT_PROBE_UFETCH
PROBE packet type for UFetch protocol.
#define UWUFETCH_NODE_DROP_REASON_NOT_ENABLE
Packet dropped: node is not enabled to receive this type of \ packet.
uwUFetchNODEModuleClass class_module_uwufetchnode
Common structures and variables in the protocol.
#define HDR_BEACON_UFETCH(p)
alias defined to access the BEACON HEADER
#define HDR_POLL_UFETCH(p)
alias defined to access the POLL \ HEADER
#define HDR_CBEACON_UFETCH(p)
alias defined to access the CBEACON HEADER
static const int v_speed_sound
Underwater sound propagation speed.
#define HDR_PROBE_UFETCH(p)
alias defined to access the PROBE HEADER
Provides the UWCBR packets header description and the definition of the class UWCBR.