Sequence number in RTP packet is a 16 bit field. It starts with a random value. Lets say I keep sending RTP packet, at some point of time it will reach max value 0xFFFF. Then I need to set the sequence number to smaller value. That time, should I set the sequence number to 1 or again I need to set random value.
Asked
Active
Viewed 1,730 times
1 Answers
4
Take a look at RFC 3550 here: https://www.rfc-editor.org/rfc/rfc3550
Basically, it wraps around from 0xFFFF to 0x0000.
-
Yes, I have gone through RFC3550. However I could not locate where it is mentioned the sequence number starts from 0 once it reaches max value 0xFFFF. Can you please let me know section that contains this information. – Austin Mar 07 '18 at 07:13
-
Take a look at the code in Appendix A. All sender and receiver algorithms account for the 16-bit value to wrap around. – It'sPete Mar 07 '18 at 08:15
-
Also, this is a concept that was stolen/borrowed from TCP, where the same thing happens: https://superuser.com/questions/966212/does-the-sequence-number-of-tcp-packet-headers-wrap-around – It'sPete Mar 07 '18 at 08:19