SR: Sender Report RTCP packet

本文详细解析了RTCP中的Sender Report (SR)报文结构及其字段含义,包括版本号、填充比特、接收报告计数等基本信息,以及发送者信息、接收报告块等内容。
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|    RC   |   PT=SR=200   |             length            |header
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         SSRC of sender                        |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|              NTP timestamp, most significant word             |sender
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+info
|             NTP timestamp, least significant word             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         RTP timestamp                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     sender's packet count                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      sender's octet count                     |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|                 SSRC_1 (SSRC of first source)                 |report
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+block
| fraction lost |       cumulative number of packets lost       |  1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           extended highest sequence number received           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      interarrival jitter                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         last SR (LSR)                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   delay since last SR (DLSR)                  |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|                 SSRC_2 (SSRC of second source)                |report
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+block
:                               ...                             :  2
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|                  profile-specific extensions                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The sender report packet consists of three sections, possibly followed by a fourth profile-specific extension section if defined. The first section, the header, is 8 octets (8Bytes) long. The fields have the following meaning:

Version (V): 2 bits
    Identifies the version of RTP, which is the same in RTCP packets as in RTP data packets. The version defined by this specification is two (2).

    2比特   RTP版本识别符,在RTCP包内的意义与RTP包中的相同。此协议中定义的版本号为2。

 

Padding (P): 1 bit
    If the padding bit is set, this RTCP packet contains some additional padding octets at the end which are not part of the control information. The last octet of the padding is a count of how many padding octets should be ignored. Padding may be needed by some encryption algorithms with fixed block sizes. In a compound RTCP packet, padding should only be required on the last individual packet because the compound packet is encrypted as a whole.

    1比特 若设置填充比特,该RTCP包在末端包含一些附加填充比特,并不是控制信息的基本部分。填充的最后一个比特统计了多少个字节必须被忽略。填充可能会用于需要固定长度块的加密算法。在复合RTCP包中,复合包作为一个整体加密,填料比特只能加在最后一个单个RTCP包的后面。

 

Reception report count (RC): 5 bits
    The number of reception report blocks contained in this packet. A value of zero is valid.表示当前RTCP报中含有RR包的个数
    5比特 该包中所含接收报告(RR)块的数目。零值有效。   

P
acketType (PT): 8 bits
    Contains the constant 200 to identify this as an RTCP SR packet.

    8比特 包含常数200,用以识别这个为SR包。    

 

length: 16 bits
    The length of this RTCP packet in 32-bit words minus one, including the header and any padding. (The offset of one makes zero a valid length and avoids a possible infinite loop in scanning a compound RTCP packet, while counting 32-bit words avoids a validity check for a multiple of 4.)

    16比特 该RTCP包的长度减1。其单位是32比特字,包括头和任何填充字节。(偏移量1保证零值有效,避免了在扫描RTCP包长度时可能发生的无限循环,同时以32比特为单位避免了对以4为倍数的有效性检测。) 

 

SSRC: 32 bits
    The Synchronization source identifier for the originator of this SR packet.32比特   SR包发送者的同步源标识符。

The second section, the sender information, is20 octets (20Bytes)long and is present in every sender report packet. It summarizes the data transmissions from this sender. The fields have the following meaning:

第二部分,发送者信息,20字节长。在每个发送者报告包中出现。它概括了从此发送者发出的数据传输情况。此域有以下意义

 

NTP timestamp: 64 bits
   Indicates the wallclock time when this report was sentso that it may be used in combination with timestamps returned in reception reports from other receivers to measure round-trip propagation to those receivers. Receivers should expect that the measurement accuracy of the timestamp may be limited to far less than the resolution of the NTP timestamp. The measurement uncertainty of the timestamp is not indicated as it may not be known. A sender that can keep track of elapsed time but has no notion of wallclock time may use the elapsed time since joining the session instead. This is assumed to be less than 68 years, so the high bit will be zero. It is permissible to use the sampling clock to estimate elapsed wallclock time. A sender that has no notion of wallclock or elapsed time may set the NTP timestamp to zero.

    NTP时间戳:64比特 指示了此报告发送时的背景时钟(wallclock)时刻,它可以与从其它接收者返回的接收报告块中的时间标志结合起来,计算往返每个接收者所花的时间。接收者应让NTP时间戳的精度远大于其他时间戳的精度。时间戳测量的不确定性不可知,因此也无需指示。一个系统可能没有背景时钟的概念,而只有系统指定的时钟,如系统时间(system uptime)。在这样的系统中,此时钟可以作为参考计算相对NTP时间戳。选择一个公用的时名是非常重要的。这样多个独立的应用都可以使用相同的时钟。到2036年,相对和绝对NTP时间戳会产生大的差异。到那时,我们希望不再需要相对时钟。一个发送者,如果不用背景时钟时间或逝去时间,可以设置此项为零。

 

RTP timestamp: 32 bits
   Corresponds to the same time as the NTP timestamp (above), but in the same units and with the same random offset as the RTP timestamps in data packets.This correspondence may be used for intra- and inter-media synchronization for sources whose NTP timestamps are synchronized, and may be used by media- independent receivers to estimate the nominal RTP clock frequency. Note that in most cases this timestamp will not be equal to the RTP timestamp in any adjacent data packet. Rather, it is calculated from the corresponding NTP timestamp using the relationship between the RTP timestamp counter and real time as maintained by periodically checking the wallclock time at a sampling instant.

sender's packet count: 32 bits
    The total number of RTP data packets transmitted by the sender since starting transmission up until the time this SR packet was generated. The count is reset if the sender changes its SSRC identifier.

sender's octet count: 32 bits
    The total number of payload octets (i.e., not including header or padding) transmitted in RTP data packets by the sender since starting transmission up until the time this SR packet was generated. The count is reset if the sender changes its SSRC identifier. This field can be used to estimate the average payload data rate.

The third section contains zero or more reception report blocks depending on the number of other sources heard by this sender since the last report. Each reception report block conveys statistics on the reception of RTP packets from a single synchronization source. Receivers do not carry over statistics when a source changes its SSRC identifier due to a collision. These statistics are:

SSRC_n (source identifier): 32 bits
    The SSRC identifier of the source to which the information in this reception report block pertains.

fraction lost: 8 bits
    The fraction of RTP data packets from source SSRC_n lost since the previous SR or RR packet was sent, expressed as a fixed point number with the binary point at the left edge of the field. (That is equivalent to taking the integer part after multiplying the loss fraction by 256.) This fraction is defined to be the number of packets lost divided by the number of packets expected, as defined in the next paragraph. An implementation is shown in Appendix A.3. If the loss is negative due to duplicates, the fraction lost is set to zero. Note that a receiver cannot tell whether any packets were lost after the last one received, and that there will be no reception report block issued for a source if all packets from that source sent during the last reporting interval have been lost.

   表示包的丢失率是多少,即丢失的包的数量除以期望的包的数量,丢失的包的数量可以通过每次检查RTP包头中的Sequence Nmuber统计出来;

 

cumulative(累积的) number of packets lost: 24 bits
    The total number of RTP data packets from source SSRC_n that have been lost since the beginning of reception. This number is defined to be the number of packets expected less the number of packets actually received, where the number of packets received includes any which are late or duplicates(重复). Thus(从而) packets that arrive late are not counted as lost, and the loss may be negative() if there are duplicates.The number of packets expected is defined to be theextended last sequence number received, as defined next, less the initial sequence number received. This may be calculated as shown in Appendix A.3.

    从会话开始至今丢失的包的总数;

 

extended highest sequence number received: 32 bits
    The low 16 bits contain the highest sequence number received in an RTP data packet from source SSRC_n, and the most significant 16 bits extend that sequence number with the corresponding count of sequence number cycles, which may be maintained according to the algorithm in Appendix A.1. Note that different receivers within the same session will generate different extensions to the sequence number if their start times differ significantly.

    低16位表示最近收到的RTP包的序列号,一般情况下高16位全为0,但如果收到的某一个发送源的序列号出现循环,则在它的相应RR段中此高16位值表示已循环的次数;

 

interarrival(间隔到达) jitter: 32 bits

    An estimate of the statistical variance(统计方差) of the RTP data packet interarrival time, measured in timestamp units and expressed as an unsigned integer.The interarrival jitter J is defined to be the mean deviation (smoothed absolute value) of the difference D in packet spacing at the receiver compared to the sender for a pair of packets. As shown in the equation below, this is equivalent to the difference in the "relative transit time" for the two packets; the relative transit time is the difference between a packet's RTP timestamp and the receiver's clock at the time of arrival, measured in the same units.

    对RTP包到达不一致性的估计;

 

If Si is the RTP timestamp from packet i, and Ri is the time of arrival in RTP timestamp units for packet i, then for two packets i and j, D may be expressed as

                 D(i,j)=(Rj-Ri)-(Sj-Si)=(Rj-Sj)-(Ri-Si)


The interarrival jitter is calculated continuously as each data packet i is received from source SSRC_n, using this difference D for that packet and the previous packet i-1 in order of arrival (not necessarily in sequence), according to the formula

                    J=J+(|D(i-1,i)|-J)/16


Whenever a reception report is issued, the current value of J is sampled.

The jitter calculation is prescribed here to allow profile- independent monitors to make valid interpretations of reports coming from different implementations. This algorithm is the optimal first- order estimator and the gain parameter 1/16 gives a good noise reduction ratio while maintaining a reasonable rate of convergence [11]. A sample implementation is shown in Appendix A.8.

last SR timestamp (LSR): 32 bits
    The middle 32 bits out of 64 in the NTP timestamp (as explained in Section 4) received as part of the most recent RTCP sender report (SR) packet from source SSRC_n. If no SR has been received yet, the field is set to zero.

    表示所接收到的此RR块对应的SSRC发送的最后一个SR中64-bit NTP时间戳的中间32位,以告知它所发送的SR是否已经被收到;

 

delay since last SR (DLSR): 32 bits
    The delay, expressed in units of 1/65536 seconds, between receiving the last SR packet from source SSRC_n and sending this reception report block. If no SR packet has been received yet from SSRC_n, the DLSR field is set to zero.

    从收到最后一个SR到此RR块被发出经历的时间,精确到1/65536秒。

 

Let SSRC_r denote the receiver issuing this receiver report. Source SSRC_n can compute the round propagation delay to SSRC_r by recording the time A when this reception report block is received. It calculates the total round-trip time A-LSR using the last SR timestamp (LSR) field, and then subtracting this field to leave the round-trip propagation delay as (A- LSR - DLSR). This is illustrated in Fig. 2.

This may be used as an approximate measure of distance to cluster receivers, although some links have very asymmetric delays.

<think>我们正在分析Wireshark中与RTP/RTCP相关的术语:rtcprtcp_ms、rtcp_rtpfb。 这些术语通常出现在抓包分析中,用于标识不同类型的RTCP数据包。 1. **rtcp**:这是RTCP(Real-time Transport Control Protocol,实时传输控制协议)的通用标识。 RTCP是RTP(Real-time Transport Protocol)的伴随协议,用于传输会话控制信息,如服务质量反馈、参与者信息等。 在Wireshark中,如果一个数据包被识别为RTCP包,协议栏会显示“RTCP”。 2. **rtcp_ms**:这个标识通常表示RTCP中的“Sender Report”(SR)或“Receiver Report”(RR)消息。 “ms”可能代表“Measurement Summary”或“Media Stream”,但更常见的是指RTCP报告包中的时间戳信息(以毫秒为单位)。 在Wireshark中,具体的报告类型(SR或RR)会被详细解析并显示字段,包括发送/接收的包数、丢失率、抖动时间(以毫秒计)等。 3. **rtcp_rtpfb**:这是RTCP反馈消息(Feedback Message)的一种,具体是“RTP Feedback”(RTPFB)。 根据RFC 4585,RTCP反馈消息分为两类: - RTPFB: RTP Feedback(用于传输针对RTP流的反馈,如NACK,PLI等) - PSFB: Payload-Specific Feedback(针对特定载荷的反馈,如REMB,FIR等) 因此,`rtcp_rtpfb`在Wireshark中表示一个RTP反馈消息,例如NACK(否定确认)或PLI(关键帧请求)。 总结: - **rtcp**:通用RTCP协议标识。 - **rtcp_ms**:通常指RTCP报告消息(SR/RR)中包含的时间度量(毫秒)。 - **rtcp_rtpfb**:特指RTCP的RTP反馈消息类型(如NACK, PLI)。 注意:在Wireshark中,这些标识的具体显示可能因版本和解析器而异,但核心含义遵循RFC标准。 §§相关问题§§ 1. RTCP Sender Report (SR) 和 Receiver Report (RR) 在Wireshark中如何区分?它们各自携带哪些关键字段? 2. 在RTCP反馈消息中,NACK(否定确认)和PLI(关键帧请求)的具体应用场景是什么? 3. Wireshark如何根据RFC标准解析RTCP数据包的多部分复合结构(例如一个包中包含多个RTCP报文)? 4. 如何通过Wireshark的过滤规则只显示RTCP反馈消息(如rtcp_rtpfb)? 5. RTCP中的时间戳(以毫秒为单位)是如何计算的?它与RTP时间戳有何关联? </think>### RTCPRTCP_MS、RTCP_RTPFB 在 Wireshark 中的含义解析 #### 1. **RTCP** - **全称**:Real-time Transport Control Protocol(实时传输控制协议) - **作用**: - RTP(实时传输协议)的**伴生控制协议**,专用于**传输质量监控和会话管理** - 在 Wireshark 中标记为 `RTCP` 的流量包含: - 带宽分配反馈 - 网络丢包率/抖动统计 - 参与者身份标识(如 SSRC) - **典型场景**: ```plaintext Wireshark 过滤器:rtcp 示例包内容: [RTCP Sender Report] SSRC=0x12345, NTP Timestamp=2023-10-05 08:00:00.000 Packet Loss: 1.5%, Jitter=15ms ``` #### 2. **RTCP_MS** - **含义**:**Media Stream(媒体流)相关控制报文** - **核心功能**: - 管理媒体流同步(如音频/视频对齐) - 传递时间戳信息(RTP 时间戳 ↔ 挂钟时间映射) - 在 Wireshark 中标识为 `RTCP_MS` 的包通常是 **Sender Report (SR) 或 Receiver Report (RR)** - **关键字段**: ```c struct rtcp_sr { uint32_t ssrc; // 流标识 uint32_t ntp_sec; // NTP 时间戳(秒) uint32_t ntp_frac; // NTP 时间戳(小数部分) uint32_t rtp_ts; // RTP 时间戳 uint32_t packet_count; // 累计包数 uint32_t octet_count; // 累计字节数 }; ``` #### 3. **RTCP_RTPFB** - **全称**:RTP Feedback Message(RTP 反馈消息) - **标准依据**:RFC 4585 - **功能分类**: | 类型 | 作用 | Wireshark 显示 | |----------------|-----------------------------------|------------------------| | **NACK** | 请求重传丢失包(序号反馈) | `RTCP_RTPFB NACK` | | **TMMBR** | 动态调整对方码率(带宽请求) | `RTCP_RTPFB TMMBR` | | **PLI** | 关键帧请求(视频流恢复) | `RTCP_RTPFB PLI` | - **典型包结构**: ```plaintext [RTCP_RTPFB] Packet Type: NACK (205) Sender SSRC: 0xABCD Media SSRC: 0x1234 Lost Packet IDs: [1001, 1005] // 请求重传的包序号 ``` #### 4. **三者关系图解** ```mermaid graph TD A[RTCP] --> B[RTCP_MS<br>媒体流报告] A --> C[RTCP_RTPFB<br>RTP反馈] C --> D[NACK 丢包重传] C --> E[PLI 关键帧请求] C --> F[TMMBR 码率控制] B --> G[时间戳同步] B --> H[流量统计] ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值