Fragmentation with SHMEM transportation

7 posts / 0 new
Last post
Offline
Last seen: 3 years 10 months ago
Joined: 03/19/2020
Posts: 5
Fragmentation with SHMEM transportation

Hi all, 

I have read RTI article about DDS fragmentation and IP fragmentation (link here: https://rtidds.wordpress.com/2017/07/27/who-is-chopping-my-application-data-and-why-should-i-care/). 

First of all, thanks for the article and all explanation! It is very helpful.

Secondly, in SHMEM, the allowed maximum size of sample is also determined by message_size_max and the default value is 65536. My questions are:

  1. If the size of sample exceed message_size_max, is it also fragmented?
  2. If yes, is RTPS header added in front of the fragment?
  3. If RTPS header is not added in SHMEM case, how can sample be re-assembled in DataReader side?

Thanks in advance for spending time with my questions. 

Offline
Last seen: 1 year 2 months ago
Joined: 10/22/2018
Posts: 91

Hey Dung Chao,

Data sent over the SHMEM transport can be fragmented in the same way that data sent over any other (e.g. UDPv4) transport is. So yes, if the serialised size of your sample exceeds the configured message_size_max, it will be fragmented. It is important to note that the message_size_max property is configured per transport, so if you need to modify its value, you'll have to do it specifically for SHMEM.

The short answer to questions 2 and 3 is yes, an RTPS header is attached to the fragment. Fragmented data is sent using DATA_FRAG(_X) RTPS messages.

Sam

Francisco Porcel's picture
Offline
Last seen: 3 weeks 2 days ago
Joined: 11/07/2016
Posts: 24

Hi Dung,

Thank you for your feedback on the article! We appreciate it. Let me answer your questions.

  1. In SHMEM, if the size of the sample exceeds message_size_max, it is fragmented. The process is the same as explained in the article for UDP. Now, imagine that you increase the default value for SHMEM but you still use UDP (UDP | SHMEM mask). In that case, the minimum is chosen and both UDP and SHMEM will be fragmented to 64 KB.
  2. RTI Connext DDS will include the RTPS header in the fragment (before reaching the message_size_max limit). Imagine that the size of your sample is 65536 bytes (without taking the RTPS header into account). Then, you would actually have 2 fragments, a big fragment of almost 64 KB and a small fragment, both with RTPS headers.
  3. The RTPS header is also included in the SHMEM case. This is how the sample can be re-assembled in the DataReader side.

--Fran

sara's picture
Offline
Last seen: 1 year 4 months ago
Joined: 01/16/2013
Posts: 128

Hi Dung,

Just to complete the info that Sam and Fran shared, if you are sending larger data, you may as well use Zero Copy features to avoid serialization/deserialization when sharing data in the same device and just pass around a reference to the data.

All the best
Sara

Offline
Last seen: 3 years 10 months ago
Joined: 03/19/2020
Posts: 5

Thanks a lot for your answer, Sam! 

Offline
Last seen: 3 years 10 months ago
Joined: 03/19/2020
Posts: 5

Thanks Fran!

As I understand from your answer, you mean that if I have, for example, 64kB for UDP message_size_max and 100 kB for SHMEM, and my application communicates both in UDP and SHMEM, it automatically chooses 64 kB for both of them even though I set 100 kB for SHMEM?


Also, if I increase the the message_size_max to avoid fragmentation, I assume that it takes more memory to ensure there is enough space for my sample, right? 

Offline
Last seen: 3 years 10 months ago
Joined: 03/19/2020
Posts: 5

Thanks Sara for your extra information!