Nepal Telecom Exam Preparation (Level 7) : Dipak Kumar Nidhi

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Nepal Telecom Exam Preparation

(Level 7)
Dipak Kumar Nidhi
Real Time Protocol
( RTP – Real-Time Transport Protocol )
RTP
A General view of the real-time protocols
• Stream description : SDP, SMIL
Describe the session and content
• Stream Control : RTSP
Remote control the session
• Session Handling : SIP, SAP, SDP
Session initiation, announcement, description
• Media Transport : RTP and RSTP
Send data and metadata
RTP
RTP
Streaming : TCP or UDP ?
Why not TCP?
• Loss retransmission mechanism

• Continuous rate fluctuation

Why not UDP


• Too simple and not reliable

• Does not take account for take account for the lost packet and delayed
packet
RTP
• UDP is used to carry pure audio streaming
 Like audio and VoIP

• TCP is used for streaming; large buffer delay


 Ok for one way application, like watching clips from YouTube
 Not ok for interactive application, like video conference
RTP
• Real-time Transport protocol (RTP)
 A framing protocol for real-time applications
 Does not define any QoS mechanism for real-time delivery

• Real-time control protocol (RTCP)


 It’s a companion control protocol
 Does not guarantee anything either
 Provides feedback

The main purpose is to aid the application to know something about the
network and accordingly adapt its behavior.
RTP
Design goal and philosophy
• Flexible
 Provide mechanisms, do not dictate algorithm
 Instantiations for H261, MPEG 1/2/…
• Protocol neutral
 UDP/IP, Private ATM networks…
• Scalable
• Unicast, Multicast, from 2 to …
• Separate control/data
 Some functions may be taken over by conference control protocol
(e.g. RTSP)
RTP Requirements
• Meet the requirements of
 Interactive multimedia applications (strict real-time constraints)
 Streaming application (not so strict)
• Allow similar applications to talk to each other
 Negotiate on coding schemes
• Help recipients determine timing relationships among data
 Time-stamping
 Synchronization of multiple-media
RTP Requirements
• Provide an indication of packet loss
 Application needs to handle it
• Provide an indication of “frame boundary”
 Differs with respect to applications
 Audio—talkspurt
 Video– I/P/B frames
• Provide a generic identity for senders
 Independent of IP address
• All of this without to much header
RTP Requirements
• Application-level framing
 An application knows best what it needs
 Have different profiles (formats) for different applications
 Advantage : app-specific flexibility
• End-to-end principle
 End systems to take responsibility of providing service irrespective
of N/W capabilities
 Intelligence in the applications

• Provide a generic identity for senders


 Independent of IP address
• All of this without to much header
RTP Features
• RFC 3550
• RTP runs in end systems
• RTP packets are encapsulated in UDP segments
• Manage delivery of real-time (RT) data
 Specifies packet structure for packets carrying audio, video data
• Interoperability
 If two VoIP applications run RTP, they can run together
RTP Features
• RPT packet provides
 Payload type identification
 Source identifier
 Sequence number for loss detection
 Time-stamping for timing recovery
 Marker for significant events in the data stream (based on the
application)
RTP Functions
Data Functions
• Content labeling
 Source identification
 Loss detection
 Re-sequencing
• Timing
 Intra-media Synchronization
 Removes jitter with playout buffers
 Inter-media Synchronization
 Lip synchronization between audio-video
RTP
RTP libraries provide transport-layer interface that extends UDP
• Port number, IP address
• Payload type identification
• Packet sequence numbering
• Time-stamping

• No fixed UDP port : Negotiated out of band


• UDP port for RCTP : UDP port for RTP+1
• Usually one media per RTP session (i.e. port pair)
How RTP Works

RTP
UDP RTP Video
IP Header
Header Payload
Header

UDP RTP
RTP Audio
IP Header Header
Payload
Header

●Video and audio payloads are sent separately


●Uses sequence number to synchronise audio and
video once received
RTP

RTP operation
RTP Header Format
RTP Header Format
Payload type (7 bits)
• Indicates the type of encoding currently being used
• If the sender changes encoding during call, sender informs receiver via
payload type field
Payload type 0 : PCM -law, 64Kbps
Payload type 3 : GSM , 13Kbps
Payload type 7 : LPC, 2.4Kbps
Payload type 26 : Motion JPEG
Payload type 31 : H.261
Payload type 33 : MPEG2 video

Sequence (16 bits)


• Increment by one for each RTP packet sent
• Detect packet loss,
• Restore packet sequence
RTP Header Format
Time stamp
• To enable different media stream to be synchronized

• A counter of ticks

• Granularity of ticks is app specific

• Represents time at which first sample in pkt was generated

• Difference in time-stamps used for synchronization


RTP Header Format
Synchronization source ID (SSRC)
• Uniquely identifies single source of RTP stream

Contributing source ID (CSRC)


• When number of RTP streams pass through mixer
RTP Header Format
Time stamp field (32 bits long)
• Sampling instant of first byte in this RTP data packet

• For audio, time-stamp clock increments by one for each sampling


period

• If application generates chunks of 160 encoded samples (20ms), time


stamp increases by 160 for each RTP packet when source is active
(sequence no increased by 1)

• Time-stamp clock continues to increase at constant rate when source


is inactive (i.e. for talkspurt)
RTP Header Format
SSRC field (32 bits)
• Identifies source of RTP stream.
 E.g. sending 64Kbps PCM-encoded voice over RTP
 Application collects encoded data in chunks
 E.g. every 20ms; 160 bytes in a chunks
 Audio chunks +RTP header from RTP packet, which is
encapsulated in UDP segment
• Each stream in RTP session has distinct SSRC
• RTP header indicates type of audio encoding in each packet
 Sender can change encoding during conference
• RTP header also contains sequence numbers, timestamps
RTP multiplexing using SSRC
• One RTP session between VoIP gateways
 Many phone calls between branch offices
 Multiplexing using different SSRC ID within the RTP
session
RTP Mixer
• To combine the streams from different sources
• Mixer becomes the SSRC
• Others are CSRC
RTP Packet Validation
• There is no protocol field
• Need to check for version field or some fields in stream of packets
• Per-flow checking (i.e. look for constant SSRC and increasing)
RTP & TCP/IP Model
Internet Protocol Suite

Application Layer

BGP · DHCP · DNS · FTP · HTTP ·IMAP · IRC · LDAP ·


MGCP · NNTP ·NTP · POP · RIP · RPC · RTP · SIP
·SMTP · SNMP · SSH · Telnet ·TLS/SSL · XMPP ·
Transport Layer

TCP · UDP · DCCP · SCTP · RSVP ·ECN

Internet Layer

IP (IPv4, IPv6) · ICMP · ICMPv6 · IGMP ·IPsec ·

Link Layer

ARP/InARP · NDP · OSPF ·Tunnels (L2TP) · PPP ·


Media Access Control (Ethernet, DSL, ISDN, FDDI)
RTP

IPTV Protocol Stack


RTP

SIP - Protocol Stack


RTP

The functional sections of the IP stack


Thanks

You might also like