[Live-devel] Achieving wraparound detection for 8-bit RTP sequence number

Josephine Kakande jnkakande at gmail.com
Tue Oct 27 01:35:29 PDT 2009


Hello,

I'm trying to investigate streaming performance when an 8-bit RTP sequence
number is used.

After sequence number 255 is first reached, the sequence number does wrap
round to zero as expected, but all packets thereafter are incorrectly
detected as lost.

These are some of the modifications I made in RTPSource.cpp:

void RTPReceptionStats
::noteIncomingPacket(u_int8_t seqNum, ....) {

......

  // Check whether the new sequence number is the highest yet seen:
  unsigned oldSeqNum = (fHighestExtSeqNumReceived&0xFF);
 if (seqNumLT((u_int8_t)oldSeqNum, seqNum)) {
    // This packet was not an old packet received out of order, so check it:
    unsigned seqNumCycle = (fHighestExtSeqNumReceived&0xFF00);
    unsigned seqNumDifference = (unsigned)((int)seqNum-(int)oldSeqNum);
    if (seqNumDifference >= 0x80) {
      // The sequence number wrapped around, so start a new cycle:
      seqNumCycle += 0x100;

.........

}

but I still get this sort of QoS statistics:

Started playing session
Receiving streamed data (for up to 60.000000 seconds)...
begin_QOS_statistics
server_availability    100
stream_availability    100
subsession    video/MPV
num_packets_received    22470
*num_packets_lost    4294944950*
elapsed_measurement_time    60.004700
kBytes_received_total    22560.912000
measurement_sampling_interval_ms    1000
kbits_per_second_min    2757.835416
kbits_per_second_ave    3007.885982
kbits_per_second_max    3166.214214
*packet_loss_percentage_min    -109.677419*
packet_loss_percentage_ave    0.000000
packet_loss_percentage_max    0.000000
inter_packet_gap_ms_min    0.004000
inter_packet_gap_ms_ave    2.668810
inter_packet_gap_ms_max    78.687000
subsession    audio/MPA
num_packets_received    1241
*num_packets_lost    4294966235*
elapsed_measurement_time    60.004700
kBytes_received_total    1434.596000
measurement_sampling_interval_ms    1000
kbits_per_second_min    101.252014
kbits_per_second_ave    191.264484
kbits_per_second_max    204.068205
*packet_loss_percentage_min    -566.666667*
packet_loss_percentage_ave    0.000000
packet_loss_percentage_max    0.000000
inter_packet_gap_ms_min    0.013000
inter_packet_gap_ms_ave    48.322089
inter_packet_gap_ms_max    685.016000
end_QOS_statistics


How can I achieve wraparound at sequence number 255 without mis-detection
thereafter as lost packets?

Thanks,
Josephine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091027/5d5f682b/attachment.html>


More information about the live-devel mailing list