yoursunny / NDNts

NDN libraries for the Modern Web
https://ndnts-docs.ndn.today
ISC License
31 stars 9 forks source link

Interest retransmitted too frequently #22

Closed zjkmxy closed 11 months ago

zjkmxy commented 11 months ago

https://github.com/yoursunny/NDNts/blob/41f4db68260baf4601b81fd52b34e5e3f8c6cbfa/packages/segmented-object/src/fetch/logic.ts#L179-L179

Since req.rto is strictly less than the Interest's lifetime, this line makes retransmission happens very frequently. For example, if I set the lifetimeAfterRto to be 4000 and retxLimit to be 5, and the RTT is 200ms, then when the latest segment is missing, the expected behavior is retrying in 4s after the last timeout. But the actual behavior is sending all 6 Interests in 200*5 = 1s, which does not make sense since all Interests except the first one will be suppressed. Then, your fetcher will report exceedRetxLimit after the first Interest times out. This behavior does not align with my expectation.

yoursunny commented 11 months ago

RTO refers to retransmission timeout. According to RFC2988 section 5 where this design is based upon, when the RTO timer expires, a retransmission should occur.

InterestLifetime signals the network of a deadline after which the network should not return the Data. It does not control when retransmission would occur. The lifetimeAfterRto option is to ensure InterestLifetime is always greater than RTO.

Retransmitting before InterestLifetime expiring allows forwarding strategies to have access to the PIT entry. If instead the consumer retransmits after the InterestLifetime has expired, the PIT entry would have been deleted. This practice is consistent with ndncatchunks fetcher behavior.


The default minimum RTO in NDNts fetcher is 200ms.

The default suppression config in NDN-DPDK is an exponential suppression with maximum of 100ms. It would not suppress Interests from NDNts fetcher. https://github.com/usnistgov/ndn-dpdk/blob/bd1c3cc50db521a9900cbaf9b62c1a1a17cffb18/container/pit/suppress-config.go#L23-L25

The default suppression config in NFD is an exponential suppression with minimum of 10ms and maximum of 250ms, increasing by 2x after each retransmission. The successive timers are 10ms, 20ms, 40ms, 80ms, 160ms, 250ms. It would not suppress first five Interests from NDNts fetcher. https://github.com/named-data/NFD/blob/9b877c3a2379febed9fc00fdfeb62f93fee6df64/daemon/fw/retx-suppression-exponential.hpp#L87-L89

If you feel the retransmission occurs too frequently, you can increase minimum RTO.