SOME/IP
The SOME/IP TP header
Every segment of a segmented message carries the normal 16-byte SOME/IP header plus the 4-byte SOME/IP TP header: the Offset where the segment starts in the original payload, counted in units of 16 bytes, and the More Segments flag, which says whether more segments follow.
Twenty bytes in front of each segment
A segment repeats the SOME/IP header of the original message with two changes, the Length and the TP flag in the Message Type, and adds the SOME/IP TP header right after it.
Offset
Units of 16 bytes
The 32-bit word holds the byte offset with its lowest 4 bits used for flags, so offsets are always multiples of 16. Offset value 87 means byte 87 × 16 = 1392 of the original payload.
size
At most 1392 bytes
A UDP SOME/IP payload is limited to 1400 bytes; minus the 4-byte SOME/IP TP header that leaves 1396, and the largest multiple of 16 below is 1392. Every segment except the last is a multiple of 16; all those segments are equally long.
same values
One Session ID
Session handling is on for segmented messages, and all segments of one original message carry its Session ID, Message ID, versions and Return Code. The receiver uses them to know which segments belong together.
The example of the specification
An original message with 5880 bytes of payload, segmented into segments of at most 1392 bytes:
The example in the R20-11 SOME/IP TP module specification uses the same five offsets but quotes the payload as 5571 and later 5771 bytes; with 4 × 1392 + 312 the total is 5880, as in the protocol specification.
What the AUTOSAR module checks
The SOME/IP TP module of the Classic Platform is deliberately simple: it does not put segments back in order and does not ask for repeats. On reception it stops the current reassembly when a segment's Offset does not match the bytes received so far, when the header values differ from the first segment, when a segment with the More Segments flag 1 is not a multiple of 16 bytes, or when its receive timeout runs out. A segment with an Offset greater than 0 and no reassembly running is ignored. The upper layer (PduR) is told about the first segment with an unknown total length and gets the rest segment by segment.
Try it
Pick a payload size and a largest segment size. Click a row to see that segment's 20 header bytes. Then choose what the network does with the segments.
| # | Byte offset | Offset | More Segments | Segment | Length | SOME/IP TP header |
|---|
Things to notice. With "500" the sender cannot use 500: segments must be multiples of 16, so it uses 496. The SOME/IP TP header of segment 2 of the example is 00 00 05 71: 0x570 = 1392 bytes, plus the More Segments flag. Swapping two segments is enough to make the AUTOSAR receiver give up, although every byte arrived.
Check yourself optional
Source: SOME/IP Protocol Specification, R20-11, section 4.2.1.4; SOME/IP Transport Protocol, R20-11, chapters 4 and 7.