diff options
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r-- | src/transport/gnunet-service-tng.c | 243 |
1 files changed, 62 insertions, 181 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index 18a80b3c5..bae187e7c 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -27,71 +27,50 @@ | |||
27 | * - review retransmission logic, right now there is no smartness there! | 27 | * - review retransmission logic, right now there is no smartness there! |
28 | * => congestion control, etc [PERFORMANCE-BASICS] | 28 | * => congestion control, etc [PERFORMANCE-BASICS] |
29 | * | 29 | * |
30 | * Optimizations: | 30 | * Optimizations-Statistics: |
31 | * - Track ACK losses based on ACK-counter [ROUTING] | ||
32 | * - Need to track total bandwidth per VirtualLink and adjust how frequently | ||
33 | * we send FC messages based on bandwidth-delay-product (and relation | ||
34 | * to the window size!). See OPTIMIZE-FC-BDP. | ||
35 | * - Consider more statistics in #check_connection_quality() [FIXME-CONQ-STATISTICS] | ||
36 | * - Adapt available_fc_window_size, using larger values for high-bandwidth | ||
37 | * and high-latency links *if* we have the RAM [GOODPUT / utilization / stalls] | ||
38 | * - Set last_window_consum_limit promise properly based on | ||
39 | * latency and bandwidth of the respective connection [GOODPUT / utilization / stalls] | ||
40 | * | ||
41 | * Optimizations-DV: | ||
31 | * - When forwarding DV learn messages, if a peer is reached that | 42 | * - When forwarding DV learn messages, if a peer is reached that |
32 | * has a *bidirectional* link to the origin beyond 1st hop, | 43 | * has a *bidirectional* link to the origin beyond 1st hop, |
33 | * do NOT forward it to peers _other_ than the origin, as | 44 | * do NOT forward it to peers _other_ than the origin, as |
34 | * there is clearly a better path directly from the origin to | 45 | * there is clearly a better path directly from the origin to |
35 | * whatever else we could reach. | 46 | * whatever else we could reach. |
36 | * - AcknowledgementUUIDPs are overkill with 256 bits (128 would do) | ||
37 | * => Need 128 bit hash map though! [BANDWIDTH, MEMORY] | ||
38 | * - queue_send_msg by API design has to make a copy | ||
39 | * of the payload, and route_message on top of that requires a malloc/free. | ||
40 | * Change design to approximate "zero" copy better... [CPU] | ||
41 | * - could avoid copying body of message into each fragment and keep | ||
42 | * fragments as just pointers into the original message and only | ||
43 | * fully build fragments just before transmission (optimization, should | ||
44 | * reduce CPU and memory use) [CPU, MEMORY] | ||
45 | * - if messages are below MTU, consider adding ACKs and other stuff | ||
46 | * to the same transmission to avoid tiny messages (requires planning at | ||
47 | * receiver, and additional MST-style demultiplex at receiver!) [PACKET COUNT] | ||
48 | * - When we passively learned DV (with unconfirmed freshness), we | 47 | * - When we passively learned DV (with unconfirmed freshness), we |
49 | * right now add the path to our list but with a zero path_valid_until | 48 | * right now add the path to our list but with a zero path_valid_until |
50 | * time and only use it for unconfirmed routes. However, we could consider | 49 | * time and only use it for unconfirmed routes. However, we could consider |
51 | * triggering an explicit validation mechansim ourselves, specifically routing | 50 | * triggering an explicit validation mechansim ourselves, specifically routing |
52 | * a challenge-response message over the path [ROUTING] | 51 | * a challenge-response message over the path [ROUTING] |
53 | * - Track ACK losses based on ACK-counter [ROUTING] | 52 | * = if available, try to confirm unconfirmed DV paths when trying to establish |
54 | * - Fragments send over a reliable channel could do without the | ||
55 | * AcknowledgementUUIDP altogether, as they won't be acked! [BANDWIDTH] | ||
56 | * (-> have 2nd type of acknowledgment message; low priority, as we | ||
57 | * do not have an MTU-limited *reliable* communicator) | ||
58 | * - Adapt available_fc_window_size, using larger values for high-bandwidth | ||
59 | * and high-latency links *if* we have the RAM [GOODPUT / utilization / stalls] | ||
60 | * - Set last_window_consum_limit promise properly based on | ||
61 | * latency and bandwidth of the respective connection [GOODPUT / utilization / stalls] | ||
62 | * - Need to track total bandwidth per VirtualLink and adjust how frequently | ||
63 | * we send FC messages based on bandwidth-delay-product (and relation | ||
64 | * to the window size!). See OPTIMIZE-FC-BDP. | ||
65 | * - if available, try to confirm unconfirmed DV paths when trying to establish | ||
66 | * virtual link for a `struct IncomingRequest`. (i.e. if DVH is | 53 | * virtual link for a `struct IncomingRequest`. (i.e. if DVH is |
67 | * unconfirmed, incoming requests cause us to try to validate a passively | 54 | * unconfirmed, incoming requests cause us to try to validate a passively |
68 | * learned path (requires new message type!)) | 55 | * learned path (requires new message type!)) |
69 | * | 56 | * |
70 | * Design realizations / discussion: | 57 | * Optimizations-Fragmentation: |
71 | * - communicators do flow control by calling MQ "notify sent" | 58 | * - Fragments send over a reliable channel could do without the |
72 | * when 'ready'. They determine flow implicitly (i.e. TCP blocking) | 59 | * AcknowledgementUUIDP altogether, as they won't be acked! [BANDWIDTH] |
73 | * or explicitly via backchannel FC ACKs. As long as the | 60 | * (-> have 2nd type of acknowledgment message; low priority, as we |
74 | * channel is not full, they may 'notify sent' even if the other | 61 | * do not have an MTU-limited *reliable* communicator) [FIXME-FRAG-REL-UUID] |
75 | * peer has not yet confirmed receipt. The other peer confirming | 62 | * - if messages are below MTU, consider adding ACKs and other stuff |
76 | * is _only_ for FC, not for more reliable transmission; reliable | 63 | * to the same transmission to avoid tiny messages (requires planning at |
77 | * transmission (i.e. of fragments) is left to _transport_. | 64 | * receiver, and additional MST-style demultiplex at receiver!) [PACKET COUNT] |
78 | * - ACKs sent back in uni-directional communicators are done via | 65 | * |
79 | * the background channel API; here transport _may_ initially | 66 | * Optimizations-internals: |
80 | * broadcast (with bounded # hops) if no path is known; | 67 | * - queue_send_msg by API design has to make a copy |
81 | * - transport should _integrate_ DV-routing and build a view of | 68 | * of the payload, and route_message on top of that requires a malloc/free. |
82 | * the network; then background channel traffic can be | 69 | * Change design to approximate "zero" copy better... [CPU] |
83 | * routed via DV as well as explicit "DV" traffic. | 70 | * - could avoid copying body of message into each fragment and keep |
84 | * - background channel is also used for ACKs and NAT traversal support | 71 | * fragments as just pointers into the original message and only |
85 | * - transport service is responsible for AEAD'ing the background | 72 | * fully build fragments just before transmission (optimization, should |
86 | * channel, timestamps and monotonic time are used against replay | 73 | * reduce CPU and memory use) [CPU, MEMORY] |
87 | * of old messages -> peerstore needs to be supplied with | ||
88 | * "latest timestamps seen" data | ||
89 | * - if transport implements DV, we likely need a 3rd peermap | ||
90 | * in addition to ephemerals and (direct) neighbours | ||
91 | * ==> check if stuff needs to be moved out of "Neighbour" | ||
92 | * - transport should encapsualte core-level messages and do its | ||
93 | * own ACKing for RTT/goodput/loss measurements _and_ fragment | ||
94 | * for retransmission | ||
95 | */ | 74 | */ |
96 | #include "platform.h" | 75 | #include "platform.h" |
97 | #include "gnunet_util_lib.h" | 76 | #include "gnunet_util_lib.h" |
@@ -345,9 +324,9 @@ struct MessageUUIDP | |||
345 | struct AcknowledgementUUIDP | 324 | struct AcknowledgementUUIDP |
346 | { | 325 | { |
347 | /** | 326 | /** |
348 | * The UUID value. Not actually a hash, but a random value. | 327 | * The UUID value. |
349 | */ | 328 | */ |
350 | struct GNUNET_ShortHashCode value; | 329 | struct GNUNET_Uuid value; |
351 | }; | 330 | }; |
352 | 331 | ||
353 | 332 | ||
@@ -1311,18 +1290,6 @@ struct VirtualLink | |||
1311 | struct DistanceVector *dv; | 1290 | struct DistanceVector *dv; |
1312 | 1291 | ||
1313 | /** | 1292 | /** |
1314 | * Last challenge we received from @a n. | ||
1315 | * FIXME: where do we need this? | ||
1316 | */ | ||
1317 | struct ChallengeNonceP n_challenge; | ||
1318 | |||
1319 | /** | ||
1320 | * Last challenge we used with @a n for flow control. | ||
1321 | * FIXME: where do we need this? | ||
1322 | */ | ||
1323 | struct ChallengeNonceP my_challenge; | ||
1324 | |||
1325 | /** | ||
1326 | * Sender timestamp of @e n_challenge, used to generate out-of-order | 1293 | * Sender timestamp of @e n_challenge, used to generate out-of-order |
1327 | * challenges (as sender's timestamps must be monotonically | 1294 | * challenges (as sender's timestamps must be monotonically |
1328 | * increasing). FIXME: where do we need this? | 1295 | * increasing). FIXME: where do we need this? |
@@ -2736,7 +2703,7 @@ static struct GNUNET_CONTAINER_MultiPeerMap *ack_cummulators; | |||
2736 | * Map of pending acknowledgements, mapping `struct AcknowledgementUUID` to | 2703 | * Map of pending acknowledgements, mapping `struct AcknowledgementUUID` to |
2737 | * a `struct PendingAcknowledgement`. | 2704 | * a `struct PendingAcknowledgement`. |
2738 | */ | 2705 | */ |
2739 | static struct GNUNET_CONTAINER_MultiShortmap *pending_acks; | 2706 | static struct GNUNET_CONTAINER_MultiUuidmap *pending_acks; |
2740 | 2707 | ||
2741 | /** | 2708 | /** |
2742 | * Map from PIDs to `struct DistanceVector` entries describing | 2709 | * Map from PIDs to `struct DistanceVector` entries describing |
@@ -2910,9 +2877,9 @@ free_pending_acknowledgement (struct PendingAcknowledgement *pa) | |||
2910 | pa->queue = NULL; | 2877 | pa->queue = NULL; |
2911 | } | 2878 | } |
2912 | GNUNET_assert (GNUNET_YES == | 2879 | GNUNET_assert (GNUNET_YES == |
2913 | GNUNET_CONTAINER_multishortmap_remove (pending_acks, | 2880 | GNUNET_CONTAINER_multiuuidmap_remove (pending_acks, |
2914 | &pa->ack_uuid.value, | 2881 | &pa->ack_uuid.value, |
2915 | pa)); | 2882 | pa)); |
2916 | GNUNET_free (pa); | 2883 | GNUNET_free (pa); |
2917 | } | 2884 | } |
2918 | 2885 | ||
@@ -3905,11 +3872,12 @@ client_send_response (struct PendingMessage *pm) | |||
3905 | { | 3872 | { |
3906 | struct TransportClient *tc = pm->client; | 3873 | struct TransportClient *tc = pm->client; |
3907 | struct VirtualLink *vl = pm->vl; | 3874 | struct VirtualLink *vl = pm->vl; |
3908 | struct GNUNET_MQ_Envelope *env; | ||
3909 | struct SendOkMessage *som; | ||
3910 | 3875 | ||
3911 | if (NULL != tc) | 3876 | if (NULL != tc) |
3912 | { | 3877 | { |
3878 | struct GNUNET_MQ_Envelope *env; | ||
3879 | struct SendOkMessage *som; | ||
3880 | |||
3913 | env = GNUNET_MQ_msg (som, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); | 3881 | env = GNUNET_MQ_msg (som, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); |
3914 | som->peer = vl->target; | 3882 | som->peer = vl->target; |
3915 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3883 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -4225,7 +4193,7 @@ queue_send_msg (struct Queue *queue, | |||
4225 | GNUNET_ERROR_TYPE_DEBUG, | 4193 | GNUNET_ERROR_TYPE_DEBUG, |
4226 | "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n", | 4194 | "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n", |
4227 | (unsigned int) payload_size, | 4195 | (unsigned int) payload_size, |
4228 | pm->logging_uuid, | 4196 | (NULL == pm) ? 0 : pm->logging_uuid, |
4229 | (unsigned long long) queue->qid, | 4197 | (unsigned long long) queue->qid, |
4230 | GNUNET_i2s (&queue->neighbour->pid)); | 4198 | GNUNET_i2s (&queue->neighbour->pid)); |
4231 | env = GNUNET_MQ_msg_extra (smt, | 4199 | env = GNUNET_MQ_msg_extra (smt, |
@@ -4626,11 +4594,11 @@ encapsulate_for_dv (struct DistanceVector *dv, | |||
4626 | char *path; | 4594 | char *path; |
4627 | 4595 | ||
4628 | path = GNUNET_strdup (GNUNET_i2s (&GST_my_identity)); | 4596 | path = GNUNET_strdup (GNUNET_i2s (&GST_my_identity)); |
4629 | for (unsigned int i = 0; i <= num_hops; i++) | 4597 | for (unsigned int j = 0; j <= num_hops; j++) |
4630 | { | 4598 | { |
4631 | char *tmp; | 4599 | char *tmp; |
4632 | 4600 | ||
4633 | GNUNET_asprintf (&tmp, "%s-%s", path, GNUNET_i2s (&dhops[i])); | 4601 | GNUNET_asprintf (&tmp, "%s-%s", path, GNUNET_i2s (&dhops[j])); |
4634 | GNUNET_free (path); | 4602 | GNUNET_free (path); |
4635 | path = tmp; | 4603 | path = tmp; |
4636 | } | 4604 | } |
@@ -5468,7 +5436,7 @@ cummulative_ack (const struct GNUNET_PeerIdentity *pid, | |||
5468 | 5436 | ||
5469 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5437 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5470 | "Scheduling ACK %s for transmission to %s\n", | 5438 | "Scheduling ACK %s for transmission to %s\n", |
5471 | GNUNET_sh2s (&ack_uuid->value), | 5439 | GNUNET_uuid2s (&ack_uuid->value), |
5472 | GNUNET_i2s (pid)); | 5440 | GNUNET_i2s (pid)); |
5473 | ac = GNUNET_CONTAINER_multipeermap_get (ack_cummulators, pid); | 5441 | ac = GNUNET_CONTAINER_multipeermap_get (ack_cummulators, pid); |
5474 | if (NULL == ac) | 5442 | if (NULL == ac) |
@@ -5743,7 +5711,7 @@ handle_reliability_box (void *cls, | |||
5743 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5711 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5744 | "Received reliability box from %s with UUID %s of type %u\n", | 5712 | "Received reliability box from %s with UUID %s of type %u\n", |
5745 | GNUNET_i2s (&cmc->im.sender), | 5713 | GNUNET_i2s (&cmc->im.sender), |
5746 | GNUNET_sh2s (&rb->ack_uuid.value), | 5714 | GNUNET_uuid2s (&rb->ack_uuid.value), |
5747 | (unsigned int) ntohs (inbox->type)); | 5715 | (unsigned int) ntohs (inbox->type)); |
5748 | rtt = GNUNET_TIME_UNIT_SECONDS; /* FIXME: should base this on "RTT", but we | 5716 | rtt = GNUNET_TIME_UNIT_SECONDS; /* FIXME: should base this on "RTT", but we |
5749 | do not really have an RTT for the | 5717 | do not really have an RTT for the |
@@ -5971,7 +5939,6 @@ handle_reliability_ack (void *cls, | |||
5971 | { | 5939 | { |
5972 | struct CommunicatorMessageContext *cmc = cls; | 5940 | struct CommunicatorMessageContext *cmc = cls; |
5973 | const struct TransportCummulativeAckPayloadP *ack; | 5941 | const struct TransportCummulativeAckPayloadP *ack; |
5974 | struct PendingAcknowledgement *pa; | ||
5975 | unsigned int n_acks; | 5942 | unsigned int n_acks; |
5976 | uint32_t ack_counter; | 5943 | uint32_t ack_counter; |
5977 | 5944 | ||
@@ -5980,14 +5947,14 @@ handle_reliability_ack (void *cls, | |||
5980 | ack = (const struct TransportCummulativeAckPayloadP *) &ra[1]; | 5947 | ack = (const struct TransportCummulativeAckPayloadP *) &ra[1]; |
5981 | for (unsigned int i = 0; i < n_acks; i++) | 5948 | for (unsigned int i = 0; i < n_acks; i++) |
5982 | { | 5949 | { |
5983 | pa = | 5950 | struct PendingAcknowledgement *pa = |
5984 | GNUNET_CONTAINER_multishortmap_get (pending_acks, &ack[i].ack_uuid.value); | 5951 | GNUNET_CONTAINER_multiuuidmap_get (pending_acks, &ack[i].ack_uuid.value); |
5985 | if (NULL == pa) | 5952 | if (NULL == pa) |
5986 | { | 5953 | { |
5987 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 5954 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
5988 | "Received ACK from %s with UUID %s which is unknown to us!\n", | 5955 | "Received ACK from %s with UUID %s which is unknown to us!\n", |
5989 | GNUNET_i2s (&cmc->im.sender), | 5956 | GNUNET_i2s (&cmc->im.sender), |
5990 | GNUNET_sh2s (&ack[i].ack_uuid.value)); | 5957 | GNUNET_uuid2s (&ack[i].ack_uuid.value)); |
5991 | GNUNET_STATISTICS_update ( | 5958 | GNUNET_STATISTICS_update ( |
5992 | GST_stats, | 5959 | GST_stats, |
5993 | "# FRAGMENT_ACKS dropped, no matching pending message", | 5960 | "# FRAGMENT_ACKS dropped, no matching pending message", |
@@ -5998,7 +5965,7 @@ handle_reliability_ack (void *cls, | |||
5998 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5965 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5999 | "Received ACK from %s with UUID %s\n", | 5966 | "Received ACK from %s with UUID %s\n", |
6000 | GNUNET_i2s (&cmc->im.sender), | 5967 | GNUNET_i2s (&cmc->im.sender), |
6001 | GNUNET_sh2s (&ack[i].ack_uuid.value)); | 5968 | GNUNET_uuid2s (&ack[i].ack_uuid.value)); |
6002 | handle_acknowledged (pa, GNUNET_TIME_relative_ntoh (ack[i].ack_delay)); | 5969 | handle_acknowledged (pa, GNUNET_TIME_relative_ntoh (ack[i].ack_delay)); |
6003 | } | 5970 | } |
6004 | 5971 | ||
@@ -6919,7 +6886,7 @@ handle_dv_learn (void *cls, const struct TransportDVLearnMessage *dvl) | |||
6919 | 6886 | ||
6920 | if (0 == (bi_history & (1 << i))) | 6887 | if (0 == (bi_history & (1 << i))) |
6921 | break; /* i-th hop not bi-directional, stop learning! */ | 6888 | break; /* i-th hop not bi-directional, stop learning! */ |
6922 | if (i == nhops) | 6889 | if (i == nhops - 1) |
6923 | { | 6890 | { |
6924 | path[i + 2] = dvl->initiator; | 6891 | path[i + 2] = dvl->initiator; |
6925 | } | 6892 | } |
@@ -7557,89 +7524,6 @@ check_incoming_msg (void *cls, | |||
7557 | } | 7524 | } |
7558 | 7525 | ||
7559 | 7526 | ||
7560 | #if 0 | ||
7561 | /** | ||
7562 | * We received a @a challenge from another peer, check if we can | ||
7563 | * increase the flow control window to that peer. | ||
7564 | * | ||
7565 | * @param vl virtual link | ||
7566 | * @param challenge the challenge we received | ||
7567 | * @param sender_time when did the peer send the message? | ||
7568 | * @param last_window_consum_limit maximum number of kb the sender | ||
7569 | * promises to use of the previous window (if any) | ||
7570 | */ | ||
7571 | static void | ||
7572 | update_fc_window (struct VirtualLink *vl, | ||
7573 | struct GNUNET_TIME_Absolute sender_time, | ||
7574 | uint32_t last_window_consum_limit) | ||
7575 | { | ||
7576 | // FIXME: update to new FC logic | ||
7577 | if (0 == GNUNET_memcmp (challenge, &vl->n_challenge)) | ||
7578 | { | ||
7579 | uint32_t avail; | ||
7580 | |||
7581 | /* Challenge identical to last one, update | ||
7582 | @a last_window_consum_limit (to minimum) */ | ||
7583 | vl->last_fc_window_size_remaining = | ||
7584 | GNUNET_MIN (last_window_consum_limit, vl->last_fc_window_size_remaining); | ||
7585 | /* window could have shrunk! */ | ||
7586 | if (vl->available_fc_window_size > vl->last_fc_window_size_remaining) | ||
7587 | avail = vl->available_fc_window_size - vl->last_fc_window_size_remaining; | ||
7588 | else | ||
7589 | avail = 0; | ||
7590 | /* guard against integer overflow */ | ||
7591 | if (vl->incoming_fc_window_size_used + avail >= | ||
7592 | vl->incoming_fc_window_size_used) | ||
7593 | vl->incoming_fc_window_size = vl->incoming_fc_window_size_used + avail; | ||
7594 | else | ||
7595 | vl->incoming_fc_window_size = UINT32_MAX; | ||
7596 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
7597 | "Updated window to %u/%u kb (%u used) for virtual link to %s!\n", | ||
7598 | vl->incoming_fc_window_size, | ||
7599 | vl->available_fc_window_size, | ||
7600 | vl->incoming_fc_window_size_used, | ||
7601 | GNUNET_i2s (&vl->target)); | ||
7602 | return; | ||
7603 | } | ||
7604 | if (vl->n_challenge_time.abs_value_us >= sender_time.abs_value_us) | ||
7605 | { | ||
7606 | GNUNET_STATISTICS_update (GST_stats, | ||
7607 | "# Challenges ignored: sender time not increasing", | ||
7608 | 1, | ||
7609 | GNUNET_NO); | ||
7610 | return; | ||
7611 | } | ||
7612 | /* new challenge! */ | ||
7613 | if (vl->incoming_fc_window_size_used > last_window_consum_limit) | ||
7614 | { | ||
7615 | /* lying peer: it already used more than it promised it would ever use! */ | ||
7616 | GNUNET_break_op (0); | ||
7617 | last_window_consum_limit = vl->incoming_fc_window_size_used; | ||
7618 | } | ||
7619 | /* What remains is at most the difference between what we already processed | ||
7620 | and what the sender promises to limit itself to. */ | ||
7621 | vl->last_fc_window_size_remaining = | ||
7622 | last_window_consum_limit - vl->incoming_fc_window_size_used; | ||
7623 | vl->n_challenge = *challenge; | ||
7624 | vl->n_challenge_time = sender_time; | ||
7625 | vl->incoming_fc_window_size_used = 0; | ||
7626 | /* window could have shrunk! */ | ||
7627 | if (vl->available_fc_window_size > vl->last_fc_window_size_remaining) | ||
7628 | vl->incoming_fc_window_size = | ||
7629 | vl->available_fc_window_size - vl->last_fc_window_size_remaining; | ||
7630 | else | ||
7631 | vl->incoming_fc_window_size = 0; | ||
7632 | GNUNET_log ( | ||
7633 | GNUNET_ERROR_TYPE_DEBUG, | ||
7634 | "New window at %u/%u kb (%u left on previous) for virtual link to %s!\n", | ||
7635 | vl->incoming_fc_window_size, | ||
7636 | vl->available_fc_window_size, | ||
7637 | vl->last_fc_window_size_remaining, | ||
7638 | GNUNET_i2s (&vl->target)); | ||
7639 | } | ||
7640 | #endif | ||
7641 | |||
7642 | |||
7643 | /** | 7527 | /** |
7644 | * Closure for #check_known_address. | 7528 | * Closure for #check_known_address. |
7645 | */ | 7529 | */ |
@@ -8155,7 +8039,6 @@ handle_validation_response ( | |||
8155 | n->vl = vl; | 8039 | n->vl = vl; |
8156 | vl->core_recv_window = RECV_WINDOW_SIZE; | 8040 | vl->core_recv_window = RECV_WINDOW_SIZE; |
8157 | vl->available_fc_window_size = DEFAULT_WINDOW_SIZE; | 8041 | vl->available_fc_window_size = DEFAULT_WINDOW_SIZE; |
8158 | vl->my_challenge = tvr->challenge; | ||
8159 | vl->visibility_task = | 8042 | vl->visibility_task = |
8160 | GNUNET_SCHEDULER_add_at (q->validated_until, &check_link_down, vl); | 8043 | GNUNET_SCHEDULER_add_at (q->validated_until, &check_link_down, vl); |
8161 | GNUNET_break (GNUNET_YES == | 8044 | GNUNET_break (GNUNET_YES == |
@@ -8412,7 +8295,7 @@ prepare_pending_acknowledgement (struct Queue *queue, | |||
8412 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, | 8295 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, |
8413 | &pa->ack_uuid, | 8296 | &pa->ack_uuid, |
8414 | sizeof (pa->ack_uuid)); | 8297 | sizeof (pa->ack_uuid)); |
8415 | } while (GNUNET_YES != GNUNET_CONTAINER_multishortmap_put ( | 8298 | } while (GNUNET_YES != GNUNET_CONTAINER_multiuuidmap_put ( |
8416 | pending_acks, | 8299 | pending_acks, |
8417 | &pa->ack_uuid.value, | 8300 | &pa->ack_uuid.value, |
8418 | pa, | 8301 | pa, |
@@ -8425,7 +8308,7 @@ prepare_pending_acknowledgement (struct Queue *queue, | |||
8425 | pa->message_size = pm->bytes_msg; | 8308 | pa->message_size = pm->bytes_msg; |
8426 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 8309 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
8427 | "Waiting for ACKnowledgment `%s' for <%llu>\n", | 8310 | "Waiting for ACKnowledgment `%s' for <%llu>\n", |
8428 | GNUNET_sh2s (&pa->ack_uuid.value), | 8311 | GNUNET_uuid2s (&pa->ack_uuid.value), |
8429 | pm->logging_uuid); | 8312 | pm->logging_uuid); |
8430 | return pa; | 8313 | return pa; |
8431 | } | 8314 | } |
@@ -8746,10 +8629,9 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc, | |||
8746 | this queue */) ) | 8629 | this queue */) ) |
8747 | { | 8630 | { |
8748 | frag = GNUNET_YES; | 8631 | frag = GNUNET_YES; |
8749 | relb = GNUNET_NO; /* if we fragment, we never also reliability box */ | ||
8750 | if (GNUNET_TRANSPORT_CC_RELIABLE == queue->tc->details.communicator.cc) | 8632 | if (GNUNET_TRANSPORT_CC_RELIABLE == queue->tc->details.communicator.cc) |
8751 | { | 8633 | { |
8752 | /* FIXME-OPTIMIZE: we could use an optimized, shorter fragmentation | 8634 | /* FIXME-FRAG-REL-UUID: we could use an optimized, shorter fragmentation |
8753 | header without the ACK UUID when using a *reliable* channel! */ | 8635 | header without the ACK UUID when using a *reliable* channel! */ |
8754 | } | 8636 | } |
8755 | real_overhead = overhead + sizeof (struct TransportFragmentBoxMessage); | 8637 | real_overhead = overhead + sizeof (struct TransportFragmentBoxMessage); |
@@ -8946,8 +8828,9 @@ transmit_on_queue (void *cls) | |||
8946 | "Fragmentation failed queue %s to %s for <%llu>, trying again\n", | 8828 | "Fragmentation failed queue %s to %s for <%llu>, trying again\n", |
8947 | queue->address, | 8829 | queue->address, |
8948 | GNUNET_i2s (&n->pid), | 8830 | GNUNET_i2s (&n->pid), |
8949 | pm->logging_uuid); | 8831 | sc.best->logging_uuid); |
8950 | schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); | 8832 | schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); |
8833 | return; | ||
8951 | } | 8834 | } |
8952 | } | 8835 | } |
8953 | else if (GNUNET_YES == sc.relb) | 8836 | else if (GNUNET_YES == sc.relb) |
@@ -8961,7 +8844,7 @@ transmit_on_queue (void *cls) | |||
8961 | "Reliability boxing failed queue %s to %s for <%llu>, trying again\n", | 8844 | "Reliability boxing failed queue %s to %s for <%llu>, trying again\n", |
8962 | queue->address, | 8845 | queue->address, |
8963 | GNUNET_i2s (&n->pid), | 8846 | GNUNET_i2s (&n->pid), |
8964 | pm->logging_uuid); | 8847 | sc.best->logging_uuid); |
8965 | schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); | 8848 | schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); |
8966 | return; | 8849 | return; |
8967 | } | 8850 | } |
@@ -9442,7 +9325,7 @@ check_connection_quality (void *cls, | |||
9442 | ctx->num_queues++; | 9325 | ctx->num_queues++; |
9443 | if (0 == ctx->k--) | 9326 | if (0 == ctx->k--) |
9444 | ctx->q = q; | 9327 | ctx->q = q; |
9445 | /* OPTIMIZE-FIXME: in the future, add reliability / goodput | 9328 | /* FIXME-CONQ-STATISTICS: in the future, add reliability / goodput |
9446 | statistics and consider those as well here? */ | 9329 | statistics and consider those as well here? */ |
9447 | if (q->pd.aged_rtt.rel_value_us < DV_QUALITY_RTT_THRESHOLD.rel_value_us) | 9330 | if (q->pd.aged_rtt.rel_value_us < DV_QUALITY_RTT_THRESHOLD.rel_value_us) |
9448 | do_inc = GNUNET_YES; | 9331 | do_inc = GNUNET_YES; |
@@ -10017,9 +9900,7 @@ free_validation_state_cb (void *cls, | |||
10017 | * @return #GNUNET_OK (always) | 9900 | * @return #GNUNET_OK (always) |
10018 | */ | 9901 | */ |
10019 | static int | 9902 | static int |
10020 | free_pending_ack_cb (void *cls, | 9903 | free_pending_ack_cb (void *cls, const struct GNUNET_Uuid *key, void *value) |
10021 | const struct GNUNET_ShortHashCode *key, | ||
10022 | void *value) | ||
10023 | { | 9904 | { |
10024 | struct PendingAcknowledgement *pa = value; | 9905 | struct PendingAcknowledgement *pa = value; |
10025 | 9906 | ||
@@ -10085,10 +9966,10 @@ do_shutdown (void *cls) | |||
10085 | NULL); | 9966 | NULL); |
10086 | GNUNET_CONTAINER_multipeermap_destroy (ack_cummulators); | 9967 | GNUNET_CONTAINER_multipeermap_destroy (ack_cummulators); |
10087 | ack_cummulators = NULL; | 9968 | ack_cummulators = NULL; |
10088 | GNUNET_CONTAINER_multishortmap_iterate (pending_acks, | 9969 | GNUNET_CONTAINER_multiuuidmap_iterate (pending_acks, |
10089 | &free_pending_ack_cb, | 9970 | &free_pending_ack_cb, |
10090 | NULL); | 9971 | NULL); |
10091 | GNUNET_CONTAINER_multishortmap_destroy (pending_acks); | 9972 | GNUNET_CONTAINER_multiuuidmap_destroy (pending_acks); |
10092 | pending_acks = NULL; | 9973 | pending_acks = NULL; |
10093 | GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_size (neighbours)); | 9974 | GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_size (neighbours)); |
10094 | GNUNET_CONTAINER_multipeermap_destroy (neighbours); | 9975 | GNUNET_CONTAINER_multipeermap_destroy (neighbours); |
@@ -10142,7 +10023,7 @@ run (void *cls, | |||
10142 | hello_mono_time = GNUNET_TIME_absolute_get_monotonic (c); | 10023 | hello_mono_time = GNUNET_TIME_absolute_get_monotonic (c); |
10143 | GST_cfg = c; | 10024 | GST_cfg = c; |
10144 | backtalkers = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES); | 10025 | backtalkers = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES); |
10145 | pending_acks = GNUNET_CONTAINER_multishortmap_create (32768, GNUNET_YES); | 10026 | pending_acks = GNUNET_CONTAINER_multiuuidmap_create (32768, GNUNET_YES); |
10146 | ack_cummulators = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_YES); | 10027 | ack_cummulators = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_YES); |
10147 | neighbours = GNUNET_CONTAINER_multipeermap_create (1024, GNUNET_YES); | 10028 | neighbours = GNUNET_CONTAINER_multipeermap_create (1024, GNUNET_YES); |
10148 | links = GNUNET_CONTAINER_multipeermap_create (512, GNUNET_YES); | 10029 | links = GNUNET_CONTAINER_multipeermap_create (512, GNUNET_YES); |