Docstoc

Real Time Transmission Protocol (RTP) and Real Time Transmission Control Protocol (RTCP) Library Implementation

Document Sample
Real Time Transmission Protocol (RTP) and Real Time Transmission Control Protocol (RTCP) Library Implementation Powered By Docstoc
					                                                             (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                     Vol. 09, No.09, 2011
                              Real Time Transmission Protocol (RTP) and
                            Real Time Transmission Control Protocol (RTCP)
                                       Library Implementation
                                                    Mohammad Monirul Islam
                                               Computer Science and Engineering Department
                               Daffodil International University 102, Shukrabad, Dhaka-1207, Bangladesh



        ABSTRACT— The system proposed is to create a                    drawbacks there is a need of library, which remains private &
library that will cover all the specifications given in RFC
                                                                        easy to customize. This new implementation will be based on
3550.
                       I. INTRODUCTION                                  object oriented scenarios. Real-Time Transfer Protocol (RTP)
        RFC 3550 is Transport Protocol for Real-Time                              RTP was developed by the Audio/Video Transport
Applications. RFC 3550 is RTP Version 2 protocol definition             working group of the IETF and has since been adopted by the
[1] proposed library would be used to develop applications              ITU as part of its H.323 series of recommendations, and by
that deal with transmission of real time audio and video data.          various other standards organizations. The first version of RTP
RFC (Request For Comments) a document that describes the                was completed in January 1996. RTP needs to be profiled for
specifications for a recommended technology. Any RFC has                particular uses before it is complete; an initial profile was
specifications that are classified under following categories           defined along with the RTP specification, and several more
‘must’, ‘must not’, ‘required’, ‘shall’, ‘shall not’, ‘should’,         profiles are under development. Profiles are accompanied by
‘should not’, ‘recommended’, ‘may’, ‘may not’ and ‘optional’.           several payload format specifications, describing the transport
Compliance with of an implementation with an RFC is                     of a particular media format.
measured by checking against req. Marked with above                     Real-Time Transfer Protocol consists of two major
keywords. I intend to develop a library that would be                   components:
compliant to the maximum possible extent. [2]
                                                                        1 Real Time Protocol (RTP): It carries real-time data.
        The Library will provide simple API’s for user
interface. Library will take care of Session Management.                2 Real Time Control Protocol (RTCP): It monitors the quality
Library will handle error correction and data recovery for              of service and conveys information about the participants [2]
incoming and outgoing packets. The Library will be easily
scalable. Library will be able to handle packet validations. The                       III. The RTP Data Transfer Packet
Library should provide error-handling mechanism.
                                                                                                  RTP Sessions
                                                                            A session consists of a group of participants who are
    II. Existing System and Need for System
                                                                        communicating using RTP. A participant may be active in
     Many implementations of Real Time Transmission                     multiple RTP sessions—for instance, one session for
                                                                        exchanging audio data and another session for exchanging
Protocol (RTP) or Real Time Transmission Control Protocol               video data. For each participant, a network address and port
(RTCP) are available in the market, but some of them are too            pair to which data should be sent, and a port pair on which data
specific to certain kind of applications and some are not easy          is received identify the session. The send and receive ports may
                                                                        be the same. Each port pair comprises two adjacent ports: an
to customize as per need of the application. One such                   even-numbered port for RTP data packets and the next higher
RTP/RTCP library available under open GPL, The GNU                      (odd-numbered) port for RTCP control packets. The default
General Public License (GNU GPL or simply GPL) is a                     port pair is 5004 and 5005 for UDP/IP, but many applications
                                                                        dynamically allocate ports during session setup and ignore the
widely used free software license, originally written by                default. RTP sessions are designed to transport a single type of
Richard Stallman for the GNU project. The latest version of             media; in a multimedia communication, each media type
the license, version 2, was released in 1991. The GNU Lesser            should be carried in a separate RTP session [5]
General Public License (LGPL) is a modified version of the                        The RTP header has the following format:
GPL, intended for some software libraries [3] which do not
provide any kind of support. Any customization needs direct
changes in library code, which requires complete
understanding of library code. This library is not implemented
using object oriented concepts. [4] To cope with these



                                                                   98                              http://sites.google.com/site/ijcsis/
                                                                                                   ISSN 1947-5500
                                                             (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                     Vol. 09, No.09, 2011
                                                                         SR:      Sender report, for transmission and reception
                                                                                  statistics from participants that are active senders

                                                                         RR:      Receiver report, for reception statistics from
                                                                                  participants that are not active senders and in
                                                                                  combination with SR for active senders reporting on
                                                                                  more than 31 sources.

                                                                         SDES: Source description items, including CNAME

                                                                         BYE:     Indicates end of participation

                                                                         APP:     Application-specific functions [2]
                                                                         Objectives of System

                                                                          Library should provide simple set of functions (interface)
                                                                                 that would be used by applications to transmit
                                                                                 RTP/RTCP data.
            Fig: RTP header Format
                                                                                 It should be easily portable across platforms.
Real Time Control Protocol (RTCP)

         The RTP control protocol (RTCP) is based on the
periodic transmission of control packets to all participants in          Scope of Work
the session, using the same distribution mechanism as the data
packets. The underlying protocol must provide multiplexing of
                                                                             Library implementation will be according to the
the data and control packets, for example using separate port
numbers with UDP. RTCP performs four functions:                          specifications defined in RFC3550.

1. The primary function is to provide feedback on the quality            RFC3550 defines certain rules that are mandatory for real time
of the data distribution. The feedback may be directly useful
                                                                         data transmission.
for control of data encodings that are currently used.
                                                                         Operating Environment – Hardware and Software
2. RTCP carries a persistent transport-level identifier for an
RTP source called the canonical name or CNAME. Since the
SSRC identifier may change if a conflict is discovered or a                                V. Hardware Requirements
program is restarted, receivers require the CNAME to keep                                    128 and above RAM
track of each participant. Receivers may also require the                                 5GB or more Hard Disk..
CNAME to associate multiple data streams from a given
                                                                                    Well Established Network environment.
participant in a set of related RTP sessions.

3. By having each participant send its control packets to all the                          VI. Software Requirements
others, each can independently observe the number of                                 Development ToolKit. C++ on Linux .
participants. This number is used to calculate the rate at which
                                                                                     Operating System Linux 7.1 & above.
the packets are sent.

4. A fourth, optional function is to convey minimal session                           VII. LIBRARY IMPLEMENTATION
control information, for example participant identification to
be displayed in the user interface. This is most likely to be                          Library implements RTP/RTCP protocol by
useful in "loosely controlled" sessions where participants enter
and leave without membership control or parameter                            providing suitable APIs, each API functions as follows:
negotiation.
    IV. RTCP Packet Format                                               1. RTP_CreateSession()
  This specification defines several RTCP packet types to                                  This is the first API that application will call
carry a variety of control information:                                  to establish a session. It takes parameters like user’s self-IP
                                                                         address and pair of ports defined to receive RTP and RTCP




                                                                    99                               http://sites.google.com/site/ijcsis/
                                                                                                     ISSN 1947-5500
                                                              (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                      Vol. 09, No.09, 2011
packets. Internally this API then creates participant list and             parameters as handle of current session, type of RTCP report
adds self-entry in that list. Each participant entry in list               and SSRC of destination participant. Internally this API will
contains information about participant and it’s state. It also             create appropriate report packet based on type specified. In
creates pair of UDP sockets through which user will send and               this packet creation, RTCP common header will be filled,
receive RTP/RTCP packets. Finally it returns handle to                     along with this it will also generate report blocks. Finally this
session, which will be used as a parameter in subsequent APIs.             packet will then get transferred to specified SSRC. Then self-
2. RTP_SetPayloadSize()                                                    information from participant list gets updated.
                    This API sets the payload size for RTP data
packets. Payload size will be determined by payload format                 9. RTP_RecvRTCPReport()
that is used by all session members. API internally allocates                       Application can call this API to receive RTCP packet.
buffer of this size plus size of RTP packet header to carry RTP            Internally this API determines the incoming RTCP packets
packet.                                                                    type and builds corresponding RTCP packet. Then information
3. RTP_CalculateRTCPTimeInterval()                                         about participant from which this packet is received gets
                    This API internally calculates RTCP time               updated in participant list. Finally the structure that describes
interval , the time interval is calculated by considering many             the received RTCP packet is given to the application.
session parameters like number of session members, number
of active senders , number of receivers, bandwidth allocated to            10. RTP_SendRTCPByePacket()
the session etc. On expiration of this interval participant may                     Application calls this API when it wants to leave the
send RTCP packet.                                                          session or when he finds the conflicting SSRC. API takes
                                                                           parameter as handle of current session and string that gives
4. RTP_SendRTPData()                                                       reason of saying BYE and length of the string.
         Application will use this API to send media-data .
API takes parameters as media-data and SSRC of participant                 11.RTP_CloseSession()
to whom this data needs to be send. API internally creates                            Application calls this API when it wants to close the
RTP packet by feeling header fields and attaches this header to            current session by specifying the handle of session. API
media-data. This packet then transferred to participant with               internally releases all the resources of session like participant
given SSRC.After sending such a packet self-information in                 list, session object etc.
participant list will get updated.
                                                                                     CONCLUSION
5. RTP_RecvRTPData()
         Application calls this API to receive RTP data.                             The key standard for audio/video transport in IP
Internally API constructs the RTP packet from received raw                 networks is the Real-time Transport Protocol (RTP), along
data. Then the packet gets validated for various header fields.            with its associated profiles and payload formats. RTP aims to
Once packet is valid only media-data and sender’s SSRC is                  provide services useful for the transport of real-time media,
given to application. Then state of participant from which this            such as audio and video, over IP networks. These services
packet is received is updated in participant list.                         include timing recovery, loss detection and correction, payload
                                                                           and source identification, reception quality feedback, media
6. RTP_AddParticipant()                                                    synchronization, and membership management.
         After receiving RTP/RTCP packet application can
call this API to add the participant from which packet is                           By making use of suitable error detection and
received. API needs parameters such as CNAME, SSRC of                      correction method, it is possible to transfer real time data on IP
participant, using such information internally participant list is         network using RTP protocol.
checked to ensure that its entry is already there or not, if not
then new entry gets created and initial values for that                                                 REFERENCES
participant are set.                                                         [1]   RFC 3551- http://rfc.net (Accessed on 20/08/06)
                                                                             [2]   RFC 3550, RFC 3551
7. RTP_RemoveParticipant ()                                                  [3]   Wikipedia, the free encyclopedia - http://.wikipedia.org (Accessed
                                                                                   on 10/08/06)
         Application can call this API when it wants to
                                                                             [4]   www.gnu.org (Accessed on 14/08/06)
remove particular participant from the participant list.
                                                                             [5]   Audio and Video for the Internet, -By Colin Perkins
Internally the entry for that participant gets deleted from
participant list.
                                                                     [6]           Mohammad Monirul Islam, is post graduated from London
8. RTP_SendRTCPReport ()                                                   Metropolitan University, London, UK. At present he is working as Lecturer
                                                                           in Daffodil International University, Dhaka, Bangladesh. His major area of
                                                                           interset is :Programming languages, Databases, Advance database, Data
       Application can use this API to send either Receiver                mining and data warehousing, Real time data transmission, Internet
Report or Sender Report packet of RTCP.API takes                           application.




                                                                     100                                  http://sites.google.com/site/ijcsis/
                                                                                                          ISSN 1947-5500