SOME/IP
SOME/IP TP: segmentation
Over UDP a SOME/IP message must fit into one datagram. SOME/IP TP cuts a bigger message into parts, each with its own SOME/IP header, and the receiver joins them back together.
Why segments
Over UDP the payload of one SOME/IP message may be at most 1400 bytes; the rest of the datagram is kept free for headers. A camera object list or a calibration table can be several kilobytes. TCP could carry it, but TCP makes everything wait after a loss (lesson 22). SOME/IP TP keeps UDP and uses segmentation instead: it cuts the message into segments (parts that each travel as a SOME/IP message of their own: SOME/IP header, SOME/IP TP header and a slice of the payload).
sender
As few segments as possible
Segments are as big as allowed, all segments except the last have the same size, they go out in ascending order without overlaps, and a configured separation time keeps them apart so the receiver is not flooded.
receiver
Reassemble or give up
The receiver checks that each segment carries the same SOME/IP header and that its Offset (where the segment starts in the original payload) is exactly where the last one ended. A timeout watches the gap between segments. Only a completely reassembled message is passed up, with the TP flag (the bit in the Message Type that marks a segment) cleared.
SOME/IP header
Same Session ID for all segments
All segments of one message carry the same Session ID, so messages that use segmentation must have session handling switched on. A segment with a new Session ID starts a new message.
Stricter in AUTOSAR
The protocol specification lets a receiver reassemble segments that arrive in reverse order and repair overlapping or repeated segments. The AUTOSAR SOME/IP TP module deliberately does less, to save time and memory on the receiver: it does not reorder segments and does not retry. A missing or out-of-place segment, a segment with a different SOME/IP header, or a gap longer than the timeout allows cancels the whole message. The typical use, "streaming" of large data, simply waits for the next message.
Where the module sits
Towards SoAd every segment is a small PDU of its own; towards COM or LdCom the whole message is one large I-PDU handed over in parts, the way transport protocols normally work. A message that fits into one UDP datagram is passed through unchanged.
Try it
Pick a payload size, then disturb the segments and see what the receiving SOME/IP TP module does.
| Arrives | Offset (bytes) | More Segments | Receiver |
|---|
Things to notice. 1000 bytes needs no segmentation at all. A lost segment and a swapped pair end the same way: the next segment's Offset is not where the receiver expects, so the message is dropped. When the last segment never comes, it is the timeout that ends the wait.
Check yourself optional
New terms in this lesson
| Term | Meaning |
|---|---|
| segment | One part of a segmented message: SOME/IP header, SOME/IP TP header and a slice of the payload |
| SOME/IP TP header | The 4 bytes SOME/IP TP adds after the SOME/IP header of each segment: Offset and More Segments flag |
| Offset | Where this segment starts in the original payload (in the header: in units of 16 bytes) |
| More Segments flag | 1 if more segments follow, 0 in the last segment |
| TP flag | Bit 0x20 in the Message Type: this message is a segment (TP_REQUEST, TP_NOTIFICATION, …) |
Source: SOME/IP Protocol Specification, R20-11, sections 4.1.2.10 and 4.2.1.4; SOME/IP Transport Protocol, R20-11, chapters 4, 5 and 7.