diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-31 17:54:48 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-31 17:54:48 +0100 |
commit | 448a5370373e9dcef449c53aee6c078c7d3395d9 (patch) | |
tree | af1507380c0173773aa5e9e4722b2088a42bfd20 /src/cadet/gnunet-service-cadet-new_channel.c | |
parent | 24dc41dd58c67b53829888c21bbcaffc7cab5a05 (diff) | |
download | gnunet-448a5370373e9dcef449c53aee6c078c7d3395d9.tar.gz gnunet-448a5370373e9dcef449c53aee6c078c7d3395d9.zip |
use observed RTT as starting point for retransmissions
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index 00866b3d5..da9eb3c75 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -25,8 +25,6 @@ | |||
25 | * | 25 | * |
26 | * TODO: | 26 | * TODO: |
27 | * - Congestion/flow control: | 27 | * - Congestion/flow control: |
28 | * + calculate current RTT if possible, use that for initial retransmissions | ||
29 | * (NOTE: needs us to learn which connection the tunnel uses for the message!) | ||
30 | * + estimate max bandwidth using bursts and use to for CONGESTION CONTROL! | 28 | * + estimate max bandwidth using bursts and use to for CONGESTION CONTROL! |
31 | * (and figure out how/where to use this!) | 29 | * (and figure out how/where to use this!) |
32 | * + figure out flow control without ACKs (unreliable traffic!) | 30 | * + figure out flow control without ACKs (unreliable traffic!) |
@@ -307,11 +305,6 @@ struct CadetChannel | |||
307 | struct GNUNET_TIME_Relative retry_time; | 305 | struct GNUNET_TIME_Relative retry_time; |
308 | 306 | ||
309 | /** | 307 | /** |
310 | * How long does it usually take to get an ACK. | ||
311 | */ | ||
312 | struct GNUNET_TIME_Relative expected_delay; | ||
313 | |||
314 | /** | ||
315 | * Bitfield of already-received messages past @e mid_recv. | 308 | * Bitfield of already-received messages past @e mid_recv. |
316 | */ | 309 | */ |
317 | uint64_t mid_futures; | 310 | uint64_t mid_futures; |
@@ -1649,10 +1642,17 @@ data_sent_cb (void *cls, | |||
1649 | GCC_ack_expected (cid); | 1642 | GCC_ack_expected (cid); |
1650 | } | 1643 | } |
1651 | } | 1644 | } |
1652 | if (0 == crm->retry_delay.rel_value_us) | 1645 | if ( (0 == crm->retry_delay.rel_value_us) && |
1653 | crm->retry_delay = ch->expected_delay; | 1646 | (NULL != cid) ) |
1654 | else | 1647 | { |
1655 | crm->retry_delay = GNUNET_TIME_STD_BACKOFF (crm->retry_delay); | 1648 | struct CadetConnection *cc = GCC_lookup (cid); |
1649 | |||
1650 | if (NULL != cc) | ||
1651 | crm->retry_delay = GCC_get_metrics (cc)->aged_latency; | ||
1652 | else | ||
1653 | crm->retry_delay = ch->retry_time; | ||
1654 | } | ||
1655 | crm->retry_delay = GNUNET_TIME_STD_BACKOFF (crm->retry_delay); | ||
1656 | crm->retry_delay = GNUNET_TIME_relative_max (crm->retry_delay, | 1656 | crm->retry_delay = GNUNET_TIME_relative_max (crm->retry_delay, |
1657 | MIN_RTT_DELAY); | 1657 | MIN_RTT_DELAY); |
1658 | crm->next_retry = GNUNET_TIME_relative_to_absolute (crm->retry_delay); | 1658 | crm->next_retry = GNUNET_TIME_relative_to_absolute (crm->retry_delay); |