aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-24 17:30:27 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-24 17:30:27 +0100
commit52516482b8c9e67cadedff1da77313fd79abf4d1 (patch)
tree02c48e200a33d7f1251191b0c9287cf411cd250a /src/transport
parent7847eaa0188919dfb7d96c15dc289cbd4e677e58 (diff)
downloadgnunet-52516482b8c9e67cadedff1da77313fd79abf4d1.tar.gz
gnunet-52516482b8c9e67cadedff1da77313fd79abf4d1.zip
-more tng
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-tng.c42
-rw-r--r--src/transport/test_transport_api2_tcp_peer1.conf2
-rw-r--r--src/transport/test_transport_api2_tcp_peer2.conf2
3 files changed, 37 insertions, 9 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 37ab5ff55..8357947dd 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -3451,6 +3451,8 @@ schedule_transmit_on_queue (struct Queue *queue,
3451 if (queue->tc->details.communicator.total_queue_length >= 3451 if (queue->tc->details.communicator.total_queue_length >=
3452 COMMUNICATOR_TOTAL_QUEUE_LIMIT) 3452 COMMUNICATOR_TOTAL_QUEUE_LIMIT)
3453 { 3453 {
3454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3455 "Transmission throttled due to communicator queue limit\n");
3454 GNUNET_STATISTICS_update ( 3456 GNUNET_STATISTICS_update (
3455 GST_stats, 3457 GST_stats,
3456 "# Transmission throttled due to communicator queue limit", 3458 "# Transmission throttled due to communicator queue limit",
@@ -3461,6 +3463,8 @@ schedule_transmit_on_queue (struct Queue *queue,
3461 } 3463 }
3462 if (queue->queue_length >= QUEUE_LENGTH_LIMIT) 3464 if (queue->queue_length >= QUEUE_LENGTH_LIMIT)
3463 { 3465 {
3466 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3467 "Transmission throttled due to communicator queue length limit\n");
3464 GNUNET_STATISTICS_update (GST_stats, 3468 GNUNET_STATISTICS_update (GST_stats,
3465 "# Transmission throttled due to queue queue limit", 3469 "# Transmission throttled due to queue queue limit",
3466 1, 3470 1,
@@ -4157,7 +4161,7 @@ queue_send_msg (struct Queue *queue,
4157 struct GNUNET_TRANSPORT_SendMessageTo *smt; 4161 struct GNUNET_TRANSPORT_SendMessageTo *smt;
4158 struct GNUNET_MQ_Envelope *env; 4162 struct GNUNET_MQ_Envelope *env;
4159 4163
4160 queue->idle = GNUNET_NO; 4164 //queue->idle = GNUNET_NO;
4161 GNUNET_log ( 4165 GNUNET_log (
4162 GNUNET_ERROR_TYPE_DEBUG, 4166 GNUNET_ERROR_TYPE_DEBUG,
4163 "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n", 4167 "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n",
@@ -4834,16 +4838,22 @@ check_vl_transmission (struct VirtualLink *vl)
4834 } 4838 }
4835 if (GNUNET_NO == elig) 4839 if (GNUNET_NO == elig)
4836 return; 4840 return;
4837 4841 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4842 "Not stalled. Scheduling transmission on queue\n");
4838 /* Notify queues at direct neighbours that we are interested */ 4843 /* Notify queues at direct neighbours that we are interested */
4839 now = GNUNET_TIME_absolute_get (); 4844 now = GNUNET_TIME_absolute_get ();
4840 if (NULL != n) 4845 if (NULL != n)
4841 { 4846 {
4842 for (struct Queue *queue = n->queue_head; NULL != queue; 4847 for (struct Queue *queue = n->queue_head; NULL != queue;
4843 queue = queue->next_neighbour) 4848 queue = queue->next_neighbour)
4849 {
4844 if ((GNUNET_YES == queue->idle) && 4850 if ((GNUNET_YES == queue->idle) &&
4845 (queue->validated_until.abs_value_us > now.abs_value_us)) 4851 (queue->validated_until.abs_value_us > now.abs_value_us))
4846 schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); 4852 schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT);
4853 else
4854 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4855 "Queue busy or invalid\n");
4856 }
4847 } 4857 }
4848 /* Notify queues via DV that we are interested */ 4858 /* Notify queues via DV that we are interested */
4849 if (NULL != dv) 4859 if (NULL != dv)
@@ -5233,7 +5243,8 @@ handle_raw_message (void *cls, const struct GNUNET_MessageHeader *mh)
5233 we pass this on, CORE would be confused (link down, messages 5243 we pass this on, CORE would be confused (link down, messages
5234 arrive). We should investigate more if this happens often, 5244 arrive). We should investigate more if this happens often,
5235 or in a persistent manner, and possibly do "something" about 5245 or in a persistent manner, and possibly do "something" about
5236 it. Thus logging as error for now. */GNUNET_break_op (0); 5246 it. Thus logging as error for now. */
5247 GNUNET_break_op (0);
5237 GNUNET_STATISTICS_update (GST_stats, 5248 GNUNET_STATISTICS_update (GST_stats,
5238 "# CORE messages droped (virtual link still down)", 5249 "# CORE messages droped (virtual link still down)",
5239 1, 5250 1,
@@ -8049,6 +8060,7 @@ handle_validation_response (
8049 vl->target = n->pid; 8060 vl->target = n->pid;
8050 vl->n = n; 8061 vl->n = n;
8051 n->vl = vl; 8062 n->vl = vl;
8063 q->idle = GNUNET_YES;
8052 vl->core_recv_window = RECV_WINDOW_SIZE; 8064 vl->core_recv_window = RECV_WINDOW_SIZE;
8053 vl->available_fc_window_size = DEFAULT_WINDOW_SIZE; 8065 vl->available_fc_window_size = DEFAULT_WINDOW_SIZE;
8054 vl->incoming_fc_window_size = DEFAULT_WINDOW_SIZE; 8066 vl->incoming_fc_window_size = DEFAULT_WINDOW_SIZE;
@@ -8107,11 +8119,15 @@ handle_flow_control (void *cls, const struct TransportFlowControlMessage *fc)
8107 uint64_t os; 8119 uint64_t os;
8108 uint64_t wnd; 8120 uint64_t wnd;
8109 8121
8122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8123 "Received FC from %s\n", GNUNET_i2s (&cmc->im.sender));
8110 vl = lookup_virtual_link (&cmc->im.sender); 8124 vl = lookup_virtual_link (&cmc->im.sender);
8111 if (NULL == vl) 8125 if (NULL == vl)
8112 { 8126 {
8127 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8128 "FC dropped: VL unknown\n");
8113 GNUNET_STATISTICS_update (GST_stats, 8129 GNUNET_STATISTICS_update (GST_stats,
8114 "# FC dropped: virtual link unknown", 8130 "# FC dropped: Virtual link unknown",
8115 1, 8131 1,
8116 GNUNET_NO); 8132 GNUNET_NO);
8117 finish_cmc_handling (cmc); 8133 finish_cmc_handling (cmc);
@@ -8120,6 +8136,8 @@ handle_flow_control (void *cls, const struct TransportFlowControlMessage *fc)
8120 st = GNUNET_TIME_absolute_ntoh (fc->sender_time); 8136 st = GNUNET_TIME_absolute_ntoh (fc->sender_time);
8121 if (st.abs_value_us < vl->last_fc_timestamp.abs_value_us) 8137 if (st.abs_value_us < vl->last_fc_timestamp.abs_value_us)
8122 { 8138 {
8139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8140 "FC dropped: Message out of order\n");
8123 /* out of order, drop */ 8141 /* out of order, drop */
8124 GNUNET_STATISTICS_update (GST_stats, 8142 GNUNET_STATISTICS_update (GST_stats,
8125 "# FC dropped: message out of order", 8143 "# FC dropped: message out of order",
@@ -8152,8 +8170,10 @@ handle_flow_control (void *cls, const struct TransportFlowControlMessage *fc)
8152 (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX) 8170 (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX)
8153 % FC_NO_CHANGE_REPLY_PROBABILITY)) 8171 % FC_NO_CHANGE_REPLY_PROBABILITY))
8154 { 8172 {
8155 /* Consider re-sending our FC message, as clearly the 8173 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
8156 other peer's idea of the window is not up-to-date */ 8174 "Consider re-sending our FC message, as clearly the ther peer's idea of the window is not up-to-date (%llu vs %llu)\n",
8175 (unsigned long long) wnd,
8176 (unsigned long long) vl->incoming_fc_window_size);
8157 consider_sending_fc (vl); 8177 consider_sending_fc (vl);
8158 } 8178 }
8159 if ((wnd == vl->incoming_fc_window_size) && 8179 if ((wnd == vl->incoming_fc_window_size) &&
@@ -8878,7 +8898,8 @@ transmit_on_queue (void *cls)
8878 via DV (and thus the ultimate target of the pending message is for 8898 via DV (and thus the ultimate target of the pending message is for
8879 a different virtual link than the one of the queue), then we need 8899 a different virtual link than the one of the queue), then we need
8880 to use up not only the window of the direct link but also the 8900 to use up not only the window of the direct link but also the
8881 flow control window for the DV link! */pm->vl->outbound_fc_window_size_used += pm->bytes_msg; 8901 flow control window for the DV link! */
8902 pm->vl->outbound_fc_window_size_used += pm->bytes_msg;
8882 8903
8883 if (pm->vl != queue->neighbour->vl) 8904 if (pm->vl != queue->neighbour->vl)
8884 { 8905 {
@@ -9048,7 +9069,10 @@ handle_send_message_ack (void *cls,
9048 for (struct Queue *queue = tc->details.communicator.queue_head; 9069 for (struct Queue *queue = tc->details.communicator.queue_head;
9049 NULL != queue; 9070 NULL != queue;
9050 queue = queue->next_client) 9071 queue = queue->next_client)
9072 {
9073 queue->idle = GNUNET_YES;
9051 schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); 9074 schedule_transmit_on_queue (queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT);
9075 }
9052 } 9076 }
9053 else if (QUEUE_LENGTH_LIMIT - 1 == qe->queue->queue_length) 9077 else if (QUEUE_LENGTH_LIMIT - 1 == qe->queue->queue_length)
9054 { 9078 {
@@ -9057,6 +9081,7 @@ handle_send_message_ack (void *cls,
9057 "# Transmission throttled due to queue queue limit", 9081 "# Transmission throttled due to queue queue limit",
9058 -1, 9082 -1,
9059 GNUNET_NO); 9083 GNUNET_NO);
9084 qe->queue->idle = GNUNET_YES;
9060 schedule_transmit_on_queue (qe->queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT); 9085 schedule_transmit_on_queue (qe->queue, GNUNET_SCHEDULER_PRIORITY_DEFAULT);
9061 } 9086 }
9062 9087
@@ -9261,6 +9286,9 @@ validation_start_cb (void *cls)
9261 (NULL != vs) && 9286 (NULL != vs) &&
9262 (0 == GNUNET_TIME_absolute_get_remaining (vs->valid_until).rel_value_us)) 9287 (0 == GNUNET_TIME_absolute_get_remaining (vs->valid_until).rel_value_us))
9263 { 9288 {
9289 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9290 "Validation response %s cleaned up\n",
9291 GNUNET_sh2s (&vs->challenge.value));
9264 free_validation_state (vs); 9292 free_validation_state (vs);
9265 vs = GNUNET_CONTAINER_heap_peek (validation_heap); 9293 vs = GNUNET_CONTAINER_heap_peek (validation_heap);
9266 } 9294 }
diff --git a/src/transport/test_transport_api2_tcp_peer1.conf b/src/transport/test_transport_api2_tcp_peer1.conf
index 36e00c00f..417a855ad 100644
--- a/src/transport/test_transport_api2_tcp_peer1.conf
+++ b/src/transport/test_transport_api2_tcp_peer1.conf
@@ -5,7 +5,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p1/
5[transport] 5[transport]
6BINARY = gnunet-service-tng 6BINARY = gnunet-service-tng
7PLUGINS = tcp 7PLUGINS = tcp
8PREFIX = valgrind --log-file=/tmp/vg_peer1-%p 8#PREFIX = valgrind --log-file=/tmp/vg_peer1-%p
9 9
10[communicator-tcp] 10[communicator-tcp]
11BINARY = gnunet-communicator-tcp 11BINARY = gnunet-communicator-tcp
diff --git a/src/transport/test_transport_api2_tcp_peer2.conf b/src/transport/test_transport_api2_tcp_peer2.conf
index f4de8df8b..949bd95f3 100644
--- a/src/transport/test_transport_api2_tcp_peer2.conf
+++ b/src/transport/test_transport_api2_tcp_peer2.conf
@@ -4,7 +4,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/
4 4
5[transport] 5[transport]
6BINARY = gnunet-service-tng 6BINARY = gnunet-service-tng
7PREFIX = valgrind --log-file=/tmp/vg_peer2-%p 7#PREFIX = valgrind --log-file=/tmp/vg_peer2-%p
8 8
9[communicator-tcp] 9[communicator-tcp]
10BINARY = gnunet-communicator-tcp 10BINARY = gnunet-communicator-tcp