Unformatted text preview:

1RTP / RTCPInternet ProtocolsCSC / ECE 573Fall, 2005N. C. State Universitycopyright 2005 Douglas S. Reeves2AnnouncementsI. Final Exam study guide onlineII. Signup for project demosIII. Teaching evaluations at end todaycopyright 2005 Douglas S. Reeves3Today’s LectureI. RTPII. RTCPIII. Header CompressionRTP (Real-Time Protocol)copyright 2005 Douglas S. Reeves5RTP Info• RTP adds a new header to each packetEthernetDriverARP IP RARPICMP IGMPTCP UDPapplication application application RTPRTP…applicationcopyright 2005 Douglas S. Reeves6RTP (RFC 3550)• TCP unacceptable for voice and video– why?• Preferable: use UDP for transport– but UDP is connectionless, no in-order delivery, nodetection of losses– RTP adds: Payload Type, Sequence #, Timestamp• RTP does not…• guarantee reliable delivery of packets• guarantee QoS2copyright 2005 Douglas S. Reeves7RTP Functions1. Payload Type: identification of media stream2. Timestamp• timing reconstruction (for control of playback)• synchronization of different media types (e.g., audio +video)3. Sequence #• packet sequencing• loss detection (and rate adaptation)copyright 2005 Douglas S. Reeves8Translators and Mixers• Participants in a multimedia session may usedifferent media formats or compression standards– a translator (also called a media gateway) convertsfrom one media format to another• Audio from multiple senders can be mixed into asingle audio stream by a mixerAudioSource 1AudioSource 2TranslatorMixerG.711G.728GSMGSMGSMmediatype 1media type 2mediatype 3copyright 2005 Douglas S. Reeves9RTP Header Contents• Appears in every data packet, minimum of 12bytes– Byte 1: Version, Padding Flag, Extension Flag, # ofSources (max of 15)– Byte 2: Application Marker Flag, Payload Type (7 bits)– Bytes 3-4: Sequence Number– Bytes 5-8: Timestamp (format is application-specific)– Bytes 9-12: SSRC (Synchronization Source Identifier) =random #, not IP address, identifies a single mediastreamcopyright 2005 Douglas S. Reeves10RTP Ports and Profiles• RFC 1990 specifies A/V Profiles– default Payload Types for common audio and videocompression standards (currently: 24 types)• Contains– mapping of media encoding to payload format– default packet rate• Allocate a port pair for RTP and RTCP– e.g., 5004 for RTP, 5005 for RTCP– each media stream (voice, video, etc.) normally hasown RTP connectioncopyright 2005 Douglas S. Reeves11RTP Timestamps• Initial value is random number (i.e., absolutetiming not used)• Timing rate or resolution is payload-dependent,specified as part of the A/V profile– resolution must be ≥ sampling rate of the media type(e.g., 8KHz for compressed voice)• Timestamp in an RTP packet is time of the firstsample in the frameRTCP (Real-Time Control Protocol)3copyright 2005 Douglas S. Reeves13RTCP Purposes• Used for negotiation between senders andreceivers• Reports the quality of the connection betweensender and receiverscopyright 2005 Douglas S. Reeves14Types of RTCP Messages (Partial)1. Source Description – useful information aboutthe source data2. Sender Report – report current time andamount of data sent so far3. Receiver Report – feedback to sender aboutwhat has been received so far4. Bye – source is disconnecting5. Application-specificcopyright 2005 Douglas S. Reeves15#1: Source Description Message• Contains up to 31 Source Descriptors• Each Source Descriptor contains– Synchronization Source ID (32 bits)– some number of TLV (tag, length, value)-encoded fields– Examples of standardized fields• Name of originator• Email address• phone number• Location• …copyright 2005 Douglas S. Reeves16#2: Receiver Report Message• There is one Source Report Block for eachsender about which the receiver is reporting.Contents as follows:1. SSRC (32 bits)2. Fraction of blocks lost since last report (out of255)• 8 bits, i.e., 13 = 13/255 = 5% lost3. Cumulative number of packets lost (24 bits)copyright 2005 Douglas S. Reeves17Receiver Report Message (con’td)4. Highest sequence number received (32 bits)– RTP sequence numbers wrap around after 216-1– this is “extended sequence number”5. Interarrival Jitter Estimate (32 bits)6. LSR: Time of last Sender Report (32 bits)• in NTP format, just the middle 4 bytes7. DLSR: Delay since last Sender Report (32 bits)• in units of 1/65536 secondscopyright 2005 Douglas S. Reeves18Computing Round-Trip DelaysenderreportReceiverreport4copyright 2005 Douglas S. Reeves19RTP Jitter Calculations• Jitter: statistical variance of the RTP datainterarrival times• Symbols for calculations– s is the source– r is the receiver– rr is receiver report– jitter estimate is a floating point number– rr->jitter field of the receiver report is integerapproximationcopyright 2005 Douglas S. Reeves20RTP Jitter Calculations (cont’d)• Inputs– r->ts = timestamp from the incoming packet– arrival = the current time (in the same units)• Outputs– s->transit = the transit time for the previous packet– s->jitter = the estimated jitter int transit = arrival - r->ts; int d = | transit - s->transit |; s->transit = transit; s->jitter += (1./16.) * ((double)d - s->jitter); rr->jitter = (u_int32) s->jitter;copyright 2005 Douglas S. Reeves21Example• Initially, s->transit = 0,s->jitter = 0)arrival=1800,r->ts=1700transit = 100d = 200s->transit = 100s->jitter = 18.75 + 1/16*(200 – 18.75) = 30.01rr->jitter = 30arrival = 1000, r->ts = 700transit = 300d = 300 – 0 = 300s->transit = 300s->jitter = 0 + 1/16*(300-0) =18.75rr->jitter = 18 first packetnext packet copyright 2005 Douglas S. Reeves22Sender Report Message• Sender Source ID (SSRC)• NTP Timestamp– standard representation of time of day, 8 bytes long– (better than) nanosecond resolution• RTP Timestamp (application specific) (32 bits)• Number of packets sent so far (32 bits)• Number of bytes sent so far (32 bits)copyright 2005 Douglas S. Reeves23Additional RTCP Messages…• MsgType 4: Bye message– SSRCs of sources leaving– optionally: “reason for leaving”• MsgType 5: Application-Specific message– makes RTCP easily extensiblecopyright 2005 Douglas S. Reeves24Moderating RTCP Traffic Volume• RTCP traffic volume is carefully controlled toprevent excessive overhead• RTCP traffic designed to be no more than 5% ofthe media traffic (RTP)– 1.25% allocated to senders, and 3.75% allocated toreceivers– as number of receivers


View Full Document

NCSU CSC (ECE) 573 - Internet Protocols

Documents in this Course
Load more
Download Internet Protocols
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Internet Protocols and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Internet Protocols 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?