Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-9876

Incoming RTP Packet loss calculation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.8
    • Component/s: freeswitch-core
    • Labels:
      None
    • Environment:
      Linux Ubuntu X86 64bit
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • uname:
      Linux ip-172-31-21-65 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
    • Userland:
      GNU/Linux
    • Distribution:
      Debian
    • Distribution Version:
      Debian 8 jessie
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      v1.6
    • GIT Master Revision hash::
      v1.6
    • Target Version:

      Description

      i am currently working on the Freeswitch Code origin/v1.6. During my bridge call testing for the RTCP call stats, i find packet loss calculation on the incoming RTP stream for RTCP is wrong. i cross verify packet loss calculation with the tcpdump captured packets.

      In src/switch_rtp.c file rtcp_stats called at the line number 5677 as shown below.

      src/switch_rtp.c
      5676 if (rtp_session->flags[SWITCH_RTP_FLAG_ENABLE_RTCP]) {
      5677 rtcp_stats(rtp_session);
      5678 }

      But in some packets processing, Function read_rtp_packet is returning from following condition at line number 5531 in file src/switch_rtp.c file. So this kind of packets are calculated as loss for the RTCP, as rtcp_stats() will never call for such packets.

      5526 if (!rtp_session->flags[SWITCH_RTP_FLAG_PROXY_MEDIA] && !rtp_session->flags[SWITCH_RTP_FLAG_UDPTL] && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] &&
      5527 *bytes && rtp_session->last_rtp_hdr.pt != rtp_session->recv_te &&
      5528 ts && !rtp_session->jb && !rtp_session->pause_jb && jb_valid(rtp_session) && ts == rtp_session->last_cng_ts) {
      5529 /* we already sent this frame..... */
      5530 *bytes = 0;
      5531 return SWITCH_STATUS_SUCCESS;
      5532 }

      Due to this issue calculation of packet loss is wrong and inter arrival jitter calculation is also wrong.

      I moved rtcp_stats() call before line 5526 ( above code ) to fix that issue. After this change packet loss in the incoming stream is matching with the tcpdump packet capture RTP stats.

        Attachments

          Activity

            People

            • Assignee:
              mikej Mike Jerris
              Reporter:
              shaileshplivo Shailesh Patel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: