当前位置:首页 >> 信息与通信 >>

9-Real


Real-Time Transport Protocol
Chiang, Wei-Kuo (江為國 江為國) 江為國 Assistant Professor Department of Computer Science and Information Engineering National Chung Cheng University Office : EA 311

Phone : 05-2720411~33126 Email : wkchiang@cs.ccu.edu.tw URL : http://www.cs.ccu.edu.tw/~wkchiang/

The Real-Time Transport Protocol
RTP: A Transport Protocol for Real-Time Applications
RFC 1889 RTP – Real-Time Transport Protocol RTCP – RTP Control Protocol

UDP
Packets may be lost or out-of-sequence

RTP over UDP
A sequence number A time stamp for synchronized play-out Does not solve the problems; simply provides additional information
WKC - 94 Spring @ CS.CCU 2 RTP & RTCP

投影片說明
RTP是用來傳送 是用來傳送real-time data的協定 在每個封包裡面 的協定,在每個封包裡面 是用來傳送 的協定 都帶有time stamp讓應用程式能同步撥放 都帶有 讓應用程式能同步撥放

WKC - 94 Spring @ CS.CCU

3

RTP & RTCP

RTCP
A companion protocol Exchange messages between session users # of lost packets, delay and inter-arrival jitter Quality feedback RTCP is implicitly open when an RTP session is open E.g., RTP/RTCP uses UDP port 5004/5005

WKC - 94 Spring @ CS.CCU

4

RTP & RTCP

投影片說明
RTCP是負責計算 是負責計算RTP封包的相關統計量 例如 封包的相關統計量,例如 是負責計算 封包的相關統計量 例如packet lost ratio, delay, jitter等等 值得一提的是 等等,值得一提的是 等等 值得一提的是RTCP只提 只提 供這些相關的資訊,並沒有提供這些問題的解決方案 供這些相關的資訊 並沒有提供這些問題的解決方案

WKC - 94 Spring @ CS.CCU

5

RTP & RTCP

RTP Overview
Initialed by ITU H.323, RTSP, SIP, … Real-time “transport protocol”
properties of a transport protocol: run on end system demultiplexing DOES NOT offer: reliability and flow/congestion control hooks for adding: reliability, flow/congestion control, …

Tightly coupled to the application Lower-layer protocol independent
WKC - 94 Spring @ CS.CCU 6 RTP & RTCP

RTP Goals
Lightweight
specification and implementation

Flexible
provide mechanism, don’t dictate algorithms

Protocol-Neutral
UDP/IP, ATM-AAL5, TCP/IP, ... no network-layer address

Scalable
unicast, multicast, ...

Separate Control/Data
WKC - 94 Spring @ CS.CCU 7 RTP & RTCP

What RTP Does Not Do?
Network resource reservations Quality of service guarantees Reliable data delivery

WKC - 94 Spring @ CS.CCU

8

RTP & RTCP

Data Transport: RTP
A thin protocol providing support for applications with real-time properties. Real-time properties support:
timing reconstruction loss detection security content identification

WKC - 94 Spring @ CS.CCU

9

RTP & RTCP

Control Functions: RTCP
Control: RTCP (RTP Control Protocol)
source identification resequencing (if needed) loop detection QoS feedback inter-media synchronization (lip sync: audio, video) intra-media synchronization removing delay jitter drifting sampling clocks session control (optional)

WKC - 94 Spring @ CS.CCU

10

RTP & RTCP

RTP Payload Formats (1/2)
RTP carries the actual digitally encoded voice
RTP header + a payload of voice/video samples UDP and IP headers are attached

Many voice- and video-coding standards
A payload type identifier in the RTP header Specified in RFC 1890 New coding schemes have become available See Table 2-1 and Table 2-2 A sender has no idea what coding schemes a receiver could handle.

WKC - 94 Spring @ CS.CCU

11

RTP & RTCP

RTP Payload Formats (2/2)
Separate signaling systems
Capability negotiation during the call setup SIP and SDP A dynamic payload type may be used Support new coding scheme in the future The encoding name is also significant. Unambiguously refer to a particular payload specification Should be registered with the IANA

RED, Redundant payload type
Voice samples + previous samples May use different encoding schemes Cope with packet loss
WKC - 94 Spring @ CS.CCU 12 RTP & RTCP

投影片說明
因為RTP host沒有辦法知道彼此可以支援的 沒有辦法知道彼此可以支援的codec,所以 因為 沒有辦法知道彼此可以支援的 所以 必須事先經由信令系統(SIP,SDP)交換訊息 以決定共用 交換訊息,以決定共用 必須事先經由信令系統 交換訊息 的codec 為了讓聲音有更好的品質,RTP可以傳送前一次取樣的封 可以傳送前一次取樣的封 為了讓聲音有更好的品質 包,降低前一次封包遺失後造成的低品質效應 降低前一次封包遺失後造成的低品質效應

WKC - 94 Spring @ CS.CCU

13

RTP & RTCP

RTP Header Format

WKC - 94 Spring @ CS.CCU

14

RTP & RTCP

The RTP Header (1/4)
Version (V)
2: the current version of RTP

Padding (P)
The padding octets at the end of the payload The payload needs to align with 32-bit boundary The last octet of the payload contains a count of the padding octets.

Extension (X)
1, contains a header extension

CSRC Count (CC)
The number of contributing source identifiers
WKC - 94 Spring @ CS.CCU 15

RTP & RTCP

The RTP Header (2/4)
Marker (M)
Support silence suppression The first packet of a talkspurt, after a silence period

Payload Type (PT)
In general, a single RTP packet will contain media coded according to only one payload format. RED is an exception.

Sequence number
A random number generated by the sender at the beginning of a session Incremented by one for each RTP packet
WKC - 94 Spring @ CS.CCU 16 RTP & RTCP

The RTP Header (3/4)
Timestamp
32-bit The instant at which the first sample The receiver Synchronized play-out Calculate the jitter The clock freq depends on the encoding E.g., 8000Hz Support silence suppression The initial timestamp is a random number chosen by the sending application.

WKC - 94 Spring @ CS.CCU

17

RTP & RTCP

The RTP Header (4/4)
Synchronization Source (SSRC)
32-bit identifier The entity setting the sequence number and timestamp Chosen randomly, independent of the network address Meant to be globally unique within a session May be a sender or a mixer

Contributing Source (CSRC)
An SSRC value for a contributor Used to identify the original sources of media behind the mixer 0-15 CSRC entries

RTP Header Extensions
WKC - 94 Spring @ CS.CCU 18 RTP & RTCP

Mixers and Translators
Mixers
Enable multiple media streams from different sources to be combined into a single stream If the capacity or bandwidth of a participant is limited An audio conference The SSRC is the mixer More than one CSRC values

Translators
Manage communications between entities that does not support the same coding scheme The SSRC is the participant, not the translator.
WKC - 94 Spring @ CS.CCU 19 RTP & RTCP

投影片說明
Mixer負責將各個聲源作時間同步化的混合後在將資料傳 負責將各個聲源作時間同步化的混合後在將資料傳 送到各個host,好處是可以降低使用的頻寬 送到各個 好處是可以降低使用的頻寬

WKC - 94 Spring @ CS.CCU

20

RTP & RTCP

RTP Translator
Translator
single media stream passes through data stream from different sources separately SSRC/CSRC unchanged may change the encoding of data (without mixing) may change payload type & timestamp may reassign sequence numbers

Uses
underlying protocol translation (e.g. IPv4 to IPv6) application-level relay in firewall high-speed network to low-speed network
WKC - 94 Spring @ CS.CCU 21 RTP & RTCP

RTP Mixer
Mixer
many-to-one stream combination (new encoding)
may change the data format

resynchronization of multiple streams
timing adjustment mixer is the synchronization source outgoing packets marked with the mixer’s own SSRC

identifying the original sources
inserts their SSRCs into the CSRC list of the mixed packet.

cascaded mixers (e.g., M2 and M3)

Uses
audio/video mixer media streams passed through low-speed link
WKC - 94 Spring @ CS.CCU 22 RTP & RTCP

The RTP Control Protocol (1/3)
RTCP
A companion control protocol of RTP Periodic exchange of control information For quality-related feedback A third party can also monitor session quality and detect network problems. Using RTCP and IP multicast

Five types of RTCP packets
Sender Report: transmission and reception
statistics

Receiver Report: reception statistics

WKC - 94 Spring @ CS.CCU

23

RTP & RTCP

The RTP Control Protocol (2/3)
Source Description (SDES) One or more descriptions related to a particular session participant Must contain a canonical name (CNAME) Separate from SSRC which might change in case of a host reset When both audio and video streams were being transmitted, the two streams would have different SSRCs the same CNAME for synchronized play-out BYE The end of a participation in a session APP For application-specific functions

WKC - 94 Spring @ CS.CCU

24

RTP & RTCP

The RTP Control Protocol (3/3)
Two or more RTCP packets will be combined
SRs and RRs should be sent as often as possible to allow better statistical resolution. New receivers in a session must receive CNAME very quickly to allow a correlation between media sources and the received media. Every RTCP packet must contain a report packet (SR/RR) and an SDES packet an SDES packet to be sent with SR/RR Even if no data to report

An example RTP compound packet

WKC - 94 Spring @ CS.CCU

25

RTP & RTCP

RTCP Transmission Interval
Goals
session size estimation RTCP bandwidth control small fraction of session bandwidth (e.g., 5%) the constant specified in a profile transmission rate while # members newly joining participants more quickly receive CNAME of senders for synchronization at least 1/4 control traffic for data senders

WKC - 94 Spring @ CS.CCU

26

RTP & RTCP

RTCP Sender Report
SR
Header Info Sender Info Receiver Report Blocks Option Profile-specific extension

WKC - 94 Spring @ CS.CCU

27

RTP & RTCP

RTCP Packet Format: SR
SR: Sender report
V=2 P RC PT=SR=200 length SSRC of sender NTP timestamp (MSW) NTP timestamp (LSW) RTP timestamp sender’s packet count sender’s octet count SSRC 1 cumulative number of packet lost extended highest sequence number received interarrival jitter last SR (LSR) delay since last SR (DLSR) SSRC 2 ... profile-specific extensions WKC - 94 Spring @ CS.CCU 28 RTP & RTCP header

sender info

fraction lost

report block 1

report block 2

RTCP SR Header
Resemble to an RTP packet
Version 2 Padding bit Padding octets? RC, receiver report count The number of reception report blocks 5-bit If more than 31 reports, an RR is added PT, payload type (200)

WKC - 94 Spring @ CS.CCU

29

RTP & RTCP

Sender Info
SSRC of sender NTP Timestamp
Network Time Protocol Timestamp The time elapsed in seconds since 00:00, 1/1/1900 (GMT) 64-bit 32 MSB: the number of seconds 32 LSB: the fraction of a seconds (200 ps)

RTP Timestamp
Corresponding to the NTP timestamp The same as used for RTP timestamps For better synchronization

Sender’s packet count
Cumulative within a session

Sender’s octet count
Cumulative within a session
WKC - 94 Spring @ CS.CCU 30 RTP & RTCP

RR blocks (1/2)
SSRC_n
The source identifier of the session participant to which the data in this RR block pertains.

Fraction lost
Fraction of packets lost since the last report issued by this participant By examining the sequence numbers in the RTP header

Cumulative number of packets lost
Since the beginning of the RTP session

Extended highest sequence number received
The sequence number of the last RTP packet received 16 lsb, the last sequence number 16 msb, the number of sequence number cycles

WKC - 94 Spring @ CS.CCU

31

RTP & RTCP

RR blocks (2/2)
Interarrival jitter
An estimate of the variance in RTP packet arrival

Last SR Timestamp (LSR)
Used to check if the last SR has been received

Delay Since Last SR (DLSR)
The duration in units of 1/65,536 seconds

WKC - 94 Spring @ CS.CCU

32

RTP & RTCP

RTCP Receiver Report
RR
Issued by a participant who receives RTP packets but does not send, or has not yet sent Is almost identical to an SR PT = 201 No sender information

WKC - 94 Spring @ CS.CCU

33

RTP & RTCP

RTCP Packet Format: RR
RR: Receiver report
V=2 P RC PT=RR=201 length SSRC of sender SSRC 1 cumulative number of packet lost extended highest sequence number received interarrival jitter last SR (LSR) delay since last SR (DLSR) SSRC 2 ... profile-specific extensions header

fraction lost

report block 1

report block 2

WKC - 94 Spring @ CS.CCU

34

RTP & RTCP

RTCP Source Description Packet
Provides identification and information regarding session participants
Must exist in every RTCP compound packet

Header
V, P, SC, PT=202, Length

Zero or more chunks of information
An SSRC or CSRC value One or more identifiers and pieces of information A unique CNAME Email address, phone number, name
WKC - 94 Spring @ CS.CCU 35 RTP & RTCP

RTCP Packet Format: SDES
SDES: Source description
V=2 P SC PT=SDES=202 SSRC/CSRC 1 SDES items ... SSRC/CSRC 2 SDES items ... length chunk 1

chunk 2

SDES item, 32-bit boundary
type (8b) length (8b) text...

Type: CNAME (1), NAME (2), EMAIL (3), PHONE (4), LOC (5), TOOL (6), NOTE (7), PRIV (8)

WKC - 94 Spring @ CS.CCU

36

RTP & RTCP

RTCP Packet Format: BYE & APP
RTCP BYE Packet (BYE: Goodbye)
Indicate one or more media sources are no longer active
V=2 P SC PT=BYE=203 length SSRC/CSRC ... reason for leaving

length

(opt)

Application-Defined RTCP Packet
For application-specific data For non-standardized application
V=2 P subtype PT=APP=204 SSRC/CSRC name (ASCII) application-dependent data 37 length

WKC - 94 Spring @ CS.CCU

RTP & RTCP

Calculating Round-Trip Time
Use SRs and RRs E.g.
Report A: A, T1 → B, T2 Report B: B, T3 → A, T4 RTT = T4-T3+T2-T1 RTT = T4-(T3-T2)-T1 Report B LSR = T1 DLSR = T3-T2

A
T1

B

T2 T3 T4

WKC - 94 Spring @ CS.CCU

38

RTP & RTCP

Round-Trip Time Computation
[10 Nov 1995 11:33:25.125]

sender
PT=200 SSRC n NTP ts = b44d:b705:2000:0000 (302499206.125 s) ...

[10 Nov 1995 11:33:36.5] A=b710:800 (46864.500 s)

SR (n)

receiver
5.250 s

RR (n)

PT=201; SSRC n LSR = 46853.125 s (b705:2000) DLSR = 5.250 s (0x005:4000) ...

LSR: last SR timestamp (32 bits) DLSR: delay since last SR (32 bits) RTT computation: Round-trip propagation delay = A - DLSR - LSR = 46864.500 - 5.250 - 46853.125 = 6.125
WKC - 94 Spring @ CS.CCU 39 RTP & RTCP

Calculation Jitter
The mean deviation of the difference in packet spacing at the receiver
Si = the RTP timestamp for packet i Ri = the time of arrival D(i,j) = (Rj-Sj) - (Ri- Si)

The Jitter is calculated continuously
J(i) = J(i-1) + (| D(i-1,i) | - J(i-1))/16

WKC - 94 Spring @ CS.CCU

40

RTP & RTCP

Jitter Computation
sender Si Sj
… RTP timestamp SSRC ...

receiver Ri D(i, j) Rj

Receiver computes: D(i, j) = (Rj - Ri) - (Sj - Si) = (Rj - Sj) - (Ri - Si) Jnew = Jold + (|D(i - 1, i)| - Jold) / 16
Note: 1/16 is the gain (smoothing constant) for low-pass filter
WKC - 94 Spring @ CS.CCU 41 RTP & RTCP

Intermedia Synchronization
SR
PT = 200 SSRC 1 NTP ts = 123456.4829 s RTP ts = 11582265 ... PT = 200 SSRC 2 NTP ts = 123452.2439 s RTP ts = 11169321 ...

RTP data packets
PT = 6 RTP ts = 11621305 SSRC 1 ... arrival time = 0 PT = 26 RTP ts = 11763321 SSRC 2 ... arrival time = 0.05

for SSRC 1:
123458.4829 + (11621305-11582265) / 16000 = 123460.4829

RTP Profile: RTP Profile:
PT = 6, PT = 6, PT = 26, PT = 26, 16000 Hz 16000 Hz 90000 Hz 90000 Hz

for SSRC 2:
123452.2439 + (11763321-11169321) / 90000 = 123458.2439

Time interval = 2.2390 (SSRC 2 first)
WKC - 94 Spring @ CS.CCU 42 RTP & RTCP

Timing of RTCP Packets
RTCP provides useful feedback
Regarding the quality of an RTP session Delay, jitter, packet loss Be sent as often as possible Consume the bandwidth Should be fixed at 5%

An algorithm, RFC 1889
Senders are collectively allowed at least 25% of the control traffic bandwidth. (CNAME) The interval > 5 seconds 0.5 – 1.5 times the calculated interval A dynamic estimate the avg. RTCP packet size
WKC - 94 Spring @ CS.CCU 43 RTP & RTCP

RTP Data Packet Header
Payload Types Payload Types Sequence Number Sequence Number RTP Timestamp RTP Timestamp SSRC(Source Synchron.) SSRC(Source Synchron.)

RTP Control Packets
SDES SDES chunk(s) 1 chunk(s) 1 SSRC_1 SSRC_1 CNAME CNAME

Source Identification Re-sequencing Packet loss estimation Network congestion measure Intra-media synchronization Inter-media synchronization Round-trip time computation

Sender Report Sender Report SSRC SSRC NTP timestamp NTP timestamp RTP timestamp RTP timestamp sender’s packet count sender’s packet count sender’s octet count sender’s octet count report block(s) report block(s) Receiver Report Receiver Report SSRC SSRC report block(s) 1 report block(s) 1 SSRC_1 SSRC_1 # packets lost # packets lost inter-arrival jitter inter-arrival jitter last SR last SR delay since last SR delay since last SR

Any Questions ?

WKC - 94 Spring @ CS.CCU

45

RTP & RTCP


相关文章:
中专基础英语bookIunit9Unit Nine Time to celebrate------real skills
UNIT 9 Real Life skills and Further reading 板书 Time: RSVP before Tel: At ’s house Add: 设计 E-mail: 教后记 教学程序和教学内容 一、Warming up ...
2015年9月试卷I-答案
2015年9月试卷I-答案_语文_高中教育_教育专区。CIIA历年真题—试卷+答案(自己...(2 分) 但是,由于 Sreal 下降减少进口价值,存在方向相反的价格效应。 如...
QUIZ 9 读写
daughter. D. Mother and son. 9. A. The woman's son is much too ...B. They look older than their real age. C. They look younger than ...
初二读写9
初二读写9_初二英语_英语_初中教育_教育专区。初二阅读理解详解与练习系列C...use expressions that sound like invitations but which are not real ...
典范英语8-9
典范英语8-9_英语_高中教育_教育专区。典范英语89The Luckless Monster 1 Monsters...I don’t have any real friends. There’s Nessie of course ---but sh...
软件工程第9版部分习题答案
软​件​工​程​第​9​版​部​分​习​题​答​案...requirements will change as real user experience with the system is gained....
c语言第9章习题参考答案
c语言第9章习题参考答案_理学_高等教育_教育专区。C程序教程设计与实验 ...#include<stdio.h> typedef struct { int real; int image; } Complex; ...
Module9试题
Module9试题_初二英语_英语_初中教育_教育专区。Module9 一. 单项选择 (15分)...The parrot sounded so real that John’s neighbours thought John had an ...
Unit-9-Can-you-come-to-my-party练习
Unit-9-Can-you-come-to-my-party练习_英语_初中教育_教育专区。英语人教版...A.entertainment at home B.real invitations or not C.expressions of starting...
RealTimeClock_17
S3C2410A 中文数据手册 Real Time Clock (RTC) 第 17 章概述 实时时钟 当...[4] MONDATA [3:0] 0~1 0~9 —— BCDYEAR REGISTER(BCDYEAR) ( ) ...
更多相关标签:
realplayer 9.0 | realhack 3.9下载 | realplayer9.0下载 | realhack 3.9 | realvideo 9 | realhack 3.9 百度云 | realplayer 9 | real female orgasms9 |