diff --git a/README.md b/README.md index 3e319f938bd8b86c6702d22fab5e886a74c1ee5a..414aa937f4f215175de40ba44aae555ee2f57c45 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ This folder contains testing files that we will be sendig between the `receiver` For the testing we have a specific directory that contains our shell script tests. In order to execute our tests we advise to run the following Makefile command ``` -make tests -s +make tests ``` -The silent argument `-s` is to silence any Makefile output and only leave the messages of the tests. In order to test the transfer of a file, you have to add a file in the `test_files`. The suite cases will automatically load the fle and transfer using our protocol. + +In order to test the transfer of a file, you have to add a file in the `test_files`. The suite cases will automatically load the fle and transfer using our protocol. We have two types of tests suites. *Simple* and *Advanced* test suites. @@ -49,21 +50,7 @@ We have two types of tests suites. *Simple* and *Advanced* test suites. Simple tests don't use `linksimulator`, however they use `Valgrind` to check memory usage in both the sender and the receiver. After executing the `make [debug]`. One can run a simple test with the following command : -``` -./tests/simple_test.sh <path_to_file> -``` - -The output for each file sent using the simple test is to be found in the `unwanted_logs/`. They respect the following format : - -| File in `unwanted_logs/` | Contains | -| :-- | :-- | -| `<file_basename>`_received_file.`<file_extension>` | This is the file received by the `receiver`.| -| `<file_basename>`_receiver.log | Contains the valgrind log of the `receiver`. | -| `<file_basename>`_sender.log | Contains the valgrind log of the `sender`. | -| receiver.log | Contains the output on the stderr of the `receiver`. | -| sender.log | Contains the output on the stderr of the `sender`. | -The stdout prints *Le transfert est réussi!*, upon success else it prints the comparison between the sent file and the received file. ### 4. 2. *Advanced* Test Suites diff --git a/interop/receivers/receiver_group66 b/interop/receivers/receiver_group66 new file mode 100755 index 0000000000000000000000000000000000000000..2f9c46442390a550aa1a3500b4c1cbc2960a203c Binary files /dev/null and b/interop/receivers/receiver_group66 differ diff --git a/interop/senders/sender_group66 b/interop/senders/sender_group66 new file mode 100755 index 0000000000000000000000000000000000000000..c98021e43d818e68b0d8798acf418e0b43aafa28 Binary files /dev/null and b/interop/senders/sender_group66 differ diff --git a/maldives.log b/maldives.log deleted file mode 100644 index e91d474d30d2830983c68e6dda12fb22a17e9732..0000000000000000000000000000000000000000 --- a/maldives.log +++ /dev/null @@ -1,22 +0,0 @@ -Maldives (DNS) ---- traceroute to 103.110.109.106 (103.110.109.106), 64 hops max --- - 1 192.168.1.1 7,455ms 3,066ms 3,234ms - 2 10.24.146.9 10,552ms 10,199ms 9,976ms - 3 * * * - 4 91.183.242.136 89,243ms 12,102ms 12,606ms - 5 * * * - 6 194.53.172.33 19,592ms 13,820ms 13,911ms - 7 184.104.193.137 21,496ms 20,755ms 22,760ms - 8 * * * - 9 184.105.65.13 286,164ms 204,393ms 409,504ms - 10 74.82.51.50 409,893ms 409,093ms 205,535ms - 11 202.1.205.242 408,977ms 208,237ms 406,101ms - 12 27.114.138.115 409,937ms 409,409ms 410,123ms - 13 103.31.84.106 340,534ms 273,360ms * - 14 * * * - 15 * * * - 16 103.110.109.106 289,133ms 410,090ms 229,577ms - ---- 103.110.109.106 ping statistics --- -120 packets transmitted, 105 received, 12,5% packet loss, time 119255ms -rtt min/avg/max/mdev = 230.242/352.584/744.943/93.245 ms diff --git a/src/sender_utils.c b/src/sender_utils.c index e4cd77759953ac4dc02e6908a1914e3b184f7429..4079cae8c1299bc49e1b3fbdf2091159b7a9a3ff 100644 --- a/src/sender_utils.c +++ b/src/sender_utils.c @@ -245,15 +245,15 @@ int checking_timer(sender_state_t *state, int socket_fd) { gettimeofday(&time, NULL); // When the timer is over, we send the packet back - float retransmission = (state->stats->min_rtt > 0 ? 2 * state->stats->min_rtt : 2000); + float retransmission = (state->stats->min_rtt > 0 ? 2 * state->stats->min_rtt : TIMER_LIMIT); retransmission += (state->stats->avg_rtt - state->stats->min_rtt)/2; - + retransmission = (retransmission >= TIMER_LIMIT ? TIMER_LIMIT : retransmission); + if ((time_milliseconds(&time) - time_milliseconds(&state->timers[state->tail])) >= retransmission) { - DEBUG("The current average rtt %lld ms, retransmitted after %f ms", state->stats->avg_rtt,retransmission); state->stats->packet_retransmitted++; pkt_t *pkt = state->buffer[state->tail]; - DEBUG("The pkt with seqnum: %d has timeout", pkt_get_seqnum(pkt)); + DEBUG("The pkt with seqnum: %d has timeout | Current retransmission delay: %f", pkt_get_seqnum(pkt), retransmission); if (send_pkt(state, pkt, state->tail, socket_fd) == -1) return -1; } } diff --git a/tests/run_interop.sh b/tests/run_interop.sh index 39ccb4ced542136e89de2099161bde04ea56cb55..219e748d2fd22605b51cc09ba1d82b060df0f7e5 100755 --- a/tests/run_interop.sh +++ b/tests/run_interop.sh @@ -9,6 +9,7 @@ GREEN='\033[0;32m' RED='\033[0;31m' NC='\033[0m' +echo -e "${BROWN}\n**Warning** there might be some infinite loops if the sender or receiver are not properly working together${NC}" input_files=( 'tests_files/greeting.txt' @@ -21,11 +22,11 @@ modes=( 'with_FEC' ) -ERROR_RATE=10 +ERROR_RATE=5 CUT_RATE=5 DELAY=100 JITTER=100 -LOSS_RATE=20 +LOSS_RATE=15 dir="tests_logs/interop/" @@ -54,7 +55,7 @@ for receiver in $receivers; do "${my_sender}_with_${receiver_name}" if [ $? -ne 0 ]; then echo "Tests terminated cause of a failed test" - exit 0 + break 2 fi done let j++ @@ -79,7 +80,7 @@ for sender in $senders; do "${sender_name}_with_${my_receiver}" if [ $? -ne 0 ]; then echo "Tests terminated cause of a failed test" - exit 0 + break 2 fi done let j++