-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected latency behaviour #78
Comments
At first glance you're using I'd suggest refactoring to make sure to have spin active all the time by putting it in a dedicated thread. Or even simpler would be to setup a timer to trigger your publish events and then you can just call spin in the main thread. |
Hello, thanks for your replay. This makes sense and was very helpful. Now the latencies are constant over the frequency. This is totally what we expected. But there is a new observation: During the transmission data losses occur over a longer time. This leak time increases with the frequency and occurs only with WLAN connections. Have you an idea why this happens? ObeservationsD-Link DIR-645 (LAN)TP-Link M7350 (5 GHz WLAN)TP-Link M7350 (2G4 Hz WLAN)SetupNow I seperate the sender and receiver tasks in two classes. The sender has an own thread for his work, while the receiver only bind the callback function to the topic. The
The QoS-profile is again |
When using best-effort I would expect messages to be lost when being sent over a wireless connection. If packet collision happens the message will not be resend and therefore never be received. If you switch to reliable that should not happen. |
Yes this is clear. But what I don't see why this happens in that way. The network has totally only this two "members" and only this data exchange. Over a longer period with some hundred messaged all goes perfectly. And then comes a short period of collisions? Why, all of a sudden, collisions? Maybe there is something black magic from the router? To solve this by setting the profile to be reliable truly is a way. But on our 400 Hz measurement this will lead to hold maybe up to 80 messages. Is it right to say this will additionally increase the data traffic? If it is so I think maybe it is a good thing to think about the reasons for this. Because the bandwidth is limited and we go to have up to 10 IOMs in a further development step. |
You might want to run wireshark on that interface and look at the exchanged packets. A lot of stuff is going on in a (wireless) network even if it is "idle" from the user point of view. |
Yeah - I think we should examine this. Sad, that the small modern mobile routers don't support a good QoS-set-up to avoid disturbing parallel communications. (DIR-645 <> DIR510L / TP-Link M7350) On a DIR-645 it's possible to set up priorities and it seems to lead to better results. |
@Alex031544 I'm going to close this due to the low activity for a while. If you want to share the results of your investigation, please feel free to comment here and we can reopen this if needed |
Objectives
We make some investigations to find out the dependencies of transport latencies between different nodes. Therefore we made an set up with one sender-receiver-computer (IOM) and one repeater-computer (CPM). The IOM publishes defined data-packages on a constant frequency
f
with the sending timestampt1
to the network. The CPM subscribes this, takes the receiving timet2
, copies the data and publishes the data on timet3
. The IOM subscribes att4
and logs the data.Afterwards the transport times between the sender-receiver-computer and the repeater-computer and vice versa shall be calculated. We assume them to be equal (
Dt = t2-t1 = t4-t3
) and use the formulawhich means, that the clocks of both computers don't have to be synchronized.
Problem
We assume the transport time
Dt
to be independent from the sending frequencyf
, as long as the network is not overloaded. But our results show an linear increasing transport timeDt
on linear decreasing frequenciesf
(as you can see in the following section). In the same time, our timestampst1
andt2
show that the sending frequency seems to be correct.Results
Below you will see the results of our investigation. Information to our set up you will find in the next section. We do some tests with LAN and WLAN. In both cases there are some strange behaviours. Regarding the latency-issue it's on both the same. The ordinate axis is limited to 20 ms for a better readability. Latencies bigger than 20 ms are counted as packages out of bounds. So lets take a look to the WLAN test results:
Configuration with a D-Link DIR 510L (5G Hz WLAN)
Configuration with a D-Link DIR 510L (2G4 Hz WLAN)
Configuration with a TP-Link M7350 (5G Hz WLAN)
Configuration with a TP-Link M7350 (2G4 Hz WLAN)
For us the results are not as expected. Can you help us to find out the reason for it? Is there something like a fixed buffer or something else we don't see at the moment???
Set up
The computers are Raspberry Pi 2 with Raspbian installed on. We did our investigation with openSplice and FastRTPS. But there are no significant differences related to this behaviour. The ROS2 build is alpha7.
Below you will find the code for this two nodes:
sender-receiver-computer (IOM)
epeater-computer (CPM)
Feel free to ask for further information.
Kind regards,
Alex
The text was updated successfully, but these errors were encountered: