Closed CraigBuilds closed 10 months ago
I am consistently getting a correct output with your program:
Creating DomainParticipant
Creating subscriber
Creating publisher
Starting Publisher thread
Starting Subscriber thread
Publishing: 0
Publishing: 1
Publishing: 2
Received: 0
Received: 1
Received: 2
Publishing: 3
Received: 3
Publishing: 4
Received: 4
Have you tried to analyse the RTPS traffic with Wireshark? There should be an ACKNACK submessage requesting for the missing samples:
Frame 1974: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface lo, id 1
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 172.23.17.124, Dst: 172.23.17.124
User Datagram Protocol, Src Port: 34433, Dst Port: 7411
Real-Time Publish-Subscribe Wire Protocol
Magic: RTPS
Protocol version: 2.4
vendorId: 01.18 (Unknown)
guidPrefix: 01120f1a28a4ce91d5d70bfc
Default port mapping: domainId=0, participantIdx=0, nature=UNICAST_USERTRAFFIC
submessageId: INFO_DST (0x0e)
submessageId: ACKNACK (0x06)
Flags: 0x03, Final flag, Endianness bit
octetsToNextHeader: 28
readerEntityId: 0x00000004 (Application-defined reader (no key): 0x000000)
writerEntityId: 0x00000103 (Application-defined writer (no key): 0x000001)
readerSNState
bitmapBase: 1
numBits: 2
[Acknack Analysis: Lost samples 1, 2 in range [1,2]]
bitmap: 11
Count: 0
Hi,
I've got the same problem, and was able to reproduce it using the minimal reproducible example given by @CraigPersonal100 .
Creating DomainParticipant
Creating subscriber
Creating publisher
Starting Publisher thread
Starting Subscriber thread
Publishing: 0
Publishing: 1
Publishing: 2
Received: 2
Publishing: 3
Received: 3
Publishing: 4
Received: 4
Publishing: 5
Received: 5
Publishing: 6
Received: 6
In the packet capture, we cannot see the ACKNACK message.
Tested with following Cargo.toml
[package]
name = "rdds-301"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rustdds = "0.8.5"
serde = "1.0.190"
Note that the problem seems solved in latest RustDDS version "0.8.5" ( d38a1bce77f009d6c61ad63923e1b58f0d9bb002 ):
Creating DomainParticipant
Creating subscriber
Creating publisher
Starting Publisher thread
Starting Subscriber thread
Publishing: 0
Publishing: 1
Publishing: 2
Publishing: 3
Received: 0
Received: 1
Received: 2
Received: 3
Publishing: 4
Received: 4
Publishing: 5
Received: 5
With following packet capture. rdds-301-master.zip
We don't see the ACKNACK message either, but we receive the samples !
So to clarify, the release 0.8.5 does not work, but up-to-date master does? In that case we suspect that the commits https://github.com/jhelovuo/RustDDS/commit/9f6f2883fc835fdf63180f37125ef35420e9a275 and https://github.com/jhelovuo/RustDDS/commit/737bb695e4a981f966854f617e29f6b9026a9779 might fix it, since they rework how missing data is sent.
As the ACKNACK messages are in this case unicast from the participant to itself, to see them you probably have to enable loopback capture, and if you are using WSL, install and run Wireshark in WSL:
Yes, I ran @CraigPersonal100's example on latest commit on master, and it works.
Thanks for the loopback tips, here are the reproduced packet capture on 0.8.4 and master, with loopback activated, if one want to investigate further.
I finally noticed that the problem described in this issue is not exactly the same I've got on my project. I might open an issue later (more related to https://github.com/jhelovuo/RustDDS/issues/255 ) if I come up with a reproducible example before finding out that my shitty code is the cause.
EDIT: Created issue #302
Here is my program:
This outputs:
Here you can see that it misses the first two samples, even though I am using transient local durability (so it should receive samples published in the past), history (so it should store samples), and reliability (so it should use tcp like reliability and not miss samples).
What am I doing wrong?