Ticket #865 (closed enhancement: fixed)

Opened 10 years ago

Last modified 9 months ago

More clever RTP transport remote address switch

Reported by: bennylp Owned by: nanang
Priority: major Milestone: release-2.8
Component: pjmedia Version: trunk
Keywords: sipit24 Cc: joost, joel
Backport to 1.x milestone: Backported: no

Description (last modified by ming) (diff)

Currently the UDP and ICE media transport has the capability to switch destination RTP/RTCP address to the source address of the RTP/RTCP packets, if they are different than the original address set in SDP received from remote.

It may be better to put this functionality in the stream instead, for the following reason:

  1. the stream has more information about the packet, such as RTP pt, SSRC, and info from RTCP statistic
  2. some application that uses media transport wants to inspect and possibly filter the source address
  3. some firewall such as Microsoft Forefront Threat Management Gateway wants us to send the RTP to the address in SDP, regardless of the source address of the RTP packet

Change History

comment:1 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 10 years ago by bennylp

  • Priority changed from normal to major

comment:3 Changed 10 years ago by bennylp

  • Cc joost, joel added

comment:4 Changed 10 years ago by bennylp

  • Keywords sipit24 added
  • Version changed from Sipit24 to trunk
  • Milestone changed from Sipit24 to release-1.3

comment:5 Changed 9 years ago by bennylp

  • Milestone changed from release-1.3 to release-1.4

There is a temptation to support multiple callback users, so that multiple applications (e.g. stream and PJSUA-LIB) can peek the incoming RTP/RTCP packets. Some sample usage of this includes:

  • supporting STUN keep-alive (done by pjsua-lib)
  • packet filtering
  • PoC (by capturing RTCP traffic)

Sure this can be done by creating transport adapter, but utilizing multiple callback users will make it lot easier for application (e.g. application doesn't need to handle transport creation in PJSUA-LIB).

Pending for further review. Moving to 1.4 milestone.

comment:6 Changed 9 years ago by bennylp

  • Milestone changed from release-1.4 to release-1.5

comment:7 Changed 9 years ago by bennylp

  • Milestone changed from release-1.5 to release-1.6

comment:8 Changed 9 years ago by bennylp

  • Milestone changed from release-1.6 to Known-Issues-and-Ideas

comment:9 Changed 7 years ago by bennylp

Enhancement of this behavior in #1366

comment:10 Changed 9 months ago by ming

  • Milestone changed from Known-Issues-and-Ideas to release-2.8
  • Backported unset
  • Description modified (diff)

comment:11 Changed 9 months ago by ming

  • Status changed from new to closed
  • Resolution set to fixed

In 5752:

Fixed #865: More clever RTP transport remote address switch

The summary of changes:

  • To solve no 2:
    Add callback rtp_cb2(pjmedia_tp_cb_param *param) which allows application to get more info from the media transport, such as the packet's source address.
  • To solve no 3:
    Add compile time option PJMEDIA_TRANSPORT_SWITCH_REMOTE_ADDR (by default enabled). Currently, there are already runtime options PJMEDIA_UDP_NO_SRC_ADDR_CHECKING and PJMEDIA_ICE_NO_SRC_ADDR_CHECKING, but there are a few drawbacks:
    • the options are not exported to the higher level, such as stream, or pjsua.
    • the options are separate for each transport, UDP and ICE, there's no single option to do this.
  • To solve no 1:
    Using the new rtp_cb2() callback, move the functionality to check the packet's source address to the stream/video stream.
    By checking the RTP pt and SSRC, there are a few advantages:
    • When receiving packets from multiple sources, stream can choose the packet with the correct SSRC as advertised from the SDP, and discard the others (see also ticket #1366).
    • If remote address switch is enabled, a faster switch can be achieved as soon as packet with correct ssrc is received, instead of waiting for several consecutive packets (according to setting PJMEDIA_RTP_NAT_PROBATION_CNT).
Last edited 9 months ago by ming (previous) (diff)
Note: See TracTickets for help on using tickets.