Change ACKNACK policy to be less aggressive

Overly aggressive sending of ACKNACKs eats bandwidth and causes
unnecessary retransmits and lowers performance; but overly timid sending
of them also reduces performance.  This commit reduces the
aggressiveness.

* It keeps more careful track of what ACKNACK (or NACKFRAG) was last
  sent and when, suppressing ACKs that don't provide new information for
  a few milliseconds and suppressing NACKs for the NackDelay
  setting.  (The setting was there all long, but it didn't honor it when
  the writer asked for a response.)

* It ignores the NackDelay when all that was requested has arrived, or
  when it receives a directed heartbeat from a Cyclone peer.  The latter
  is taken as an indication that no more is following, and allows the
  recipient to ask far arbitrary amounts of data and rely on the sender
  to limit the retransmit to what seems reasonable.  (For NACKFRAG one
  can do it in the recipient, but for ACKNACK one cannot, and so one
  might as well do it at the sender always.)

* Sufficient state is maintained in the match object for the ACKNACK
  generator to decide whether or not to send an ACKNACK following the
  rules, and it may decide to send just an ACK even though there is data
  missing, or nothing at all.

* If HEARTBEAT processing requires an immediate response, the response
  message is generated by the receive thread, but still queued for
  transmission.  If a delayed response is required, it schedules the
  ACKNACK event.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-06-22 18:00:49 +02:00 committed by eboasson
parent 0a4c863f11
commit 63b1a7179b
19 changed files with 835 additions and 421 deletions

View file

@ -472,6 +472,7 @@ CycloneDDS configuration</xs:documentation>
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" ref="config:AccelerateRexmitBlockSize"/>
<xs:element minOccurs="0" ref="config:AckDelay"/>
<xs:element minOccurs="0" ref="config:AssumeMulticastCapable"/>
<xs:element minOccurs="0" ref="config:AutoReschedNackDelay"/>
<xs:element minOccurs="0" ref="config:BuiltinEndpointSet"/>
@ -527,6 +528,14 @@ CycloneDDS configuration</xs:documentation>
&lt;p&gt;The default value is: "0".&lt;/p&gt;</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AckDelay" type="config:duration">
<xs:annotation>
<xs:documentation>
&lt;p&gt;This setting controls the delay between sending identical acknowledgements.&lt;/p&gt;
&lt;p&gt;The unit must be specified explicitly. Recognised units: ns, us, ms, s, min, hr, day.&lt;/p&gt;
&lt;p&gt;The default value is: "10 ms".&lt;/p&gt;</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AssumeMulticastCapable" type="xs:string">
<xs:annotation>
<xs:documentation>
@ -820,7 +829,7 @@ CycloneDDS configuration</xs:documentation>
<xs:documentation>
&lt;p&gt;This setting controls the delay between receipt of a HEARTBEAT indicating missing samples and a NACK (ignored when the HEARTBEAT requires an answer). However, no NACK is sent if a NACK had been scheduled already for a response earlier than the delay requests: then that NACK will incorporate the latest information.&lt;/p&gt;
&lt;p&gt;The unit must be specified explicitly. Recognised units: ns, us, ms, s, min, hr, day.&lt;/p&gt;
&lt;p&gt;The default value is: "10 ms".&lt;/p&gt;</xs:documentation>
&lt;p&gt;The default value is: "100 ms".&lt;/p&gt;</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PreEmptiveAckDelay" type="config:duration">
@ -1010,7 +1019,7 @@ CycloneDDS configuration</xs:documentation>
<xs:documentation>
&lt;p&gt;This element sets the maximum allowed high-water mark for the Cyclone DDS WHCs, expressed in bytes. A writer is suspended when the WHC reaches this size.&lt;/p&gt;
&lt;p&gt;The unit must be specified explicitly. Recognised units: B (bytes), kB &amp; KiB (2&lt;sup&gt;10&lt;/sup&gt; bytes), MB &amp; MiB (2&lt;sup&gt;20&lt;/sup&gt; bytes), GB &amp; GiB (2&lt;sup&gt;30&lt;/sup&gt; bytes).&lt;/p&gt;
&lt;p&gt;The default value is: "100 kB".&lt;/p&gt;</xs:documentation>
&lt;p&gt;The default value is: "500 kB".&lt;/p&gt;</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="WhcHighInit" type="config:memsize">