3 ms·
"For GSM, number of parts is a required item in the multipart message header.[1] It's field 5 of the UDH. " number != order. As said, sms's are not guaranteed
by DannyBee 11y ago
"For GSM, number of parts is a required item in the multipart message header.[1] It's field 5 of the UDH.
"
number != order.
As said, sms's are not guaranteed to be received in a particular order, nor is the order recoverable (because the clocks are not guaranteed right, etc, so even sorting by time, ...)
- Animats 11y agoRead the spec. The header on each multipart message fragment has the number of fragments, the fragment number (counted from 1, for some reason), and a semi-unique ID generated by the sending phone. You also get the source phone number along with the message. This is sufficient for correct reassembly. The semi-unique ID is normally only one byte, and so old unmatched fragments can match new messages. Android keeps old unmatched fragments in a database for the life of the phone, which is insane. (We drop them after 5 minutes in our system. A more conservative approach would be to wait until a successful message from the same phone, indicating communications have been reestablished, and a few minutes after that, purge old fragments from the same source.)
- DannyBee 11y agoI've read the spec. In fact, i'll go further. I've built multiple election systems that use SMS to send data around :) Every carrier tech i've talked to tells me the same thing - the order of messages is not guaranteed nor is it recoverable. So while it's not that i don't believe you, it's that "in practice, it seems everyone thinks and does otherwise". "This is sufficient for correct reassembly." Except, as you prove later, it isn't when the unique ids can match other messages :)
- Animats 11y agoIf you have your own system which doesn't send UDH headers, and you can't reassemble, it's your problem. SMS messages are not ordered, but then can contain ordering info. The major smartphones all send UDH headers, which have enough data for reassembly. At least if you don't keep old fragments for insanely long periods.