区分在同一端口上复用的 RTP 和 RTCP 数据包

Differentiate between RTP and RTCP packet multiplexed on same port

我正在使用 Tcpdump 在我的网络接口上捕获数据包。在 Wireshark 中,我可以看到 RTPRTCP 交易在同一个端口上进行。我正在使用 Libpcap 编写一个解析器,它将解析并将所有 RTPRTCP 数据包保存在不同的文件中。

问题

如何区分哪个是 RTP 数据包,哪个是 RTCP 数据包?

通常是 RTP 和 RTCP are using a different port. However, Duckduckgoing "RTP and RTCP on the same port" gives me Multiplexing RTP and RTCP on a Single Port, RFC5761. Section 4 讨论如何区分这两种类型的数据包:

When RTP and RTCP packets are multiplexed onto a single port, the RTCP packet type field occupies the same position in the packet as the combination of the RTP marker (M) bit and the RTP payload type (PT).

[…]

To allow this multiplexing, future RTCP packet type assignments SHOULD be made after the current assignments in the range 209-223, then in the range 194-199, so that only the RTP payload types in the range 64-95 are blocked.

AFAIU,这意味着当两个协议在同一个字段中复用时,如果RTP数据包类型在64-95之间,则该数据包不是RTP数据包而是RTCP数据包。