diff options
Diffstat (limited to 'src/setu/gnunet-service-setu.c')
-rw-r--r-- | src/setu/gnunet-service-setu.c | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index a51e92b71..2d258bfc5 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c | |||
@@ -95,7 +95,7 @@ | |||
95 | #define SECURITY_LEVEL 80 | 95 | #define SECURITY_LEVEL 80 |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Is the estimated probabily for a new round this values | 98 | * Is the estimated probability for a new round this values |
99 | * is based on the bsc thesis of Elias Summermatter (2021) | 99 | * is based on the bsc thesis of Elias Summermatter (2021) |
100 | */ | 100 | */ |
101 | 101 | ||
@@ -467,7 +467,7 @@ struct Operation | |||
467 | 467 | ||
468 | /** | 468 | /** |
469 | * Set difference is multiplied with this factor | 469 | * Set difference is multiplied with this factor |
470 | * to gennerate large enought IBF | 470 | * to gennerate large enough IBF |
471 | */ | 471 | */ |
472 | uint8_t ibf_bucket_number_factor; | 472 | uint8_t ibf_bucket_number_factor; |
473 | 473 | ||
@@ -780,7 +780,7 @@ struct perf_num_send_received_msg | |||
780 | }; | 780 | }; |
781 | 781 | ||
782 | /** | 782 | /** |
783 | * Main struct to messure perfomance (data/rtts) | 783 | * Main struct to measure performance (data/rtts) |
784 | */ | 784 | */ |
785 | struct per_store_struct | 785 | struct per_store_struct |
786 | { | 786 | { |
@@ -828,7 +828,7 @@ enum MESSAGE_CONTROL_FLOW_STATE | |||
828 | MSG_CFS_EXPECTED, | 828 | MSG_CFS_EXPECTED, |
829 | 829 | ||
830 | /** | 830 | /** |
831 | * Track that message has been recieved | 831 | * Track that message has been received |
832 | */ | 832 | */ |
833 | MSG_CFS_RECEIVED, | 833 | MSG_CFS_RECEIVED, |
834 | }; | 834 | }; |
@@ -843,20 +843,22 @@ enum MESSAGE_TYPE | |||
843 | * Offer message type | 843 | * Offer message type |
844 | */ | 844 | */ |
845 | OFFER_MESSAGE, | 845 | OFFER_MESSAGE, |
846 | |||
846 | /** | 847 | /** |
847 | * Demand message type | 848 | * Demand message type |
848 | */ | 849 | */ |
849 | DEMAND_MESSAGE, | 850 | DEMAND_MESSAGE, |
851 | |||
850 | /** | 852 | /** |
851 | * Elemente message type | 853 | * Element message type |
852 | */ | 854 | */ |
853 | ELEMENT_MESSAGE, | 855 | ELEMENT_MESSAGE, |
854 | }; | 856 | }; |
855 | 857 | ||
858 | |||
856 | /** | 859 | /** |
857 | * Struct to tracked messages in message controll flow | 860 | * Struct to tracked messages in message control flow |
858 | */ | 861 | */ |
859 | |||
860 | struct messageControlFlowElement | 862 | struct messageControlFlowElement |
861 | { | 863 | { |
862 | /** | 864 | /** |
@@ -875,50 +877,54 @@ struct messageControlFlowElement | |||
875 | 877 | ||
876 | 878 | ||
877 | #if MEASURE_PERFORMANCE | 879 | #if MEASURE_PERFORMANCE |
880 | |||
878 | /** | 881 | /** |
879 | * Loads different configuration to do perform perfomance tests | 882 | * Loads different configuration to perform performance tests |
880 | * @param op | 883 | * |
884 | * @param op operation handle | ||
881 | */ | 885 | */ |
882 | static void | 886 | static void |
883 | load_config (struct Operation *op) | 887 | load_config (struct Operation *op) |
884 | { | 888 | { |
885 | |||
886 | setu_cfg = GNUNET_CONFIGURATION_create (); | ||
887 | GNUNET_CONFIGURATION_load (setu_cfg,"perf_setu.conf"); | ||
888 | |||
889 | |||
890 | long long number; | 889 | long long number; |
891 | float fl; | 890 | float fl; |
892 | GNUNET_CONFIGURATION_get_value_float (setu_cfg,"IBF", "BUCKET_NUMBER_FACTOR", | 891 | |
892 | setu_cfg = GNUNET_CONFIGURATION_create (); | ||
893 | GNUNET_CONFIGURATION_load (setu_cfg, | ||
894 | "perf_setu.conf"); | ||
895 | GNUNET_CONFIGURATION_get_value_float (setu_cfg, | ||
896 | "IBF", | ||
897 | "BUCKET_NUMBER_FACTOR", | ||
893 | &fl); | 898 | &fl); |
894 | op->ibf_bucket_number_factor = fl; | 899 | op->ibf_bucket_number_factor = fl; |
895 | 900 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
896 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"IBF", "NUMBER_PER_BUCKET", | 901 | "IBF", |
902 | "NUMBER_PER_BUCKET", | ||
897 | &number); | 903 | &number); |
898 | op->ibf_number_buckets_per_element = number; | 904 | op->ibf_number_buckets_per_element = number; |
899 | 905 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
900 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"PERFORMANCE", "TRADEOFF", | 906 | "PERFORMANCE", |
907 | "TRADEOFF", | ||
901 | &number); | 908 | &number); |
902 | op->rtt_bandwidth_tradeoff = number; | 909 | op->rtt_bandwidth_tradeoff = number; |
903 | 910 | GNUNET_CONFIGURATION_get_value_number (setu_cfg, | |
904 | 911 | "BOUNDARIES", | |
905 | GNUNET_CONFIGURATION_get_value_number (setu_cfg,"BOUNDARIES", "UPPER_ELEMENT", | 912 | "UPPER_ELEMENT", |
906 | &number); | 913 | &number); |
907 | op->byzantine_upper_bound = number; | 914 | op->byzantine_upper_bound = number; |
908 | |||
909 | |||
910 | op->peer_site = 0; | 915 | op->peer_site = 0; |
911 | } | 916 | } |
912 | 917 | ||
913 | 918 | ||
914 | /** | 919 | /** |
915 | * Function to calculate total bytes used for performance messurement | 920 | * Function to calculate total bytes used for performance measurement |
916 | * @param size | 921 | * @param size |
917 | * @param perf_num_send_received_msg | 922 | * @param perf_num_send_received_msg |
918 | * @return bytes used | 923 | * @return bytes used |
919 | */ | 924 | */ |
920 | static int | 925 | static int |
921 | sum_sent_received_bytes (uint64_t size, struct perf_num_send_received_msg | 926 | sum_sent_received_bytes (uint64_t size, |
927 | struct perf_num_send_received_msg | ||
922 | perf_num_send_received_msg) | 928 | perf_num_send_received_msg) |
923 | { | 929 | { |
924 | return (size * perf_num_send_received_msg.sent) | 930 | return (size * perf_num_send_received_msg.sent) |
@@ -942,7 +948,7 @@ calculate_perf_store () | |||
942 | int bytes_transmitted = 0; | 948 | int bytes_transmitted = 0; |
943 | 949 | ||
944 | /** | 950 | /** |
945 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending | 951 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normally 1 or 1.5 depending |
946 | */ | 952 | */ |
947 | if ((perf_store.element_full.received != 0) || | 953 | if ((perf_store.element_full.received != 0) || |
948 | (perf_store.element_full.sent != 0) | 954 | (perf_store.element_full.sent != 0) |
@@ -1840,7 +1846,7 @@ struct GetElementContext | |||
1840 | struct GNUNET_HashCode hash; | 1846 | struct GNUNET_HashCode hash; |
1841 | 1847 | ||
1842 | /** | 1848 | /** |
1843 | * Pointer to the key enty | 1849 | * Pointer to the key entry |
1844 | */ | 1850 | */ |
1845 | struct KeyEntry *k; | 1851 | struct KeyEntry *k; |
1846 | }; | 1852 | }; |