diff options
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | src/fs/fs_test_lib_data.conf | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 6 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.h | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 164 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.h | 2 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p.c | 2 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p_trust.c | 24 |
10 files changed, 192 insertions, 23 deletions
@@ -1,6 +1,5 @@ | |||
1 | 0.9.0pre3: | 1 | 0.9.0pre3: |
2 | * FS [CG] | 2 | * crashes in gnunet-service-transport [MW] |
3 | - implement 'SUPPORT_DELAYS' | ||
4 | 3 | ||
5 | 0.9.0: | 4 | 0.9.0: |
6 | * new webpage: | 5 | * new webpage: |
diff --git a/src/fs/fs_test_lib_data.conf b/src/fs/fs_test_lib_data.conf index 377348f02..d3e9922c3 100644 --- a/src/fs/fs_test_lib_data.conf +++ b/src/fs/fs_test_lib_data.conf | |||
@@ -56,6 +56,7 @@ HOSTNAME = localhost | |||
56 | #OPTIONS = -L DEBUG | 56 | #OPTIONS = -L DEBUG |
57 | CONTENT_CACHING = NO | 57 | CONTENT_CACHING = NO |
58 | CONTENT_PUSHING = NO | 58 | CONTENT_PUSHING = NO |
59 | DELAY = NO | ||
59 | #DEBUG = YES | 60 | #DEBUG = YES |
60 | #PREFIX = valgrind --tool=memcheck --leak-check=yes | 61 | #PREFIX = valgrind --tool=memcheck --leak-check=yes |
61 | #BINARY = /home/grothoff/bin/gnunet-service-fs | 62 | #BINARY = /home/grothoff/bin/gnunet-service-fs |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 87cdd8322..d95aec6bf 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -128,6 +128,10 @@ struct GNUNET_BLOCK_Context *GSF_block_ctx; | |||
128 | */ | 128 | */ |
129 | struct GNUNET_CORE_Handle *GSF_core; | 129 | struct GNUNET_CORE_Handle *GSF_core; |
130 | 130 | ||
131 | /** | ||
132 | * Are we introducing randomized delays for better anonymity? | ||
133 | */ | ||
134 | int GSF_enable_randomized_delays; | ||
131 | 135 | ||
132 | /* ***************************** locals ******************************* */ | 136 | /* ***************************** locals ******************************* */ |
133 | 137 | ||
@@ -235,6 +239,7 @@ handle_p2p_put (void *cls, | |||
235 | GNUNET_break (0); | 239 | GNUNET_break (0); |
236 | return GNUNET_OK; | 240 | return GNUNET_OK; |
237 | } | 241 | } |
242 | GSF_cover_content_count++; | ||
238 | return GSF_handle_p2p_content_ (cp, message); | 243 | return GSF_handle_p2p_content_ (cp, message); |
239 | } | 244 | } |
240 | 245 | ||
@@ -568,6 +573,7 @@ run (void *cls, | |||
568 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 573 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
569 | { | 574 | { |
570 | GSF_cfg = cfg; | 575 | GSF_cfg = cfg; |
576 | GSF_enable_randomized_delays = GNUNET_CONFIGURATION_get_value_yesno (cfg, "fs", "DELAY"); | ||
571 | GSF_dsh = GNUNET_DATASTORE_connect (cfg); | 577 | GSF_dsh = GNUNET_DATASTORE_connect (cfg); |
572 | if (NULL == GSF_dsh) | 578 | if (NULL == GSF_dsh) |
573 | { | 579 | { |
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index 792b43049..ed7cd2e7b 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -147,6 +147,10 @@ extern unsigned int GSF_cover_content_count; | |||
147 | */ | 147 | */ |
148 | extern struct GNUNET_BLOCK_Context *GSF_block_ctx; | 148 | extern struct GNUNET_BLOCK_Context *GSF_block_ctx; |
149 | 149 | ||
150 | /** | ||
151 | * Are we introducing randomized delays for better anonymity? | ||
152 | */ | ||
153 | extern int GSF_enable_randomized_delays; | ||
150 | 154 | ||
151 | /** | 155 | /** |
152 | * Test if the DATABASE (GET) load on this peer is too high | 156 | * Test if the DATABASE (GET) load on this peer is too high |
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 7123db73a..9686c7dfe 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -126,6 +126,45 @@ struct GSF_PeerTransmitHandle | |||
126 | 126 | ||
127 | 127 | ||
128 | /** | 128 | /** |
129 | * Handle for an entry in our delay list. | ||
130 | */ | ||
131 | struct GSF_DelayedHandle | ||
132 | { | ||
133 | |||
134 | /** | ||
135 | * Kept in a doubly-linked list. | ||
136 | */ | ||
137 | struct GSF_DelayedHandle *next; | ||
138 | |||
139 | /** | ||
140 | * Kept in a doubly-linked list. | ||
141 | */ | ||
142 | struct GSF_DelayedHandle *prev; | ||
143 | |||
144 | /** | ||
145 | * Peer this transmission belongs to. | ||
146 | */ | ||
147 | struct GSF_ConnectedPeer *cp; | ||
148 | |||
149 | /** | ||
150 | * The PUT that was delayed. | ||
151 | */ | ||
152 | struct PutMessage *pm; | ||
153 | |||
154 | /** | ||
155 | * Task for the delay. | ||
156 | */ | ||
157 | GNUNET_SCHEDULER_TaskIdentifier delay_task; | ||
158 | |||
159 | /** | ||
160 | * Size of the message. | ||
161 | */ | ||
162 | size_t msize; | ||
163 | |||
164 | }; | ||
165 | |||
166 | |||
167 | /** | ||
129 | * Information per peer and request. | 168 | * Information per peer and request. |
130 | */ | 169 | */ |
131 | struct PeerRequest | 170 | struct PeerRequest |
@@ -184,6 +223,18 @@ struct GSF_ConnectedPeer | |||
184 | struct GSF_PeerTransmitHandle *pth_tail; | 223 | struct GSF_PeerTransmitHandle *pth_tail; |
185 | 224 | ||
186 | /** | 225 | /** |
226 | * Messages (replies, queries, content migration) we would like to | ||
227 | * send to this peer in the near future. Sorted by priority, head. | ||
228 | */ | ||
229 | struct GSF_DelayedHandle *delayed_head; | ||
230 | |||
231 | /** | ||
232 | * Messages (replies, queries, content migration) we would like to | ||
233 | * send to this peer in the near future. Sorted by priority, tail. | ||
234 | */ | ||
235 | struct GSF_DelayedHandle *delayed_tail; | ||
236 | |||
237 | /** | ||
187 | * Migration stop message in our queue, or NULL if we have none pending. | 238 | * Migration stop message in our queue, or NULL if we have none pending. |
188 | */ | 239 | */ |
189 | struct GSF_PeerTransmitHandle *migration_pth; | 240 | struct GSF_PeerTransmitHandle *migration_pth; |
@@ -757,6 +808,61 @@ peer_request_destroy (void *cls, | |||
757 | 808 | ||
758 | 809 | ||
759 | /** | 810 | /** |
811 | * The artificial delay is over, transmit the message now. | ||
812 | * | ||
813 | * @param cls the 'struct GSF_DelayedHandle' with the message | ||
814 | * @param tc scheduler context | ||
815 | */ | ||
816 | static void | ||
817 | transmit_delayed_now (void *cls, | ||
818 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
819 | { | ||
820 | struct GSF_DelayedHandle *dh = cls; | ||
821 | struct GSF_ConnectedPeer *cp = dh->cp; | ||
822 | |||
823 | GNUNET_CONTAINER_DLL_remove (cp->delayed_head, | ||
824 | cp->delayed_tail, | ||
825 | dh); | ||
826 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | ||
827 | { | ||
828 | GNUNET_free (dh->pm); | ||
829 | GNUNET_free (dh); | ||
830 | return; | ||
831 | } | ||
832 | (void) GSF_peer_transmit_ (cp, GNUNET_NO, | ||
833 | UINT32_MAX, | ||
834 | REPLY_TIMEOUT, | ||
835 | dh->msize, | ||
836 | ©_reply, | ||
837 | dh->pm); | ||
838 | GNUNET_free (dh); | ||
839 | } | ||
840 | |||
841 | |||
842 | /** | ||
843 | * Get the randomized delay a response should be subjected to. | ||
844 | * | ||
845 | * @return desired delay | ||
846 | */ | ||
847 | static struct GNUNET_TIME_Relative | ||
848 | get_randomized_delay () | ||
849 | { | ||
850 | struct GNUNET_TIME_Relative ret; | ||
851 | |||
852 | /* FIXME: replace 5000 with something relating to current observed P2P message latency */ | ||
853 | ret = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | ||
854 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
855 | 5000)); | ||
856 | GNUNET_STATISTICS_update (GSF_stats, | ||
857 | gettext_noop ("# artificial delays introduced (ms)"), | ||
858 | ret.rel_value, | ||
859 | GNUNET_NO); | ||
860 | |||
861 | return ret; | ||
862 | } | ||
863 | |||
864 | |||
865 | /** | ||
760 | * Handle a reply to a pending request. Also called if a request | 866 | * Handle a reply to a pending request. Also called if a request |
761 | * expires (then with data == NULL). The handler may be called | 867 | * expires (then with data == NULL). The handler may be called |
762 | * many times (depending on the request type), but will not be | 868 | * many times (depending on the request type), but will not be |
@@ -767,6 +873,7 @@ peer_request_destroy (void *cls, | |||
767 | * @param cls 'struct PeerRequest' this is an answer for | 873 | * @param cls 'struct PeerRequest' this is an answer for |
768 | * @param eval evaluation of the result | 874 | * @param eval evaluation of the result |
769 | * @param pr handle to the original pending request | 875 | * @param pr handle to the original pending request |
876 | * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown" | ||
770 | * @param expiration when does 'data' expire? | 877 | * @param expiration when does 'data' expire? |
771 | * @param type type of the block | 878 | * @param type type of the block |
772 | * @param data response data, NULL on request expiration | 879 | * @param data response data, NULL on request expiration |
@@ -776,6 +883,7 @@ static void | |||
776 | handle_p2p_reply (void *cls, | 883 | handle_p2p_reply (void *cls, |
777 | enum GNUNET_BLOCK_EvaluationResult eval, | 884 | enum GNUNET_BLOCK_EvaluationResult eval, |
778 | struct GSF_PendingRequest *pr, | 885 | struct GSF_PendingRequest *pr, |
886 | uint32_t reply_anonymity_level, | ||
779 | struct GNUNET_TIME_Absolute expiration, | 887 | struct GNUNET_TIME_Absolute expiration, |
780 | enum GNUNET_BLOCK_Type type, | 888 | enum GNUNET_BLOCK_Type type, |
781 | const void *data, | 889 | const void *data, |
@@ -825,18 +933,52 @@ handle_p2p_reply (void *cls, | |||
825 | GNUNET_break (0); | 933 | GNUNET_break (0); |
826 | return; | 934 | return; |
827 | } | 935 | } |
936 | if ( (reply_anonymity_level != UINT32_MAX) && | ||
937 | (reply_anonymity_level > 1) ) | ||
938 | { | ||
939 | if (reply_anonymity_level - 1 > GSF_cover_content_count) | ||
940 | { | ||
941 | GNUNET_STATISTICS_update (GSF_stats, | ||
942 | gettext_noop ("# replies dropped due to insufficient cover traffic"), | ||
943 | 1, | ||
944 | GNUNET_NO); | ||
945 | return; | ||
946 | } | ||
947 | GSF_cover_content_count -= (reply_anonymity_level - 1); | ||
948 | } | ||
949 | |||
828 | pm = GNUNET_malloc (msize); | 950 | pm = GNUNET_malloc (msize); |
829 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); | 951 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); |
830 | pm->header.size = htons (msize); | 952 | pm->header.size = htons (msize); |
831 | pm->type = htonl (type); | 953 | pm->type = htonl (type); |
832 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); | 954 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); |
833 | memcpy (&pm[1], data, data_len); | 955 | memcpy (&pm[1], data, data_len); |
834 | (void) GSF_peer_transmit_ (cp, GNUNET_NO, | 956 | if ( (reply_anonymity_level != UINT32_MAX) && |
835 | UINT32_MAX, | 957 | (reply_anonymity_level != 0) && |
836 | REPLY_TIMEOUT, | 958 | (GSF_enable_randomized_delays == GNUNET_YES) ) |
837 | msize, | 959 | { |
838 | ©_reply, | 960 | struct GSF_DelayedHandle *dh; |
839 | pm); | 961 | |
962 | dh = GNUNET_malloc (sizeof (struct GSF_DelayedHandle)); | ||
963 | dh->cp = cp; | ||
964 | dh->pm = pm; | ||
965 | dh->msize = msize; | ||
966 | GNUNET_CONTAINER_DLL_insert (cp->delayed_head, | ||
967 | cp->delayed_tail, | ||
968 | dh); | ||
969 | dh->delay_task = GNUNET_SCHEDULER_add_delayed (get_randomized_delay (), | ||
970 | &transmit_delayed_now, | ||
971 | dh); | ||
972 | } | ||
973 | else | ||
974 | { | ||
975 | (void) GSF_peer_transmit_ (cp, GNUNET_NO, | ||
976 | UINT32_MAX, | ||
977 | REPLY_TIMEOUT, | ||
978 | msize, | ||
979 | ©_reply, | ||
980 | pm); | ||
981 | } | ||
840 | if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST) | 982 | if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST) |
841 | return; | 983 | return; |
842 | if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task) | 984 | if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task) |
@@ -1492,6 +1634,7 @@ GSF_peer_disconnect_handler_ (void *cls, | |||
1492 | { | 1634 | { |
1493 | struct GSF_ConnectedPeer *cp; | 1635 | struct GSF_ConnectedPeer *cp; |
1494 | struct GSF_PeerTransmitHandle *pth; | 1636 | struct GSF_PeerTransmitHandle *pth; |
1637 | struct GSF_DelayedHandle *dh; | ||
1495 | 1638 | ||
1496 | cp = GNUNET_CONTAINER_multihashmap_get (cp_map, | 1639 | cp = GNUNET_CONTAINER_multihashmap_get (cp_map, |
1497 | &peer->hashPubKey); | 1640 | &peer->hashPubKey); |
@@ -1542,6 +1685,15 @@ GSF_peer_disconnect_handler_ (void *cls, | |||
1542 | GNUNET_assert (0 == pth->cth_in_progress); | 1685 | GNUNET_assert (0 == pth->cth_in_progress); |
1543 | GNUNET_free (pth); | 1686 | GNUNET_free (pth); |
1544 | } | 1687 | } |
1688 | while (NULL != (dh = cp->delayed_head)) | ||
1689 | { | ||
1690 | GNUNET_CONTAINER_DLL_remove (cp->delayed_head, | ||
1691 | cp->delayed_tail, | ||
1692 | dh); | ||
1693 | GNUNET_SCHEDULER_cancel (dh->delay_task); | ||
1694 | GNUNET_free (dh->pm); | ||
1695 | GNUNET_free (dh); | ||
1696 | } | ||
1545 | GNUNET_PEER_change_rc (cp->ppd.pid, -1); | 1697 | GNUNET_PEER_change_rc (cp->ppd.pid, -1); |
1546 | if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task) | 1698 | if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task) |
1547 | { | 1699 | { |
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index fe22bd099..c712f58d6 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -222,6 +222,7 @@ client_request_destroy (void *cls, | |||
222 | * @param cls user-specified closure | 222 | * @param cls user-specified closure |
223 | * @param eval evaluation of the result | 223 | * @param eval evaluation of the result |
224 | * @param pr handle to the original pending request | 224 | * @param pr handle to the original pending request |
225 | * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown" | ||
225 | * @param expiration when does 'data' expire? | 226 | * @param expiration when does 'data' expire? |
226 | * @param type type of the block | 227 | * @param type type of the block |
227 | * @param data response data, NULL on request expiration | 228 | * @param data response data, NULL on request expiration |
@@ -231,6 +232,7 @@ static void | |||
231 | client_response_handler (void *cls, | 232 | client_response_handler (void *cls, |
232 | enum GNUNET_BLOCK_EvaluationResult eval, | 233 | enum GNUNET_BLOCK_EvaluationResult eval, |
233 | struct GSF_PendingRequest *pr, | 234 | struct GSF_PendingRequest *pr, |
235 | uint32_t reply_anonymity_level, | ||
234 | struct GNUNET_TIME_Absolute expiration, | 236 | struct GNUNET_TIME_Absolute expiration, |
235 | enum GNUNET_BLOCK_Type type, | 237 | enum GNUNET_BLOCK_Type type, |
236 | const void *data, | 238 | const void *data, |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index d4f14985b..55b256e7d 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -366,6 +366,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
366 | dpr->rh (dpr->rh_cls, | 366 | dpr->rh (dpr->rh_cls, |
367 | GNUNET_BLOCK_EVALUATION_REQUEST_VALID, | 367 | GNUNET_BLOCK_EVALUATION_REQUEST_VALID, |
368 | dpr, | 368 | dpr, |
369 | UINT32_MAX, | ||
369 | GNUNET_TIME_UNIT_FOREVER_ABS, | 370 | GNUNET_TIME_UNIT_FOREVER_ABS, |
370 | GNUNET_BLOCK_TYPE_ANY, | 371 | GNUNET_BLOCK_TYPE_ANY, |
371 | NULL, 0); | 372 | NULL, 0); |
@@ -726,7 +727,7 @@ update_request_performance_data (struct ProcessReplyClosure *prq, | |||
726 | */ | 727 | */ |
727 | static int | 728 | static int |
728 | process_reply (void *cls, | 729 | process_reply (void *cls, |
729 | const GNUNET_HashCode * key, | 730 | const GNUNET_HashCode *key, |
730 | void *value) | 731 | void *value) |
731 | { | 732 | { |
732 | struct ProcessReplyClosure *prq = cls; | 733 | struct ProcessReplyClosure *prq = cls; |
@@ -766,6 +767,7 @@ process_reply (void *cls, | |||
766 | pr->rh (pr->rh_cls, | 767 | pr->rh (pr->rh_cls, |
767 | prq->eval, | 768 | prq->eval, |
768 | pr, | 769 | pr, |
770 | prq->anonymity_level, | ||
769 | prq->expiration, | 771 | prq->expiration, |
770 | prq->type, | 772 | prq->type, |
771 | prq->data, prq->size); | 773 | prq->data, prq->size); |
@@ -825,6 +827,7 @@ process_reply (void *cls, | |||
825 | pr->rh (pr->rh_cls, | 827 | pr->rh (pr->rh_cls, |
826 | prq->eval, | 828 | prq->eval, |
827 | pr, | 829 | pr, |
830 | prq->anonymity_level, | ||
828 | prq->expiration, | 831 | prq->expiration, |
829 | prq->type, | 832 | prq->type, |
830 | prq->data, prq->size); | 833 | prq->data, prq->size); |
@@ -1426,7 +1429,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1426 | prq.type = type; | 1429 | prq.type = type; |
1427 | prq.expiration = expiration; | 1430 | prq.expiration = expiration; |
1428 | prq.priority = 0; | 1431 | prq.priority = 0; |
1429 | prq.anonymity_level = 1; | 1432 | prq.anonymity_level = UINT32_MAX; |
1430 | prq.request_found = GNUNET_NO; | 1433 | prq.request_found = GNUNET_NO; |
1431 | GNUNET_CONTAINER_multihashmap_get_multiple (pr_map, | 1434 | GNUNET_CONTAINER_multihashmap_get_multiple (pr_map, |
1432 | &query, | 1435 | &query, |
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index fa3c51ffd..2f828e281 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -160,6 +160,7 @@ struct GSF_PendingRequestData | |||
160 | * @param cls user-specified closure | 160 | * @param cls user-specified closure |
161 | * @param eval evaluation of the result | 161 | * @param eval evaluation of the result |
162 | * @param pr handle to the original pending request | 162 | * @param pr handle to the original pending request |
163 | * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown" | ||
163 | * @param expiration when does 'data' expire? | 164 | * @param expiration when does 'data' expire? |
164 | * @param type type of the block | 165 | * @param type type of the block |
165 | * @param data response data, NULL on request expiration | 166 | * @param data response data, NULL on request expiration |
@@ -168,6 +169,7 @@ struct GSF_PendingRequestData | |||
168 | typedef void (*GSF_PendingRequestReplyHandler)(void *cls, | 169 | typedef void (*GSF_PendingRequestReplyHandler)(void *cls, |
169 | enum GNUNET_BLOCK_EvaluationResult eval, | 170 | enum GNUNET_BLOCK_EvaluationResult eval, |
170 | struct GSF_PendingRequest *pr, | 171 | struct GSF_PendingRequest *pr, |
172 | uint32_t reply_anonymity_level, | ||
171 | struct GNUNET_TIME_Absolute expiration, | 173 | struct GNUNET_TIME_Absolute expiration, |
172 | enum GNUNET_BLOCK_Type type, | 174 | enum GNUNET_BLOCK_Type type, |
173 | const void *data, | 175 | const void *data, |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 3a5a62756..572585520 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -81,6 +81,7 @@ struct StatValues | |||
81 | */ | 81 | */ |
82 | static struct StatValues stats[] = | 82 | static struct StatValues stats[] = |
83 | { | 83 | { |
84 | { "fs", "# artificial delays introduced (ms)"}, | ||
84 | { "fs", "# queries forwarded"}, | 85 | { "fs", "# queries forwarded"}, |
85 | { "fs", "# replies received and matched"}, | 86 | { "fs", "# replies received and matched"}, |
86 | { "fs", "# results found locally"}, | 87 | { "fs", "# results found locally"}, |
@@ -93,7 +94,6 @@ static struct StatValues stats[] = | |||
93 | { "fs", "# P2P searches discarded (queue length bound)"}, | 94 | { "fs", "# P2P searches discarded (queue length bound)"}, |
94 | { "fs", "# replies received for local clients"}, | 95 | { "fs", "# replies received for local clients"}, |
95 | { "fs", "# queries retransmitted to same target"}, | 96 | { "fs", "# queries retransmitted to same target"}, |
96 | { "fs", "cummulative artificial delay introduced (ms)"}, | ||
97 | { "core", "# bytes decrypted"}, | 97 | { "core", "# bytes decrypted"}, |
98 | { "core", "# bytes encrypted"}, | 98 | { "core", "# bytes encrypted"}, |
99 | { "core", "# discarded CORE_SEND requests"}, | 99 | { "core", "# discarded CORE_SEND requests"}, |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c index 444e7e7c3..0128e281d 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_trust.c +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2010,2011 Christian Grothoff (and other contributing authors) | 3 | (C) 2010, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -33,13 +33,15 @@ | |||
33 | * @author Christian Grothoff | 33 | * @author Christian Grothoff |
34 | * | 34 | * |
35 | * Sample output: | 35 | * Sample output: |
36 | * - 10 MB, 3 peers: | 36 | * - 10 MB, 3 peers, with delays: |
37 | * Download speed of type `seeder 1' was 6 MiB/s | 37 | * Download speed of type `seeder 1' was 757 KiB/s |
38 | * Download speed of type `seeder 2' was 6 MiB/s | 38 | * Download speed of type `seeder 2' was 613 KiB/s |
39 | * Download speed of type `leach` was 1051 KiB/s | 39 | * Download speed of type `leach` was 539 KiB/s |
40 | * | 40 | * |
41 | * Analysis: leach squeezed out entirely early, then gets to | 41 | * - 10 MB, 3 peers, without delays: |
42 | * take its turn once the main downloads complete | 42 | * Download speed of type `seeder 1' was 1784 KiB/s |
43 | * Download speed of type `seeder 2' was 1604 KiB/s | ||
44 | * Download speed of type `leach` was 1384 KiB/s | ||
43 | */ | 45 | */ |
44 | #include "platform.h" | 46 | #include "platform.h" |
45 | #include "fs_test_lib.h" | 47 | #include "fs_test_lib.h" |
@@ -114,6 +116,7 @@ struct StatValues | |||
114 | */ | 116 | */ |
115 | static struct StatValues stats[] = | 117 | static struct StatValues stats[] = |
116 | { | 118 | { |
119 | { "fs", "# artificial delays introduced (ms)"}, | ||
117 | { "fs", "# queries forwarded"}, | 120 | { "fs", "# queries forwarded"}, |
118 | { "fs", "# replies received and matched"}, | 121 | { "fs", "# replies received and matched"}, |
119 | { "fs", "# results found locally"}, | 122 | { "fs", "# results found locally"}, |
@@ -126,13 +129,10 @@ static struct StatValues stats[] = | |||
126 | { "fs", "# P2P searches discarded (queue length bound)"}, | 129 | { "fs", "# P2P searches discarded (queue length bound)"}, |
127 | { "fs", "# replies received for local clients"}, | 130 | { "fs", "# replies received for local clients"}, |
128 | { "fs", "# queries retransmitted to same target"}, | 131 | { "fs", "# queries retransmitted to same target"}, |
129 | { "fs", "cummulative artificial delay introduced (ms)"}, | ||
130 | { "core", "# bytes decrypted"}, | 132 | { "core", "# bytes decrypted"}, |
131 | { "core", "# bytes encrypted"}, | 133 | { "core", "# bytes encrypted"}, |
132 | { "core", "# discarded CORE_SEND requests"}, | 134 | { "core", "# discarded CORE_SEND requests"}, |
133 | { "core", "# discarded CORE_SEND request bytes"}, | ||
134 | { "core", "# discarded lower priority CORE_SEND requests"}, | 135 | { "core", "# discarded lower priority CORE_SEND requests"}, |
135 | { "core", "# discarded lower priority CORE_SEND request bytes"}, | ||
136 | { "transport", "# bytes received via TCP"}, | 136 | { "transport", "# bytes received via TCP"}, |
137 | { "transport", "# bytes transmitted via TCP"}, | 137 | { "transport", "# bytes transmitted via TCP"}, |
138 | { "datacache", "# bytes stored"}, | 138 | { "datacache", "# bytes stored"}, |
@@ -309,12 +309,12 @@ do_downloads (void *cls, | |||
309 | VERBOSE, | 309 | VERBOSE, |
310 | &do_report, "leach"); | 310 | &do_report, "leach"); |
311 | /* mutual downloads of (primary) sharing peers */ | 311 | /* mutual downloads of (primary) sharing peers */ |
312 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-1], | 312 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-2], |
313 | TIMEOUT, | 313 | TIMEOUT, |
314 | anonymity, SEED1, uri1, | 314 | anonymity, SEED1, uri1, |
315 | VERBOSE, | 315 | VERBOSE, |
316 | &do_report, "seeder 2"); | 316 | &do_report, "seeder 2"); |
317 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-2], | 317 | GNUNET_FS_TEST_download (daemons[NUM_DAEMONS-1], |
318 | TIMEOUT, | 318 | TIMEOUT, |
319 | anonymity, SEED2, uri2, | 319 | anonymity, SEED2, uri2, |
320 | VERBOSE, | 320 | VERBOSE, |