59 hdr_cmn *cmh = hdr_cmn::access(p);
60 hdr_mac *mach = HDR_MAC(p);
61 int src_mac_addr = mach->macSA();
67 << NOW <<
" uwUFetch_NODE (" << addr
68 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
69 <<
" BEACON packet from the HN with MAC address: "
70 << src_mac_addr << std::endl;
74 <<
")::Phy2MacStartRx()____________________Start "
76 <<
" from HN(" << src_mac_addr <<
")."
83 << NOW <<
" uwUFetch_NODE (" << addr
84 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
85 <<
" POLL packet from the HN with MAC address: "
86 << src_mac_addr << std::endl;
90 <<
")::Phy2MacStartRx()______________________"
91 "Start to rx POLL pck"
92 <<
" from HN(" << src_mac_addr <<
")."
99 << NOW <<
" uwUFetch_NODE (" << addr
100 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
101 <<
" CBEACON packet from the HN with MAC address: "
102 << src_mac_addr << std::endl;
106 <<
")::Phy2MacStartRx()______________________"
107 "Start to rx CBEACON pck"
108 <<
" from HN(" << src_mac_addr <<
")."
115 << NOW <<
" uwUFetch_NODE (" << addr
116 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
117 <<
" PROBE packet from the NODE with MAC address: "
118 << src_mac_addr << std::endl;
122 <<
")::Phy2MacStartRx()______________________"
123 "Start to rx PROBE pck"
124 <<
" from SENSOR NODE(" << src_mac_addr <<
")."
132 std::cout << NOW <<
" uwUFetch_NODE (" << addr
133 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a"
134 <<
" TRIGGER packet from the AUV with MAC address: "
135 << src_mac_addr << std::endl;
139 <<
")::Phy2MacStartRx()______________________"
140 "Start to rx TRIGGER pck"
141 <<
" from AUV(" << src_mac_addr <<
")."
150 << NOW <<
" uwUFetch_NODE (" << addr
151 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
152 <<
" CTS packet from the AUV with MAC address: "
153 << src_mac_addr << std::endl;
157 <<
")::Phy2MacStartRx()______________________"
158 "Start to rx CTS pck"
159 <<
" from AUV(" << src_mac_addr <<
")."
168 << NOW <<
" uwUFetch_NODE (" << addr
169 <<
") ::Phy2MacStartRx() ---->HN is starting to receive a "
170 <<
" DATA packet from the NODE with MAC address: "
171 << src_mac_addr << std::endl;
175 <<
")::Phy2MacStartRx()______________________"
176 "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
177 "DDDDDDDDDDDDDDDDDDDDDD"
182 <<
")::Phy2MacStartRx()______________________"
183 "Start to rx DATA pck"
184 <<
" from SN(" << src_mac_addr <<
")."
200 hdr_cmn *cmh = hdr_cmn::access(p);
201 hdr_mac *mach = HDR_MAC(p);
202 int src_mac_addr = mach->macSA();
203 int dest_mac_addr = mach->macDA();
207 std::cout << NOW <<
"uwUFetch_NODE(" << addr
208 <<
")::Phy2MacEndRx()______________________dest_mac_addr "
209 << dest_mac_addr << std::endl;
212 if ((dest_mac_addr == addr) || (dest_mac_addr == MAC_BROADCAST)) {
218 std::cout << NOW <<
" uwUFetch_NODE (" << addr
219 <<
") ::Phy2MacEndRx() ---->HN has finished to "
221 <<
" BEACON packet from the HN with MAC address: "
222 << src_mac_addr <<
" .DROP IT" << std::endl;
226 <<
")::Phy2MacEndRx()________________________"
227 "Finished to rx BEACON"
228 <<
" pck from HN(" << src_mac_addr <<
")."
233 <<
")::Phy2MacEndRx()________________________"
234 "BEACON not addressed to me: DROP IT."
242 std::cout << NOW <<
" uwUFetch_NODE (" << addr
243 <<
") ::Phy2MacEndRx() ---->HN has finished to "
245 <<
" CBEACON packet from the HN with MAC address: "
246 << src_mac_addr <<
" .DROP IT." << std::endl;
250 <<
")::Phy2MacEndRx()________________________"
251 "Finished to rx CBEACON"
252 <<
" pck from HN(" << src_mac_addr
253 <<
"): IGNORE IT." << std::endl;
260 std::cout << NOW <<
" uwUFetch_NODE (" << addr
261 <<
") ::Phy2MacEndRx() ---->HN has finished to "
263 <<
" PROBE packet from the NODE with MAC address: "
264 << src_mac_addr << std::endl;
268 <<
")::Phy2MacEndRx()________________________"
269 "Finished to rx PROBE"
270 <<
" pck from SENSOR NODE(" << src_mac_addr
271 <<
")." << std::endl;
276 std::cout << NOW <<
" uwUFetch_NODE (" << addr
277 <<
") ::Phy2MacEndRx() ---->PROBE packet "
279 <<
" is corrupted: DROP IT." << std::endl;
283 <<
")::Phy2MacEndRx()_____________________"
284 "___PROBE pck rx from SN("
285 << src_mac_addr <<
") It's in ERROR."
295 <<
")::Phy2MacEndRx()_____________________"
296 "___Total number of PROBE"
301 <<
")::Phy2MacEndRx()_____________________"
302 "___Total number of CORRUPTED PROBE"
308 <<
")::Phy2MacEndRx()_____________________"
309 "___Total number of CORRECT PROBE"
322 std::cout << NOW <<
" uwUFetch_NODE (" << addr
323 <<
") ::Phy2MacEndRx() ---->Physical layer "
325 <<
" address: " << dest_mac_addr
326 <<
" has finished to receive a PROBE packet"
328 <<
" from the NODE with MAC address: "
329 << src_mac_addr << std::endl;
333 <<
")::Phy2MacEndRx()_________________"
334 "_______PROBE pck rx from SN("
335 << src_mac_addr <<
") It's CORRECT."
345 <<
")::Phy2MacEndRx()_________________"
346 "_______Total number of PROBE"
351 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
352 <<
")::Phy2MacEndRx()________________________"
353 "Total number of CORRUPTED PROBE"
358 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
359 <<
")::Phy2MacEndRx()________________________"
360 "Total number of CORRECT PROBE"
377 std::cout << NOW <<
" uwUFetch_NODE (" << addr
378 <<
") ::Phy2MacEndRx() ---->HN is not "
379 "enabled to receive the PROBE"
380 <<
" packet: DROP IT." << std::endl;
383 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
384 <<
")::Phy2MacEndRx()________________________"
385 "Now not ENABLED to rx PROBE pck from SN("
386 << src_mac_addr <<
")." << std::endl;
404 << NOW <<
" uwUFetch_NODE (" << addr
405 <<
") ::Phy2MacEndRx() ---->HN has finished to "
407 <<
" TRIGGER packet from the AUV with MAC address: "
408 << src_mac_addr << std::endl;
412 <<
")::Phy2MacEndRx()_____________________"
413 "___Finished to rx TRIGGER pck"
414 <<
" from AUV(" << src_mac_addr <<
")."
428 while ((!
Q_data.empty()) &&
445 if ((cmh->error()) || (
Q_data_HN.empty())) {
449 std::cout << NOW <<
" uwUFetch_NODE (" << addr
450 <<
") ::Phy2MacEndRx() ---->TRIGGER "
451 "packet received by the HN"
452 <<
" is corrupted: DROP IT" << std::endl;
456 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
457 <<
")::Phy2MacEndRx()______________________"
458 "__TRIGGER rx from AUV("
459 << mach->macSA() <<
") It's in ERROR."
473 std::cout << NOW <<
" uwUFetch_NODE (" << addr
474 <<
") ::Phy2MacEndRx() ---->HN reset "
479 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
480 <<
")::Phy2MacEndRx()__________________"
481 "______TRIGGER rx in ERROR && HN is "
482 "enabled to rx It: IGNORE It."
490 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
491 <<
")::Phy2MacEndRx()__________________"
492 "______Reset the TRIGGER timeout"
503 std::cout << NOW <<
" uwUFetch_NODE (" << addr
504 <<
") ::Phy2MacEndRx() ---->HN is "
505 "not enabled to receive"
506 <<
" the TRIGGER packet: DROP IT."
510 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
511 <<
")::Phy2MacEndRx()__________________"
512 "______TRIGGER in error && Not "
514 <<
" to rx It: IGNORE It." << std::endl;
518 std::cout << NOW <<
" uwUFetch_NODE (" << addr
519 <<
") ::Phy2MacEndRx() ---->TRIGGER "
520 "packet received by the HN"
521 <<
" is not corrupted, but the HN has 0 "
522 "DATA packet enabled to tx to the "
529 <<
")::Phy2MacEndRx()_____________"
530 "___________TRIGGER rx It's "
531 "CORRECT but 0 DATA to tx."
544 std::cout << NOW <<
" uwUFetch_NODE (" << addr
545 <<
") ::Phy2MacEndRx() ---->HN reset "
553 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
554 <<
")::Phy2MacEndRx()__________________"
555 "______TRIGGER rx CORRECT, 0 DATA "
556 "to tx && enabled to rx It: IGNORE "
562 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
563 <<
")::Phy2MacEndRx()__________________"
564 "______Reset the TRIGGER timeout"
575 std::cout << NOW <<
" uwUFetch_NODE (" << addr
576 <<
") ::Phy2MacEndRx() ---->HN is "
577 "not enabled to receive"
578 <<
" the TRIGGER packet: DROP IT."
583 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
584 <<
")::Phy2MacEndRx()__________________"
585 "______TRIGGER rx CORRECT, 0 DATA "
586 "to tx && not enabled to rx It: "
594 std::cout << NOW <<
" uwUFetch_NODE (" << addr
595 <<
") ::Phy2MacEndRx() ---->Physical layer "
597 <<
" address: " << dest_mac_addr
598 <<
" has finished to receive a TRIGGER packet"
599 <<
" from the AUV with MAC address: "
600 << src_mac_addr << std::endl;
604 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
605 <<
")::Phy2MacEndRx()________________________"
606 "TRIGGER rx It's CORRECT >= 1 DATA to tx."
627 std::cout << NOW <<
" uwUFetch_NODE (" << addr
628 <<
") ::Phy2MacEndRx() ---->HN has finished to "
630 <<
" CTS packet from the AUV with MAC address: "
631 << src_mac_addr << std::endl;
635 <<
")::Phy2MacEndRx()________________________"
636 "Finished to rx CTS pck"
637 <<
" from AUV(" << src_mac_addr <<
")."
644 std::cout << NOW <<
" uwUFetch_NODE (" << addr
645 <<
") ::Phy2MacEndRx() ---->CTS packet "
647 <<
" is corrupted: DROP IT" << std::endl;
650 <<
")::Phy2MacEndRx()_________________"
651 "_______CTS pck rx from AUV("
652 << src_mac_addr <<
") It's in ERROR."
667 std::cout << NOW <<
" uwUFetch_NODE (" << addr
668 <<
") ::Phy2MacEndRx() ---->HN reset the "
670 <<
" and return in IDLE STATE." << std::endl;
673 <<
")::Phy2MacEndRx()_________________"
674 "_______RESET CTS timeout."
693 std::cout << NOW <<
" uwUFetch_NODE (" << addr
694 <<
") ::Phy2MacEndRx() ---->Physical layer "
696 <<
" address: " << dest_mac_addr
697 <<
" has finished to receive a CTS packet"
698 <<
" from the AUV with MAC address: "
699 << src_mac_addr << std::endl;
704 <<
")::Phy2MacEndRx()_________________"
705 "_______CTS pck rx from AUV("
706 << src_mac_addr <<
") It's CORRECT."
710 std::cout << NOW <<
" uwUFetch_NODE (" << addr
711 <<
") ::Phy2MacEndRx() ---->HN reset the "
713 <<
" and COMPUTE IT." << std::endl;
716 <<
")::Phy2MacEndRx()_________________"
717 "_______RESET CTS timeout."
739 std::cout << NOW <<
" uwUFetch_NODE (" << addr
740 <<
") ::Phy2MacEndRx() ---->HN is not enabled to "
742 <<
" the CTS packet: DROP IT." << std::endl;
745 <<
")::Phy2MacEndRx()_____________________"
746 "___CTS pck rx from AUV("
748 <<
"). It's not enabled to rx It."
758 std::cout << NOW <<
" uwUFetch_NODE (" << addr
759 <<
") ::Phy2MacEndRx() ---->HN has finished to "
761 <<
" DATA packet from the NODE with MAC address: "
762 << src_mac_addr << std::endl;
768 <<
")::Phy2MacEndRx()________________________"
769 "End to rx DATA pck "
770 <<
"from SN(" << src_mac_addr <<
")."
775 <<
")::Phy2MacEndRx()________________________"
783 std::cout << NOW <<
" uwUFetch_NODE( " << addr
784 <<
") ::Phy2MacEndRx() ---->DATA packet received "
786 <<
" is corrupted: DROP IT" << std::endl;
796 <<
")::Phy2MacEndRx()_____________________"
797 "___DATA pck rx from SN("
798 << src_mac_addr <<
")"
799 <<
" It's in ERROR." << std::endl;
802 <<
")::Phy2MacEndRx()_____________________"
803 "___DATA pck number "
805 <<
" rx It's in ERROR." << std::endl;
808 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
809 <<
")::Phy2MacEndRx()________________________"
810 "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
811 "DDDDDDDDDDDDDDDDDDDDD"
821 std::cout << NOW <<
" uwUFetch_NODE (" << addr
822 <<
") ::Phy2MacEndRx() ---->Physical layer of HN "
824 <<
" address: " << dest_mac_addr
825 <<
" has finished to receive a DATA packet"
827 <<
" from the NODE with MAC address: "
828 << src_mac_addr << std::endl;
832 <<
")::Phy2MacEndRx()_____________________"
833 "___DATA pck rx from SN("
834 << src_mac_addr <<
")"
835 <<
" It's CORRECT." << std::endl;
838 <<
")::Phy2MacEndRx()_____________________"
839 "___DATA pck number "
841 <<
" It's CORRECT." << std::endl;
860 std::cout << NOW <<
" uwUFetch_NODE (" << addr
861 <<
") ::Phy2MacEndRx() ---->The packet received is not "
863 <<
" DROP IT." << std::endl;
868 std::cout << NOW <<
" uwUFetch_NODE (" << addr
869 <<
") ::Phy2MacEndRx() ---->HN has finished to "
871 <<
" POLL packet from the HN with MAC address: "
872 << src_mac_addr <<
" .DROP IT" << std::endl;
876 <<
")::Phy2MacEndRx()________________________"
877 "Finished to rx POLL"
878 <<
" pck from HN(" << src_mac_addr
879 <<
"). Not addressed to me: IGNORE IT."
887 std::cout << NOW <<
" uwUFetch_NODE (" << addr
888 <<
") ::Phy2MacEndRx() ---->HN has finished to "
890 <<
" PROBE packet from the SENSOR NODE with MAC "
892 << src_mac_addr <<
" .DROP IT" << std::endl;
895 <<
")::Phy2MacEndRx()________________________"
896 "Finished to rx PROBE"
897 <<
" pck from SENSOR NODE(" << src_mac_addr
898 <<
")." << std::endl;
902 <<
")::Phy2MacEndRx()________________________"
903 "Finished to rx PROBE"
904 <<
" pck from SENSOR NODE(" << src_mac_addr
905 <<
"). Not addressed to me: IGNORE IT."
913 std::cout << NOW <<
" uwUFetch_NODE (" << addr
914 <<
") ::Phy2MacEndRx() ---->HN has finished to "
916 <<
" TRIGGER packet from the AUV with MAC address ("
917 << src_mac_addr <<
").DROP IT" << std::endl;
921 <<
")::Phy2MacEndRx()________________________"
922 "Finished to rx TRIGGER"
923 <<
" pck from AUV(" << src_mac_addr
924 <<
"). Not addressed to me: IGNORE IT."
932 std::cout << NOW <<
" uwUFetch_NODE (" << addr
933 <<
") ::Phy2MacEndRx() ---->HN has finished to "
935 <<
" POLL packet from the HN with MAC address: "
936 << src_mac_addr <<
" .DROP IT" << std::endl;
940 <<
")::Phy2MacEndRx()________________________"
942 <<
" pck from AUV(" << src_mac_addr
943 <<
"). Not addressed to me: IGNORE IT."
951 std::cout << NOW <<
" uwUFetch_NODE (" << addr
952 <<
") ::Phy2MacEndRx() ---->HN has finished to "
954 <<
" DATA packet from the SENSOR NODE with MAC "
956 << src_mac_addr <<
" .DROP IT" << std::endl;
960 <<
")::Phy2MacEndRx()________________________"
961 "End to rx DATA pck "
962 <<
"from SN(" << src_mac_addr <<
")."
967 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
968 <<
") ::Phy2MacEndRx()________________________DATA pck"
969 <<
" rx from SN(" << src_mac_addr
970 <<
") is not addressed to me: IGNORE IT." << std::endl;
973 <<
")::Phy2MacEndRx()________________________"
974 "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
975 "DDDDDDDDDDDDDDDDDDDDDDDDDD"
987 hdr_cmn *cmh = hdr_cmn::access(p);
988 hdr_mac *mach = HDR_MAC(p);
992 std::cout << NOW <<
" uwUFetch_NODE (" << addr
993 <<
") ::Mac2PhyStartTx() ---->MAC layer of the HN passes "
995 <<
" packet to his physical layer." << std::endl;
997 if (mach->macDA() == -1) {
1000 <<
")::Mac2PhyStartTx_HN()___________________"
1001 "Start tx of BEACON pck in BROADCAST."
1006 <<
")::Mac2PhyStartTx_HN()___________________"
1007 "Start tx of BEACON pck to SENSOR NODE("
1008 << mach->macDA() <<
")." << std::endl;
1012 MMac::Mac2PhyStartTx(p);
1017 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1018 <<
") ::Mac2PhyStartTx() ---->MAC layer of HN passes the "
1020 <<
" packet to his physical layer." << std::endl;
1024 <<
")::Mac2PhyStartTx_HN()___________________"
1025 "Start tx of POLL pck to the SENSOR NODE("
1030 MMac::Mac2PhyStartTx(p);
1035 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1036 <<
") ::Mac2PhyStartTx() ---->MAC layer of the HN passes "
1038 <<
" packet to his physical layer." << std::endl;
1042 <<
")::Mac2PhyStartTx_HN()___________________"
1043 "Start tx of CBEACON pck in BROADCAST."
1048 MMac::Mac2PhyStartTx(p);
1053 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1054 <<
") ::Mac2PhyStartTx() ---->MAC layer of the HN passes "
1056 <<
" packet to his physical layer." << std::endl;
1060 <<
")::Mac2PhyStartTx_HN()___________________"
1061 "Start tx of RTS pck to the AUV("
1066 MMac::Mac2PhyStartTx(p);
1071 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1072 <<
") ::Mac2PhyStartTx() ---->MAC layer of the HN passes "
1074 <<
" packet to his physical layer." << std::endl;
1077 <<
")::Mac2PhyStartTx_HN()___________________"
1078 "Start tx of DATA pck"
1084 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
1085 <<
")::Mac2PhyStartTx_HN()___________________DATA pck"
1095 MMac::Mac2PhyStartTx(p);
1110 hdr_cmn *cmh = hdr_cmn::access(p);
1116 << NOW <<
" uwUFetch_NODE (" << addr
1117 <<
") ::Phy2MacEndTx() ---->Physical layer of HN has "
1119 <<
" to transmit a BEACON packet to the NODEs in broadcast."
1124 <<
")::Phy2MacEndTx()________________________End "
1125 "the tx of BEACON pck in BROADCAST."
1129 <<
")::Phy2MacEndTx()________________________"
1130 "Total number of BEACON tx "
1145 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1146 <<
") ::Phy2MacEndTx() ---->Physical layer of the HN has "
1148 <<
" to transmit a POLL packet to the NODE with MAC "
1154 <<
")::Phy2MacEndTx()________________________End "
1155 "the tx of POLL pck to the SENSOR NODE"
1171 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1172 <<
") ::Phy2MacEndTx() ---->Physical layer of the HN has "
1174 <<
" to transmit a CBEACON packet to the NODEs in "
1179 <<
")::Phy2MacEndTx()________________________End "
1180 "the tx of CBEACON pck in BROADCAST."
1184 <<
")::Phy2MacEndTx()________________________"
1185 "Total number of CBEACON tx "
1202 << NOW <<
" uwUFetch_NODE (" << addr
1203 <<
") ::Phy2MacEndTx() ---->Physical layer of the HN has "
1205 <<
" to transmit a RTS packet to the AUV with MAC address: "
1209 <<
")::Phy2MacEndTx()________________________End "
1210 "the tx of RTS pck to the AUV("
1225 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1226 <<
") ::Phy2MacEndTx() ---->Physical layer of the HN has "
1228 <<
" to transmit a DATA to the AUV with MAC address: "
1238 <<
")::Phy2MacEndTx()________________________End "
1241 <<
")." << std::endl;
1245 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
1246 <<
")::Phy2MacEndTx()________________________DATA pck"
1251 <<
")::Phy2MacEndTx()________________________"
1252 "Total DATA pck tx by HN("
1255 <<
"." << std::endl;
1258 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
1259 <<
")::Phy2MacEndTx()________________________**************"
1260 "*****************************************"
1264 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1265 <<
") ::Phy2MacEndTx() ---->GET DATA PCK TX BY HN "
1267 <<
" to transmit a DATA to the AUV with MAC address: "
1291 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1292 <<
") ::stateIdle_HN() ---->HN before to start the "
1293 "communication with"
1294 <<
" sensor node or AUV, empty his data queue." << std::endl;
1312 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1313 <<
") ::stateIdle_HN() ---->HN is in IDLE STATE" << std::endl;
1316 <<
")::stateIdle_HN()________________________HN is in "
1362 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1363 <<
") ::stateIdle_HN() ---->HN before to start the "
1365 <<
" with SENSOR NODES wait an interval time equal to: "
1366 << 15 <<
"[s]." << std::endl;
1384 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1385 <<
") ::stateIdle_HN() ---->HN waits a TRIGGER "
1386 "packets from the AUV"
1387 <<
" for an interval time equal to: "
1389 <<
" [s] before to start the communication"
1390 <<
" with the SENSOR NODEs." << std::endl;
1402 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1403 <<
") ::stateIdle_HN() ---->HN waits a TRIGGER "
1404 "packets from the AUV"
1405 <<
" for an interval time equal to: "
1407 <<
"[s] before to start the communication"
1408 <<
" with the SENSOR NODEs." << std::endl;
1420 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1421 <<
") ::BeaconTxTOExpire() ---->HN start the procedure for "
1423 <<
" with the SENSOR NODEs, reception of TRIGGER packet is "
1429 <<
")::BeaconTxTOExpire()____________________HN start "
1430 "communication with SENSOR_NODE"
1472 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1473 <<
") ::TRIGGER_rx() ---->HN reset the TRIGGER timer"
1478 <<
")::TRIGGER_rx()_________________________"
1479 "TRIGGER rx It's CORRECT && >= 1 DATA to "
1480 "tx && enabled to rx It."
1485 <<
")::TRIGGER_rx()__________________________"
1486 "TRIGGER pck rx, extract the parameters."
1521 <<
")::TRIGGER_rx()__________________________"
1522 "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
1523 "TTTTTTTTTTTTTTTTTTTTTTTTTT"
1527 <<
")::TRIGGER_rx()__________________________"
1528 "PARAMETERS of TRIGGER PACKET. "
1532 <<
")::TRIGGER_rx()__________________________"
1534 << mach->macSA() <<
"." << std::endl;
1535 if (mach->macDA() == -1) {
1538 <<
")::TRIGGER_rx()_______________________"
1539 "___Destination Address: BROADCAST."
1544 <<
")::TRIGGER_rx()_______________________"
1545 "___Destination Address: "
1546 << mach->macDA() << std::endl;
1550 <<
")::TRIGGER_rx()__________________________"
1551 "MIN backoff time RTS pck: "
1555 <<
")::TRIGGER_rx()__________________________"
1556 "MAX backoff time RTS pck: "
1560 <<
")::TRIGGER_rx()__________________________"
1561 "MAX DATA pck want rx from HN: "
1565 <<
")::TRIGGER_rx()__________________________"
1566 "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
1567 "TTTTTTTTTTTTTTTTTTTTTTTTTT"
1576 <<
")::TRIGGER_rx()__________________________"
1577 "Backoff timeout choice: "
1585 << NOW <<
" uwUFetch_NODE (" << addr
1586 <<
") ::TRIGGER_rx() ---->HN is not enabled to receive"
1587 <<
" the TRIGGER packet: DROP IT." << std::endl;
1591 <<
")::TRIGGER_rx()_________________________"
1592 "TRIGGER rx It's CORRECT && >= 1 DATA to "
1593 "tx && not enabled to rx It:IGNORE It."
1598 <<
")::TRIGGER_rx()__________________________"
1600 <<
" to rx TRIGGER pck." << std::endl;
1618 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1619 <<
") ::BCKTOExpired() ---->Back-off timeout is expired:"
1620 <<
" so the first DATA packet can be transmitted by the "
1626 <<
")::BCKTOExpired()________________________"
1627 "Backoff timeout is expired."
1642 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1643 <<
") ::state_RTS_tx() ---->HN with MAC address " << addr
1645 <<
" a RTS packet that will then transmit to the AUV "
1646 "with MAC address: "
1650 <<
")::state_RTS_tx()________________________"
1651 "Initializing RTS pck."
1658 Packet *p = Packet::alloc();
1659 hdr_cmn *cmh = hdr_cmn::access(p);
1660 hdr_mac *mach = HDR_MAC(p);
1667 mach->macSA() = addr;
1682 <<
")::state_RTS_tx()________________________"
1683 "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
1684 "RRRRRRRRRRRRRRRRRRRRRR"
1688 <<
")::state_RTS_tx()________________________"
1689 "PARAMETERS of RTS PACKET. "
1693 <<
")::state_RTS_tx()________________________"
1695 << mach->macSA() <<
"." << std::endl;
1696 if (mach->macDA() == -1) {
1699 <<
")::state_RTS_tx()________________________"
1700 "Destination Address: BROADCAST."
1705 <<
")::state_RTS_tx()________________________"
1706 "Destination Address: "
1711 <<
")::state_RTS_tx()________________________RTS "
1712 "backoff time choice by HN: "
1716 <<
")::state_RTS_tx()________________________"
1717 "Number of pck HN would like to tx: "
1721 <<
")::state_RTS_tx()________________________"
1722 "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
1723 "RRRRRRRRRRRRRRRRRRRRRR"
1733 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1734 <<
") ::state_RTS_tx() ----> HN with MAC address" << addr
1736 <<
" packet to be transmitted to the HN, then ignore the "
1737 "TRIGGER received from the AUV with"
1739 <<
", and return in IDLE STATE." << std::endl;
1742 <<
")::state_RTS_tx()________________________0 "
1743 "DATA pck to tx: NO tx RTS pck."
1767 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1768 <<
") ::RTS_tx() ---->HN with MAC address: " << addr
1769 <<
" is transmitting"
1770 <<
" a RTS packet to the AUV with MAC address: "
1783 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1784 <<
") ::state_wait_CTS() ---->HN with MAC address: " << addr
1786 <<
" waiting the CTS packet from AUV with MAC address: "
1788 <<
" waiting time is: " <<
T_CTS << std::endl;
1796 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1797 <<
") ::state_wait_CTS() ---->CTS timer insert by the "
1798 "user for waiting a CTS"
1799 <<
" packet is negative, so use the default value 20[s]"
1806 <<
")::state_wait_CTS()______________________Waiting "
1807 "a CTS pck from AUV("
1811 <<
")::state_wait_CTS()______________________......."
1816 <<
")::state_wait_CTS()______________________......."
1821 <<
")::state_wait_CTS()______________________......."
1863 std::cout << NOW <<
" uwUFetch_NODE (" << addr
1864 <<
") ::CtsTOExpired() ---->Timeout CTS expired. HN has not "
1866 <<
" CTS packet within the pre-established time interval "
1867 "that is equal to: "
1869 <<
" so return in IDLE STATE." << std::endl;
1872 <<
")::CtsTOExpired()________________________CTS "
1928 <<
")::CTS_rx()______________________________"
1929 "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
1930 "SSSSSSSSSSSSSSSSSS"
1934 <<
")::CTS_rx()______________________________"
1935 "PARAMETERS of CTS PACKET. "
1939 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
1940 <<
")::CTS_rx()______________________________Source address: "
1941 << mach->macSA() <<
"." << std::endl;
1942 if (mach->macDA() == -1) {
1945 <<
")::CTS_rx()______________________________"
1946 "Destination Address: BROADCAST."
1951 <<
")::CTS_rx()______________________________"
1952 "Destination Address: "
1953 << mach->macDA() <<
"." << std::endl;
1957 <<
")::CTS_rx()______________________________DATA pck "
1962 <<
")::CTS_rx()______________________________"
1963 "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
1964 "SSSSSSSSSSSSSSSSSS"
1999 << NOW <<
" uwUFetch_NODE (" << addr
2000 <<
") ::state_DATA_HN_first_tx() ---->HN will be transmit "
2002 <<
" DATA packets to the AUV with MAC address: "
2007 <<
")::state_DATA_HN_first_tx()______________DATA "
2013 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2014 <<
") ::state_DATA_HN_first_tx() ---->HN is starting "
2015 "transmission of the"
2016 <<
" FIRST DATA packet to the AUV with MAC address: "
2020 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2021 <<
")::state_DATA_HN_first_tx()______________**************"
2022 "*****************************************"
2026 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2027 <<
")::state_DATA_HN_first_tx()______________Initializing"
2039 mach->macSA() = addr;
2069 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2070 <<
") ::DATA_HN_tx() ---->HN is transmitting a DATA "
2086 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2087 <<
") ::DataBeforeTxTOExpired() ---->HN can transmit the next"
2088 <<
" DATA packet." << std::endl;
2104 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2105 <<
") ::state_DATA_HN_tx() ---->HN is starting "
2106 "transmission of the"
2108 <<
" to the AUV with"
2112 <<
")::state_DATA_HN_tx()____________________*****"
2113 "*************************"
2117 <<
")::state_DATA_HN_tx()____________________"
2120 <<
"." << std::endl;
2130 mach->macSA() = addr;
2159 <<
")::state_DATA_HN_finish_tx()_____________End "
2160 "tx DATA pcks to the AUV."
2168 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2169 <<
") ::state_DATA_HN_finish_tx() ---->HN has "
2170 "transmitted all his DATA"
2171 <<
" packets to the AUV with MAC address: "
2173 <<
", so return in STATE_CBEACON_TX()." << std::endl;
2190 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2191 <<
") ::state_DATA_HN_finish_tx() ---->HN has "
2192 "transmitted all his DATA"
2193 <<
" packets to the AUV with MAC address: "
2220 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2221 <<
") ::state_BEACON_tx() ---->HN is initializing the BEACON "
2223 <<
" which will then transmit to the NODEs in broadcast."
2228 <<
")::state_BEACON_tx()_____________________"
2229 "Initializing BEACON pck."
2236 Packet *p = Packet::alloc();
2237 hdr_cmn *cmh = hdr_cmn::access(p);
2238 hdr_mac *mach = HDR_MAC(p);
2243 mach->set(MF_CONTROL, addr, MAC_BROADCAST);
2246 mach->macSA() = addr;
2265 <<
")::state_BEACON_tx()_____________________"
2266 "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
2267 "BBBBBBBBBBBBBBBBBB"
2271 <<
")::state_BEACON_tx()_____________________"
2272 "PARAMETERS of BEACON pck."
2276 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2277 <<
")::state_BEACON_tx()_____________________Source address: "
2278 << mach->macSA() <<
"." << std::endl;
2279 if (mach->macDA() == -1) {
2282 <<
")::state_BEACON_tx()_____________________"
2283 "Destination address: BROADCAST."
2288 <<
")::state_BEACON_tx()_____________________"
2289 "Destination address: "
2290 << mach->macDA() <<
"." << std::endl;
2294 <<
")::state_BEACON_tx()_____________________MIN "
2295 "backoff time PROBE pck: "
2299 <<
")::state_BEACON_tx()_____________________MAX "
2300 "backoff time PROBE pck: "
2304 <<
")::state_BEACON_tx()_____________________MAX "
2305 "number of CBEACON that HN will tx: "
2309 <<
")::state_BEACON_tx()_____________________Size of "
2311 << cmh->size() <<
"[byte]." << std::endl;
2314 <<
")::state_BEACON_tx()_____________________"
2315 "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
2316 "BBBBBBBBBBBBBBBBBB"
2336 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2337 <<
") ::BEACON_tx() ---->HN is transmitting a BEACON packet"
2338 <<
" to the NODEs in broadcast." << std::endl;
2353 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2354 <<
") ::state_PROBE_wait() ---->HN is scheduling PROBE TIMER "
2356 <<
T_PROBE <<
"[s]" << std::endl;
2364 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2365 <<
") ::state_wait_PROBE() ---->The waiting time for "
2366 "PROBE packets is negative"
2367 <<
" so set the default value: 15[s]." << std::endl;
2372 <<
")::state_wait_PROBE()____________________Waiting "
2378 <<
")::state_wait_PROBE()____________________Timeout "
2380 <<
" pcks " <<
T_PROBE <<
"[s]." << std::endl;
2383 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2384 <<
")::state_wait_PROBE()____________________....waiting PROBE"
2388 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2389 <<
")::state_wait_PROBE()____________________....waiting PROBE"
2393 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2394 <<
")::state_wait_PROBE()____________________....waiting PROBE"
2408 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2409 <<
") ::ProbeTOExpired() ---->PROBE timeout is expired: other"
2410 <<
" PROBE packets can not be received by the HN."
2415 <<
")::ProbeTOExpired()______________________PROBE "
2423 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2424 <<
") ::ProbeTOExpired() ---->HN has received 0 PROBE "
2426 <<
" it has reached the maximum number of attempts to "
2427 "transmit CBEACON packets."
2432 <<
")::ProbeTOExpired()______________________0 "
2433 "PROBE rx && MAX CBEACON tx."
2460 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2461 <<
") ::ProbeTOExpired() ---->HN has received 0 PROBE "
2463 <<
" has not reached the maximum number of attempts to "
2464 "transmit CBEACON packets"
2469 <<
")::ProbeTOExpired()______________________0 "
2470 "PROBE rx && another CBEACON can be tx."
2491 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2492 <<
") ::ProbeTOExpired() ---->HN has received "
2494 <<
" PROBE packets, so start a new transmission of POLL "
2500 <<
")::ProbeTOExpired()______________________The "
2501 "number of PROBE rx is "
2547 <<
")::PROBE_rx()____________________________PROBE "
2553 <<
")::PROBE_rx()____________________________"
2554 "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP"
2555 "PPPPPPPPPPPPPPPPPP"
2559 <<
")::PROBE_rx()____________________________"
2560 "PARAMETERS OF PROBE PCK."
2564 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2565 <<
")::PROBE_rx()____________________________Source address: "
2566 << mach->macSA() << std::endl;
2569 <<
")::PROBE_rx()____________________________"
2570 "Destination address: "
2571 << mach->macDA() << std::endl;
2574 <<
")::PROBE_rx()____________________________DATA pck "
2580 <<
")::PROBE_rx()____________________________Backoff "
2581 "time choice before tx PROBE: "
2583 <<
"[s]." << std::endl;
2586 <<
")::PROBE_rx()____________________________"
2587 "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP"
2588 "PPPPPPPPPPPPPPPPPP"
2597 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2598 <<
") ::PROBE_Rx() ---->HN has received the maximum "
2600 <<
" packets and the timeout is not expired. Consequence "
2601 "of that, the HN with MAC address: "
2603 <<
" not receive other PROBEs packets." << std::endl;
2606 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2607 <<
") ::PROBE_Rx() ---->HN reset the PROBE timer"
2608 <<
" and start the transmission of POLL packets."
2613 <<
")::PROBE_rx()____________________________MAX "
2614 "number of PROBE pck rx: reset PROBE timeout."
2629 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2630 <<
") ::PROBE_Rx() ---->Timeout is not expired and "
2632 <<
" packet can be received by the HN with MAC address: "
2633 << addr <<
" from other NODEs." << std::endl;
2645 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2646 <<
") ::state_wait_other_PROBE() ---->HN is waiting the "
2653 <<
")::state_wait_other_PROBE()______________Waiting "
2654 "another PROBE pck from"
2659 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2660 <<
")::state_wait_other_PROBE()______________PROBE number "
2665 <<
")::state_wait_other_PROBE()______________...."
2666 "waiting another PROBE."
2670 <<
")::state_wait_other_PROBE()______________...."
2671 "waiting another PROBE."
2675 <<
")::state_wait_other_PROBE()______________...."
2676 "waiting another PROBE."
2691 << NOW <<
" uwUFetch_NODE (" << addr
2692 <<
") ::state_POLL_tx() ---->HN is creating a POLL packet that"
2693 <<
" will then transmit at the first node of the queue that "
2694 "contain the PROBEs received. "
2699 <<
")::state_POLL_tx()_______________________"
2700 "Initializing POLL pck."
2707 Packet *p = Packet::alloc();
2708 hdr_cmn *cmh = hdr_cmn::access(p);
2709 hdr_mac *mach = HDR_MAC(p);
2716 mach->macSA() = addr;
2744 <<
")::state_POLL_tx()_______________________"
2745 "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL"
2746 "LLLLLLLLLLLLLLLLLL"
2750 <<
")::state_POLL_tx()_______________________"
2751 "PARAMETERS OF POLL PCK."
2755 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2756 <<
")::state_POLL_tx()_______________________Source address: "
2757 << mach->macSA() << std::endl;
2760 <<
")::state_POLL_tx()_______________________"
2761 "Destination address: "
2762 << mach->macDA() << std::endl;
2765 <<
")::state_POLL_tx()_______________________DATA pck "
2771 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2772 <<
")::state_POLL_tx()_______________________Size of POLL pck: "
2773 << cmh->size() <<
"[byte]." << std::endl;
2776 <<
")::state_POLL_tx()_______________________"
2777 "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL"
2778 "LLLLLLLLLLLLLLLLLL"
2798 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2799 <<
") ::POLL_tx() ---->HN is transmitting a POLL packet to "
2818 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2819 <<
") ::state_wait_first_DATA() ---->HN is waiting to "
2820 "receive the FIRST DATA"
2821 <<
" packet from the NODE with MAC address: "
2833 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2834 <<
") ::state_wait_first_DATA() ---->HN want to receive all "
2843 <<
")::state_wait_first_DATA()_______________Waiting "
2850 <<
")::state_wait_first_DATA()_______________Timeout "
2851 "within rx all DATA"
2856 <<
")::state_wait_first_DATA()_______________......."
2861 <<
")::state_wait_first_DATA()_______________......."
2866 <<
")::state_wait_first_DATA()_______________......."
2881 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2882 <<
") ::state_wait_other_DATA() ---->HN is waiting the DATA "
2890 <<
")::state_wait_other_DATA()_______________Waiting "
2891 "DATA packet number: "
2894 <<
")." << std::endl;
2917 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2918 <<
") ::DataTOExpired() ---->HN has received from the NODE "
2925 <<
")::DataTOExpired()_______________________DATA "
2926 "timeout is expired other DATA packets"
2927 <<
" can not be rx from SENSOR NODE ("
2946 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2947 <<
") ::DataTOExpired() ---->HN has not other nodes to "
2949 <<
" a CBEACON packet can not be transmitted: return in "
2955 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
2956 <<
")::DataTOExpired()_______________________0 SENSOR NODE "
2957 "to polled && MAX CBEACON can be tx."
2986 std::cout << NOW <<
" uwUFetch_NODE (" << addr
2987 <<
") ::DataTOExpired() ---->HN has not other nodes to "
2989 <<
" a CBEACON packet can be transmitted: transmit a "
2995 <<
")::DataTOExpired()_______________________0 "
2996 "SENSOR NODE to polled && CBEACON can be tx."
3022 << NOW <<
" uwUFetch_NODE (" << addr
3023 <<
") ::DataTOExpired() ---->HN has other nodes to polled."
3028 <<
")::DataTOExpired()_______________________"
3029 "Another SENSOR NODE can be polled."
3076 <<
")::DATA_rx()_____________________________DATA "
3078 << mach->macSA() <<
")"
3079 <<
" is passed to the APP layer." << std::endl;
3082 <<
")::DATA_rx()_____________________________DATA "
3087 <<
")::DATA_rx()_____________________________"
3088 "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
3089 "DDDDDDDDDDDDDDDDDDDDDD"
3093 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3094 <<
") ::DATA_Rx() ---->HN has received the DATA packet"
3096 <<
" from the NODE with"
3109 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3110 <<
") ::DATA_rx() ---->HN has received the LAST DATA "
3117 <<
")::DATA_rx()_____________________________"
3120 <<
")." << std::endl;
3125 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3126 <<
") ::DATA_rx() ---->HN reset DATA timer"
3130 <<
")::DATA_rx()_____________________________"
3131 "Reset DATA Timeout."
3145 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3146 <<
") ::DATA_rx() ---->HN has not other nodes to "
3148 <<
" a CBEACON packet can not be transmitted: "
3149 "return in IDLE STATE."
3154 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
3155 <<
")::DATA_rx()_____________________________0 SNs "
3156 "to polled && MAX CBEACON is tx."
3179 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3180 <<
") ::DATA_rx() ---->HN has not other nodes to "
3182 <<
" a CBEACON packet can be transmitted: "
3183 "transmit a CBEACON"
3188 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
3189 <<
")::DATA_rx()_____________________________0 SNs "
3190 "to polled && another CBEACON can be tx."
3208 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3209 <<
") ::DATA_rx() ---->HN has other nodes to "
3215 <<
")::DATA_rx()__________________________"
3216 "___Another SNs can be polled."
3235 << NOW <<
" uwUFetch_NODE (" << addr
3236 <<
") ::DATA_rx() ---->HN wait an another DATA packet,"
3238 <<
", from NODE with MAC "
3248 <<
")::DATA_rx()_____________________________Not "
3249 "enabled to rx DATA pcks."
3253 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3254 <<
") DATA_rx() ---->HN(" << addr
3255 <<
") is not enabled to receive the DATA"
3256 <<
" packet: DROP IT." << std::endl;
3274 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3275 <<
") ::state_CBEACON_tx() ---->HN is initializing the "
3277 <<
" which will then transmit to the NODEs in broadcast. "
3282 <<
")::state_CBEACON_tx()____________________"
3283 "Initializing CBEACON pck number "
3291 Packet *p = Packet::alloc();
3292 hdr_cmn *cmh = hdr_cmn::access(p);
3293 hdr_mac *mach = HDR_MAC(p);
3298 mach->set(MF_CONTROL, addr, MAC_BROADCAST);
3301 mach->macSA() = addr;
3320 <<
")::state_CBEACON_tx()____________________"
3321 "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
3322 "CCCCCCCCCCCCCCCCCC"
3326 <<
")::state_CBEACON_tx()____________________"
3327 "PARAMETERS of CBEACON pck."
3331 << NOW <<
"uwUFetch_HEAD_NODE(" << addr
3332 <<
")::state_CBEACON_tx()____________________Source address: "
3333 << mach->macSA() <<
"." << std::endl;
3334 if (mach->macDA() == -1) {
3337 <<
")::state_CBEACON_tx()____________________"
3338 "Destination address: BROADCAST."
3343 <<
")::state_CBEACON_tx()____________________"
3344 "Destination address: "
3345 << mach->macDA() <<
"." << std::endl;
3349 <<
")::state_CBEACON_tx()____________________MIN "
3350 "backoff time PROBE pck: "
3354 <<
")::state_CBEACON_tx()____________________MAX "
3355 "backoff time PROBE pck: "
3359 <<
")::state_CBEACON_tx()____________________Size of "
3361 << cmh->size() <<
"[byte]." << std::endl;
3364 <<
")::state_CBEACON_tx()____________________"
3365 "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
3366 "CCCCCCCCCCCCCCCCCC"
3387 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3388 <<
") ::CBEACON_tx() ---->HN is transmitting a CBEACON packet"
3389 <<
" to the NODEs in broadcast." << std::endl;
3405 if (mode_comm_hn_auv == 1) {
3419 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3420 <<
") choiceBackOffTimer() ---->HN is choosing the "
3426 std::cout << NOW <<
" uwUFetch_NODE(" << addr
3427 <<
") ::choiceBackOffTimer() ---->Back-off time choice "
3429 << 0.833 * random <<
"[s]." << std::endl;
3430 return (0.833 * random);
3435 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3436 <<
") choiceBackOffTimer() ---->HN is choosing the "
3442 std::cout << NOW <<
" uwUFetch_NODE(" << addr
3443 <<
") ::choiceBackOffTimer() ---->Back-off time choice "
3445 << 0.833 * random <<
"[s]." << std::endl;
3446 return (0.833 * random);
3456 << NOW <<
" uwUFetch_NODE (" << addr
3457 <<
") ::getDataTimerValue() ---->HN is computing DATA timeout."
3463 int pck_tx_number = 0;
3471 double data_timeout_val = 0;
3474 return data_timeout_val;
3483 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3484 <<
") ::recvFromUpperLayers() ---->HN is queuing a DATA "
3486 <<
" generated by the APPLICATION layer" << std::endl;
3490 <<
")::recvFromUpperLayer()__________________DATA "
3491 "pck from upper layer:STORE It."
3495 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3496 <<
") ::recvFromUpperLayers()--->HN dropped DATA packet "
3498 <<
" its buffer is full" << std::endl;
3501 <<
")::recvFromUpperLayer()__________________DATA "
3502 "pck from upper layer:BUFFER FULL, drop It."
3512 Packet *simple_pck = Packet::alloc();
3515 hdr_cmn *cmh = HDR_CMN(simple_pck);
3517 hdr_mac *mach = HDR_MAC(simple_pck);
3519 mach->macSA() = addr;
3521 Tpoll = Mac2PhyTxDuration(simple_pck);
3524 hdr_cmn *cmh = HDR_CMN(simple_pck);
3525 hdr_mac *mach = HDR_MAC(simple_pck);
3528 mach->macSA() = addr;
3530 Tdata_HN = Mac2PhyTxDuration(simple_pck);
3533 Packet::free(simple_pck);
3556 std::cout << NOW <<
" uwUFetch_NODE (" << addr
3557 <<
") ::updateListProbbedNode() ---->HN has finished to "
3558 "receive DATA packet from the NODE with"
3560 <<
", so remove the NODE from the list." << std::endl;
3574 if ((module->debug_))
3575 std::cout << NOW <<
" uwUFetch_NODE (" <<
module->addr
3576 << ") ::uwUFetch_BEACON_timer::expire() ---->BEACON timeout "
3581 module->BeaconTxTOExpire();
3588 if ((module->debug_))
3589 std::cout << NOW <<
" uwUFetch_NODE (" <<
module->addr
3590 << ")::uwUFetch_PROBE_timer::expire() ---->PROBE timeout "
3595 module->ProbeTOExpired();
3601 if ((module->debug_))
3603 << NOW <<
" uwUFetch_NODE (" <<
module->addr
3604 << ") ::uwUFetch_DATA_timer::expire() ---->DATA timeout expired"
3608 module->DataTOExpired();
3614 if ((module->debug_))
3615 std::cout << NOW <<
" uwUFetch_NODE (" <<
module->addr
3616 << ")::uwUFetch_CTS_timer::expire() ---->CTS timeout expired"
3620 module->CtsTOExpired();
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.
std::queue< double > Q_probbed_backoff_time
Queue that stored the backoff time choice by the single nodes before to transmit the PROBE packet to ...
double data_timeout
Interval time in which the HN want to receive all DATA packets from the node that have polled.
double tx_POLL_finish_HN_time
Indicates when HN finished the transmission of POLL packet to a specific SN.
void incrTotalDataPckRx_by_HN()
Increase total number of DATA packets correctly or not received by the HN during an entire simulation...
virtual void state_BEACON_tx()
HN initialize the BEACON packet that will be forwarded in broadcast at all SNs of the network.
UWUFETCH_NODE_STATUS_CHANGE last_reason
Last reason because the SN or HN change its state.
virtual void state_DATA_HN_finish_tx()
HN has finished to transmit the sequence of DATA packets promises to the AUV with the exchange of pre...
double T_max_bck_DATA
Upper bound time interval from which the HN choice its backoff timer before to transmit a DATA packet...
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...
int n_BEACON_pck_tx_by_HN
Number of BEACON packet transmitted by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of...
double bck_before_tx_RTS
Time value choice by the HN and used for transmit a RTS packet to the AUV.
virtual void state_DATA_HN_first_tx_without()
HN initialize the FIRST DATA packet that will be forwarded to the AUV node.
virtual void DataBeforeTxTOExpired_HN()
Backoff timeout is expired.
bool CTSrx
true HN has received a CTS packet after the transmission of RTS
virtual void CBEACON_tx()
HN transmit the BEACON packet.
double T_GUARD
Guard interval used for successive transmission of DATA packets.
virtual void state_DATA_HN_finish_tx_without()
HN has finished to transmit the sequence of DATA packets to the AUV.
virtual void Phy2MacEndTx_HN(const Packet *p)
Handle the end-of-PHY-transmission event for HEAD NODE.
Packet * curr_RTS_HN_pck_tx
Pointer to the RTS packet that is being transmitted by HN.
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.
bool txDATAEnabledHN
true if HN is enabled to transmit a DATA packet to the AUV
virtual double choiceBackOffTimer_HN()
Choose the backoff timeout used by HN before to transmit a RTS packet.
int getDataPckRx_by_HN()
Number of DATA packets transmitted by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of ...
int getTotalProbePckRx_corrupted_HN()
Total number of corrupted PROBE packets received by the HN during an entire simulation.
void incrProbePckRx_HN()
Increase number of PROBE packets received by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEA...
virtual void stateIdle_HN()
Idle state for HN.
double tx_DATA_finish_HN_time
Indicates when HN finished the transmission of DATA packet to the AUV.
double T_PROBE
Interval time in which HN is enabled to received PROBE packets from SNs after the transmission of TRI...
@ UWUFETCH_TIMER_STATUS_EXPIRED
virtual void BeaconTxTOExpire()
BEACON timeout is expired.
virtual void state_wait_CTS()
HN start to wait a CTS packet for a pre-established time interval.
double tx_CBEACON_start_HN_time
Indicates when HN started the transmission of CBEACON packet to the SNs.
double tx_POLL_start_HN_time
Indicates when HN started the transmission of POLL packet to a specific SN.
int MAX_ALLOWED_CBEACON_TX
bool rxCTSEnabled
true if HN is enabled to receive a CTS packet from the AUV
Packet * curr_CBEACON_HN_pck_tx
Pointer to the CBEACON packet that is being transmitted by HN.
virtual void state_DATA_HN_first_tx()
HN initialize the FIRST DATA packet that will be forwarded to the AUV node.
virtual void DATA_rx()
HN has received a BEACON packet from SN.
virtual void BCKTOExpired_HN()
Backoff timeout is expired.
virtual void computeTxTime_HN(UWUFETCH_NODE_PACKET_TYPE tp)
Compute the transmission time for the packets transmitted by the HNs.
virtual void printStateInfo(double delay=0)
Prints a file with every state change for debug purposes.
virtual void ProbeTOExpired()
Probe timeout is expired.
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 tx_RTS_finish_HN_time
Indicates when HN finished the transmission of RTS packet to the AUV.
virtual void Phy2MacEndRx_HN_without(Packet *p)
Handle the end-of-PHY-reception event for HEAD NODE in the case that the communication don't use RTS-...
double rx_TRIGGER_start_HN_time
Indicates when HN started the reception of TRIGGER packet from the AUV.
int n_CBEACON_pck_tx_by_HN
Number of CBEACON packet transmitted by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON o...
virtual void state_wait_other_PROBE()
HN start to wait the second or successive PROBE packet from some SNs.
virtual void BCKTOExpired_HN_without()
Backoff timeout is expired.
double TIME_BETWEEN_2_TX_DATA_HN_AUV
Interval time used by HN before to transmit the next DATA packet to the AUV.
virtual void updateListProbbedNode()
Update the list of the SN from which HN has received the PROBE packets.
virtual void DATA_HN_tx_without()
HN transmit a DATA packet to the AUV.
double rx_DATA_finish_HN_time
Indicates when HN finished the reception of DATA packet from the SNs.
double T_max_bck_RTS
Upper bound interval time from which the HN choice his backoff timer before to transmit a RTS packet ...
void incrPollPckTx_by_HN()
Increase the number of POLL packets transmitted by the HN during a single cycle BEACON-PROBE-POLL-DAT...
double T_min_bck_RTS
Lower bound interval time from which the HN choice its backoff timer before to transmit a RTS packet ...
void incrTotalTriggerPckRx_HN()
Increase the total number of TRIGGER packets correctly or not received by the HN during an entire sim...
int debugMio_
Used if we want to create the logging file.
void incrTotalDataPckRx_corrupted_by_HN()
Increase total number of corrupted DATA packets received by the HN during an entire simulation.
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.
bool txRTSEnabled
true if HN is enabled to transmit a RTS packet to the AUV
virtual double getDataTimerValue()
Compute the interval time within HN want to receive all DATA packets from a specific SN.
void incrBeaconPckTx_by_HN()
Increase the number of BEACON packet transmitted by the HN during a single cycle BEACON-PROBE-POLL-DA...
int getTotalCBeaconPckTx_by_HN()
Total number of CBEACON packets transmitted by the HN during an entire simulation.
bool sectionCBeacon
true HN has started the transmission of RTS packet when It was in the CBEACON section.
int number_data_pck_HN_rx_exact
Exact number of DATA packets that the HN want to receive from the SN that have polled.
virtual void refreshReason(UWUFETCH_NODE_STATUS_CHANGE reason)
Refresh the reason for the changing of the state.
Packet * curr_TRIGGER_HN_pck_rx
Pointer to the TRIGGER packet that is being received by HN.
int getTotalProbePckRx_HN()
Total number of PROBE packets correctly or not received by the HN during an entire simulation.
double rx_PROBE_start_HN_time
Indicates when HN started the reception of PROBE packet from the SNs.
bool txBEACONEnabled
true if HN is enabled to transmit a BEACON packet to the SN
int mac_addr_AUV_in_trigger
AUV-MAC address contained in the TRIGGER packet received by the HN.
Packet * curr_BEACON_HN_pck_tx
Pointer to the BEACON packet that is being transmitted by HN.
void incrDataPckTx_by_HN()
Increase the number of DATA packets transmitted by the HN during a single cycle TRIGGER-RTS-CTS-DATA ...
bool rxPROBEEnabled
true if HN is enabled to receive a PROBE packet from the SN
std::queue< Packet * > Q_data_HN
Queue of DATA packets stored by the HNs and received from SN.
virtual void state_DATA_HN_tx()
HN initialize the second and successive DATA packets that will be forwarded to the AUV node.
virtual void BEACON_tx()
HN transmit the BEACON packet.
Packet * curr_DATA_NODE_pck_tx_HN
Pointer to the DATA packet that is being transmitted by HN.
int getTotalBeaconTx_by_HN()
Total number of BEACON packets transmitted by the HN during an entire simulation.
int MAXIMUM_BUFFER_DATA_PCK_NODE
Maximum number of DATA packets that the SN can store in Its queue.
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...
void incrTotalPollPckTx_by_HN()
Increase the total number of POLL packets transmitted by the HN during an entire simulation.
double tx_BEACON_start_HN_time
Indicates when HN started the transmission of BEACON packet to the SNs.
double rx_CTS_start_HN_time
Indicates when HN started the reception of CTS packet from the AUV.
void incrDataPckRx_by_HN()
Increase the number of DATA packets transmitted by the HN during a single cycle BEACON-PROBE-POLL-DAT...
bool txPOLLEnabled
true if HN is enabled to transmit a POLL packet to the SN
virtual void state_wait_PROBE()
HN start to wait the FIRST PROBE packet from some SNs.
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.
std::queue< int > Q_probbed_mac_HN
Queue that store the MAC address of the SN from which the HN has received correctly the PROBE packets...
bool rxTRIGGEREnabled
true if HN is enabled to receive a TRIGGER packet from the AUV
void incrTotalBeaconPckTx_by_HN()
Increase the total number of BEACON packets transmitted by the HN during an entire simulation.
double rx_DATA_start_HN_time
Indicates when HN started the reception of DATA packet from the SNs.
virtual void state_DATA_HN_tx_without()
HN initialize the second and successive DATA packets that will be forwarded to the AUV node.
double tx_RTS_start_HN_time
Indicates when HN started the transmission of RTS packet to the AUV.
virtual double getRTT()
Compute the round trip time.
virtual void state_wait_first_DATA()
HN start to wait the FIRST DATA packet from SN.
void incrTotalTriggerPckRx_corrupted_HN()
Increase the total number of corrupted TRIGGER packets received by the HN during an entire simulation...
void incrRtsPckTx_by_HN()
Increase the number of RTS packets transmitted by the HN during a single cycle TRIGGER-RTS-CTS-DATA o...
int n_POLL_pck_tx_by_HN
Number of POLL packet transmitted by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of t...
void incrTotalDataPckTx_by_HN()
Increase the total number of DATA packets transmitted by the HN during an entire simulation.
virtual void CTS_rx()
HN has received a CTS packet from AUV.
int getDataPckTx_by_HN()
Number of DATA packets transmitted by the HN during a single cycle TRIGGER-RTS-CTS-DATA of the simula...
double T_min_bck_DATA
Lower bound time interval from which the HN choice its backoff timer before to transmit a DATA packet...
uwUFetch_DATA_timer DATA_timer
Schedule the DATA timeout timer.
virtual void DataTOExpired()
DATA timeout is expired.
void incrTotalCtsPckRx_HN()
Increase the total number of CTS packets correctly or not received by the HN during an entire simulat...
virtual void DATA_HN_tx()
HN transmit a DATA packet to the AUV.
int max_pck_HN_can_tx
Maximum number of DATA packets that AUV want to receive from HN.
double Tdata_HN
Time needed to transmit a DATA packet.
virtual void state_CBEACON_tx()
HN initialize the CBEACON packet that will be forwarded in broadcast at all SNs of the network.
int n_PROBE_pck_rx_by_HN
Number of PROBE packet received by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the...
int getTotalDataPckTx_by_HN()
Total number of DATA packets transmitted by the HN during an entire simulation.
void incrTriggerPckRx_HN()
Increase the number of TRIGGER packets received by the HN during a single cycle TRIGGER-RTS-CTS-DATA ...
virtual void PROBE_rx()
HN has received a PROBE packet from SN.
uwUFetch_BackOffTimer BCK_timer_rts
Schedule the backoff timeout timer.
uwUFetch_DATA_BEFORE_TX_timer DATA_BEFORE_TX_timer
void incrCBeaconPckTx_by_HN()
Increase the number of CBEACON packets transmitted by the HN during a single cycle BEACON-PROBE-POLL-...
int n_CTS_pck_rx_by_HN
Number of CTS packet received by the HN during a single cycle TRIGGER-RTS-CTS-DATA of the simulation.
virtual void state_wait_other_DATA()
HN start to wait the second or successive DATA packet from SN.
virtual bool typeCommunication()
Indicate if the communiation between HN and AUV take place with or without RTS and CTS packets.
virtual void recvFromUpperLayers_HN(Packet *p)
Handle a packet coming from upper layers of HN.
int n_TRIGGER_pck_rx_by_HN
Number of TRIGGER packet received by the HN during a single cycle TRIGGER-RTS-CTS-DATA of the simulat...
void incrTotalProbePckRx_HN()
Increase total number of PROBE packets correctly or not received by the HN during an entire simulatio...
virtual void TRIGGER_rx_without()
HN has received a TRIGGER packet from AUV.
int MAX_PAYLOAD
Maximum size of payload DATA packet.
double tx_BEACON_finish_HN_time
Indicates when HN finished the transmission of BEACON packet to the SNs.
int mac_addr_NODE_polled
SN-MAC address of the node that the HN is going to be poll and from which It want to receive DATA pac...
uwUFetch_BEACON_timer BeaconBeforeTx_timer
Schedule the BEACON timeout timer.
UWUFETCH_NODE_PACKET_TYPE
@ UWUFETCH_NODE_PACKET_TYPE_DATA
@ UWUFETCH_NODE_PACKET_TYPE_POLL
virtual void POLL_tx()
HN transmit POLL packet to a specific SN of th network.
void incrTotalDataPckTx_by_NODE()
Increase the total number of DATA packets transmitted by SN during an entire duration of simulation.
int n_DATA_pck_rx_by_HN
Number of DATA packet received by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of the ...
virtual void TRIGGER_rx()
HN has received a TRIGGER packet from AUV.
bool txRTSbeforeCBEACON
true HN block the transmission of CBEACON because It try to communicate with the AUV.
double tx_DATA_start_HN_time
Indicates when HN started the transmission of DATA packet to the AUV.
Packet * curr_PROBE_HN_pck_rx
Pointer to the PROBE packet that is being received by HN.
uwUFetch_PROBE_timer PROBE_timer
Schedule the PROBE timeout timer.
@ 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_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_CBEACON_ALLOWED_TX_0_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_TX
@ UWUFETCH_NODE_STATUS_CHANGE_HN_RX_TRIGGER_FROM_AUV_CORRUPTED
@ UWUFETCH_NODE_STATUS_CHANGE_RTS_TX
@ UWUFETCH_NODE_STATUS_CHANGE_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_LAST_DATA_PCK_RX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_TO_EXPIRED
@ UWUFETCH_NODE_STATUS_CHANGE_CBEACON_MAX_ALLOWED_TX_0_PROBE_RX
@ UWUFETCH_NODE_STATUS_CHANGE_POLL_TX
@ UWUFETCH_NODE_STATUS_CHANGE_DATA_MAX_ALLOWED_PCK_RX_YES_NODE_TO_POLL
@ UWUFETCH_NODE_STATUS_CHANGE_CTS_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_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
double Tpoll
Time needed to transmit a POLL packet.
int getProbePckRx_HN()
Number of PROBE packets received by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON of th...
double rx_TRIGGER_finish_HN_time
Indicates when HN finished the reception of TRIGGER packet from the AUV.
int MAX_PCK_HN_WANT_RX_FROM_NODE
bool txCBEACONEnabled
true if HN is enabled to transmit a CBEACON packet to the SN
double RTT
Round trip time value.
Packet * curr_POLL_HN_pck_tx
Pointer to the POLL packet that is being transmitted by HN.
int mac_addr_AUV_in_CTS
AUV-MAC address contained int the CTS packet received by HN.
void incrTotalProbePckRx_corrupted_HN()
Increase the total number of corrupted PROBE packets received by the HN during an entire simulation.
virtual void state_POLL_tx()
HN initialize the POLL packet that will be forwarded to a specific SN of the network.
Packet * curr_DATA_HN_pck_tx
Pointer to the DATA packet that is being transmitted by HN to the AUV.
double T_START_PROCEDURE_HN_NODE
Time within HN is enabled to received a TRIGGER packet from AUV.
std::queue< Packet * > Q_data
Queue of DATA packets stored by the SN.
virtual void CtsTOExpired()
CTS timeout is expired.
virtual void state_RTS_tx()
HN initialize the RTS packet that will be forwarded to the AUV.
int max_data_HN_can_tx
Maximum number of DATA packets that the HN must transmit to the AUV.
int mac_addr_NODE_in_data
Mac address of the node from which the HN has received a DATA packet.
double Tdata_HN_pck
Time to transmit a DATA packet by the HN.
int n_DATA_pck_tx_by_HN
Number of DATA packet transmitted by the HN during a single cycle TRIGGER-RTS-CTS-DATA of the simulat...
void incrTotalRtsPckTx_by_HN()
Increase the total number of RTS packets transmitted by the HN during an entire simulation.
uwUFetch_CTS_timer CTS_timer
Schedule the CTS timeout timer.
double rx_CTS_finish_HN_time
Indicates when HN finished the reception of CTS packet from the SNs.
std::queue< int > Q_probbed_n_pcks_NODE_want_tx_HN
Queue that store the number of DATA packets that the single SN want to tx to the HN.
virtual void RTS_tx()
HN transmit a RTS packet to the AUV.
double rx_PROBE_finish_HN_time
Indicates when HN finished the reception of PROBE packet from the SNs.
Packet * curr_DATA_HN_pck_rx
Pointer to the DATA packet that is being received by HN from SN.
double tx_CBEACON_finish_HN_time
Indicates when HN finished the transmission of CBEACON packet to the SNs.
int n_RTS_pck_tx_by_HN
Number of RTS packet transmitted by the HN during a single cycle TRIGGER-RTS-CTS-DATA of the simulati...
void incrTotalCtsPckRx_corrupted_HN()
Increase the total number of corrupted CTS packets received by the HN during an entire simulation.
Packet * curr_CTS_HN_pck_rx
Pointer to the CTS packet that is being received by HN.
void incrTotalCBeaconPckTx_by_HN()
Increase the total number of CBEACON packets transmitted by the HN during an entire simulation.
int getCBeaconPckTx_by_HN()
Number of CBEACON packets transmitted by the HN during a single cycle BEACON-PROBE-POLL-DATA-CBEACON ...
bool rxDATAEnabled
true if HN is enabled to receive a DATA packet from teh SN
bool print_transitions
true if the writing of state transitions in the file is enabled.
virtual void refreshState(UWUFETCH_NODE_STATUS state)
@ UWUFETCH_NODE_STATUS_PROBE_RX
@ UWUFETCH_NODE_STATUS_POLL_TX
@ UWUFETCH_NODE_STATUS_WAIT_CTS_PACKET
@ UWUFETCH_NODE_STATUS_TRIGGER_RECEIVE
@ UWUFETCH_NODE_STATUS_CTS_RECEIVE
@ UWUFETCH_NODE_STATUS_WAIT_DATA_NODE
@ UWUFETCH_NODE_STATUS_WAIT_PROBE_PACKET
@ UWUFETCH_NODE_STATUS_DATA_RX
@ UWUFETCH_NODE_STATUS_TRANSMIT_BEACON
@ UWUFETCH_NODE_STATUS_IDLE
@ UWUFETCH_NODE_STATUS_RTS_TRANSMIT
void incrCtsPckRx_HN()
Increase the number of CTS packets received by the HN during a single cycle TRIGGER-RTS-CTS-DATA of t...
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.
Content header of CTS packet.
int & num_DATA_pcks_MAX_rx()
Reference to the num_DATA_pcks_MAX_rx_ variable.
Content header of POLL packet.
int & mac_addr_Node_polled()
Reference to mac_addr_Node_polled_ variable.
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.
Content header of RTS packet.
int & backoff_time_RTS()
Reference to the backoff_Time_RTS_ variable.
int & num_DATA_pcks()
Reference to the num_Data_pcks_ variable.
Content header of TRIGGER packet.
int & t_min()
Reference to the t_min variable.
int & t_max()
Reference to the t_max variable.
int & max_pck_want_rx()
Reference to the max_pck_want_rx 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_CTS_UFETCH
CTS 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.
packet_t PT_PROBE_UFETCH
PROBE packet type for UFetch protocol.
packet_t PT_RTS_UFETCH
RTS packet type for UFetch protocol.
#define UWUFETCH_NODE_DROP_REASON_NOT_ENABLE
Packet dropped: node is not enabled to receive this type of \ packet.
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_CTS_UFETCH(p)
alias defined to access the CTS HEADER
#define HDR_CBEACON_UFETCH(p)
alias defined to access the CBEACON HEADER
#define HDR_TRIGGER_UFETCH(p)
alias defined to access the TRIGGER HEADER
#define HDR_PROBE_UFETCH(p)
alias defined to access the PROBE HEADER
#define HDR_RTS_UFETCH(p)
alias defined to access the RTS HEADER