diff options
-rw-r--r-- | src/setu/gnunet-service-setu.c | 25 | ||||
-rw-r--r-- | src/setu/perf_setu_api.c | 6 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index fcd0e425b..46a4f0386 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c | |||
@@ -728,13 +728,14 @@ sum_sent_received_bytes(int size, struct perf_num_send_resived_msg perf_rtt_stru | |||
728 | 728 | ||
729 | static float | 729 | static float |
730 | calculate_perf_rtt() { | 730 | calculate_perf_rtt() { |
731 | |||
732 | LOG(GNUNET_ERROR_TYPE_ERROR,"CALCUALATE PERFOMANCE VALUES\n"); | ||
731 | /** | 733 | /** |
732 | * Calculate RTT of init phase normally always 1 | 734 | * Calculate RTT of init phase normally always 1 |
733 | */ | 735 | */ |
734 | float rtt = 1; | 736 | float rtt = 1; |
735 | int bytes_transmitted = 0; | 737 | int bytes_transmitted = 0; |
736 | 738 | ||
737 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT1: %f \n", rtt); | ||
738 | /** | 739 | /** |
739 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending | 740 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending |
740 | */ | 741 | */ |
@@ -746,7 +747,6 @@ calculate_perf_rtt() { | |||
746 | ( perf_rtt.request_full.sent != 0) | 747 | ( perf_rtt.request_full.sent != 0) |
747 | ) rtt += 0.5; | 748 | ) rtt += 0.5; |
748 | 749 | ||
749 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT2: %f \n", rtt); | ||
750 | /** | 750 | /** |
751 | * In case of a differential sync 3 rtt's are needed. | 751 | * In case of a differential sync 3 rtt's are needed. |
752 | * for every active/passive switch additional 3.5 rtt's are used | 752 | * for every active/passive switch additional 3.5 rtt's are used |
@@ -758,7 +758,6 @@ calculate_perf_rtt() { | |||
758 | rtt += iterations * 0.5; | 758 | rtt += iterations * 0.5; |
759 | rtt += 2.5; | 759 | rtt += 2.5; |
760 | } | 760 | } |
761 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT3: %d \n", perf_rtt.active_passive_switches); | ||
762 | 761 | ||
763 | /** | 762 | /** |
764 | * Calculate data sended size | 763 | * Calculate data sended size |
@@ -775,9 +774,9 @@ calculate_perf_rtt() { | |||
775 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), perf_rtt.offer); | 774 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), perf_rtt.offer); |
776 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), perf_rtt.done); | 775 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), perf_rtt.done); |
777 | 776 | ||
778 | LOG(GNUNET_ERROR_TYPE_ERROR,"Bytes Transmitted: %d\n", bytes_transmitted); | 777 | LOG(GNUNET_ERROR_TYPE_DEBUG,"Bytes Transmitted: %d\n", bytes_transmitted); |
779 | 778 | ||
780 | LOG(GNUNET_ERROR_TYPE_ERROR,"Reached tradeoff bandwidth/rtt: %f\n", (bytes_transmitted / rtt )); | 779 | LOG(GNUNET_ERROR_TYPE_DEBUG,"Reached tradeoff bandwidth/rtt: %f\n", (bytes_transmitted / rtt )); |
781 | 780 | ||
782 | LOG(GNUNET_ERROR_TYPE_ERROR,"Estimateded set difference: %d\n", perf_rtt.se_diff); | 781 | LOG(GNUNET_ERROR_TYPE_ERROR,"Estimateded set difference: %d\n", perf_rtt.se_diff); |
783 | 782 | ||
@@ -795,9 +794,12 @@ calculate_perf_rtt() { | |||
795 | int decoded = 0; | 794 | int decoded = 0; |
796 | if(perf_rtt.active_passive_switches == 0) | 795 | if(perf_rtt.active_passive_switches == 0) |
797 | decoded = 1; | 796 | decoded = 1; |
797 | LOG(GNUNET_ERROR_TYPE_ERROR,"decoded=%d, msg_sent=%d, msg_recv=%d, byte_sent=%d, bytes_recv=%d \n", decoded, perf_rtt.ibf.sent, perf_rtt.ibf.received, perf_rtt.ibf.sent_var_bytes, perf_rtt.ibf.received_var_bytes); | ||
798 | int ibf_bytes_transmitted = sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_IBF), perf_rtt.ibf); | ||
799 | |||
798 | 800 | ||
799 | FILE *out1 = fopen("perf_failure_bucket_number_factor.csv", "a"); | 801 | FILE *out1 = fopen("perf_failure_bucket_number_factor.csv", "a"); |
800 | fprintf(out1, "%d,%f,%d\n",num_per_bucket,factor,decoded); | 802 | fprintf(out1, "%d,%f,%d,%d\n",num_per_bucket,factor,decoded,ibf_bytes_transmitted); |
801 | fclose(out1); | 803 | fclose(out1); |
802 | 804 | ||
803 | 805 | ||
@@ -1605,9 +1607,10 @@ handle_union_p2p_strata_estimator (void *cls, | |||
1605 | 1607 | ||
1606 | perf_rtt.se_diff = diff; | 1608 | perf_rtt.se_diff = diff; |
1607 | 1609 | ||
1610 | /** | ||
1608 | if (diff > 200) | 1611 | if (diff > 200) |
1609 | diff = diff * 3 / 2; | 1612 | diff = diff * 3 / 2; |
1610 | 1613 | **/ | |
1611 | strata_estimator_destroy (remote_se); | 1614 | strata_estimator_destroy (remote_se); |
1612 | strata_estimator_destroy (op->se); | 1615 | strata_estimator_destroy (op->se); |
1613 | op->se = NULL; | 1616 | op->se = NULL; |
@@ -1643,6 +1646,7 @@ LOG (GNUNET_ERROR_TYPE_ERROR, "VALUE: %f\n ",op->max_set_diff_factor_diff_sync); | |||
1643 | /** | 1646 | /** |
1644 | * Added rtt_bandwidth_tradeoff directly need future improvements | 1647 | * Added rtt_bandwidth_tradeoff directly need future improvements |
1645 | */ | 1648 | */ |
1649 | LOG(GNUNET_ERROR_TYPE_ERROR,"((GNUNET_YES == %d) || (%d > %d * %f) || (0 == %d))", op->force_full,diff, op->initial_size, op->max_set_diff_factor_diff_sync, other_size); | ||
1646 | if ((GNUNET_YES == op->force_full) || | 1650 | if ((GNUNET_YES == op->force_full) || |
1647 | (diff > op->initial_size * op->max_set_diff_factor_diff_sync) || | 1651 | (diff > op->initial_size * op->max_set_diff_factor_diff_sync) || |
1648 | (0 == other_size)) | 1652 | (0 == other_size)) |
@@ -3851,7 +3855,12 @@ handle_client_accept (void *cls, | |||
3851 | perf_rtt.se.sent += 1; | 3855 | perf_rtt.se.sent += 1; |
3852 | perf_rtt.se.sent_var_bytes += len; | 3856 | perf_rtt.se.sent_var_bytes += len; |
3853 | 3857 | ||
3854 | if (len < se->strata_count * IBF_BUCKET_SIZE * se->ibf_size) | 3858 | GNUNET_log ( |
3859 | GNUNET_ERROR_TYPE_ERROR, | ||
3860 | "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | ||
3861 | |||
3862 | |||
3863 | if (len < se->strata_count * IBF_BUCKET_SIZE * se->ibf_size) | ||
3855 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SEC; | 3864 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SEC; |
3856 | else | 3865 | else |
3857 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SE; | 3866 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SE; |
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c index 3d3f961e1..05d4a54b6 100644 --- a/src/setu/perf_setu_api.c +++ b/src/setu/perf_setu_api.c | |||
@@ -404,7 +404,7 @@ run (void *cls, | |||
404 | "Running real set-reconciliation\n"); | 404 | "Running real set-reconciliation\n"); |
405 | //init_set1 (); | 405 | //init_set1 (); |
406 | // limit ~23800 element total | 406 | // limit ~23800 element total |
407 | initRandomSets(450,5000,5000,32); | 407 | initRandomSets(45,500,500,32); |
408 | } | 408 | } |
409 | 409 | ||
410 | void perf_thread() { | 410 | void perf_thread() { |
@@ -461,7 +461,7 @@ static void execute_perf() { | |||
461 | GNUNET_CONFIGURATION_set_value_number(setu_cfg, "IBF", "NUMBER_PER_BUCKET", out_out_ctr); // K default=4 | 461 | GNUNET_CONFIGURATION_set_value_number(setu_cfg, "IBF", "NUMBER_PER_BUCKET", out_out_ctr); // K default=4 |
462 | GNUNET_CONFIGURATION_set_value_string(setu_cfg, "PERFORMANCE", "TRADEOFF", "0.25"); | 462 | GNUNET_CONFIGURATION_set_value_string(setu_cfg, "PERFORMANCE", "TRADEOFF", "0.25"); |
463 | GNUNET_CONFIGURATION_set_value_string(setu_cfg, "PERFORMANCE", "MAX_SET_DIFF_FACTOR_DIFFERENTIAL", | 463 | GNUNET_CONFIGURATION_set_value_string(setu_cfg, "PERFORMANCE", "MAX_SET_DIFF_FACTOR_DIFFERENTIAL", |
464 | "2");//default=4 | 464 | "20000");//default=0.25 |
465 | 465 | ||
466 | 466 | ||
467 | if (GNUNET_OK != GNUNET_CONFIGURATION_write(setu_cfg, "/tmp/perf_setu.conf")) | 467 | if (GNUNET_OK != GNUNET_CONFIGURATION_write(setu_cfg, "/tmp/perf_setu.conf")) |
@@ -469,7 +469,7 @@ static void execute_perf() { | |||
469 | GNUNET_ERROR_TYPE_ERROR, | 469 | GNUNET_ERROR_TYPE_ERROR, |
470 | _("Failed to write subsystem default identifier map to `%s'.\n"), | 470 | _("Failed to write subsystem default identifier map to `%s'.\n"), |
471 | setu_cfg); | 471 | setu_cfg); |
472 | run_petf_thread(1000); | 472 | run_petf_thread(10000); |
473 | } | 473 | } |
474 | } | 474 | } |
475 | return 0; | 475 | return 0; |