-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add guide on how to detect retransmits (#48)
* add guide on how to detect retransmits * improve text structure * Update detect-retransmits.md
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
Title: Detect Retransmits | ||
Author: Sven Trittler | ||
Date: 2024-10-18 | ||
Template: plain_markdown | ||
--- | ||
|
||
# Detecting and Optimizing DDS Retransmissions with Wireshark | ||
|
||
## Understanding DDS Retransmissions | ||
|
||
DDS (Data Distribution Service) relies on UDP, meaning messages can be lost due to network conditions or QoS settings. With reliable QoS, lost messages must be retransmitted, which can introduce latency spikes. Retransmissions can only be detected through heartbeats, which are sent either at regular intervals or with every data message. These heartbeats signal which sequence numbers have been successfully received and indicate any missing messages that need to be retransmitted. | ||
|
||
## Detecting Retransmissions in Wireshark | ||
|
||
DDS retransmissions are not explicitly marked in the data stream. However, retransmissions are triggered by a NACK (Negative Acknowledgment). To identify NACKs in Wireshark, you can use the following filter `rtps.bitmap.num_bits > 0`. | ||
This filter allows you to focus on NACKs and, in most cases, is sufficient for detecting retransmits. | ||
|
||
You may also filter by submessage IDs e.g., using `rtps.sm.id == 0x6`: | ||
|
||
- ACKNACK: 0x6 | ||
- NACKFRAG: 0x12 | ||
|
||
### Wireshark Example of a Retransmit | ||
|
||
In the Wireshark screenshot below, you can see an example of a retransmission. | ||
|
||
1. A message with sequence number 7530 is received. | ||
2. Sequence number 7532 is received, but the heartbeat indicates that sequence 7531 was lost. | ||
3. Sequence number 7531 is retransmitted. | ||
4. Sequence number 7533 is received. | ||
|
||
![`wireshark retransmit`](/images/wireshark-retransmit.jpg) | ||
|
||
## Tuning Heartbeat Intervals for Faster Recovery | ||
|
||
The speed at which lost data is detected and retransmitted depends on the heartbeat interval or the frequency of data transmission. By default, the heartbeat interval is set to 100 ms, but for low-rate periodic data, you can reduce this interval for example to 5 ms: | ||
|
||
```xml | ||
<Internal> | ||
<HeartbeatInterval minsched="5ms" min="5ms">5ms</HeartbeatInterval> | ||
</Internal> | ||
``` | ||
|
||
With this adjustment, lost data can be recovered in approximately 5.1 ms (5 ms for the heartbeat, plus ~2x50µs for network processing). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.