diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html | 377 |
1 files changed, 377 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html b/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html new file mode 100644 index 00000000000..ca4db983b3c --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html @@ -0,0 +1,377 @@ +<!$Id$> +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]"> +</head> +<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000"> + +<center> +<h1> +Implementing Pluggable Protocol in TAO AV Streaming Service</h1></center> + +<center> +<h4> +<a href="mailto:naga@cs.wustl.edu">Nagarajan Surendran </a>and <a href="mailto:yamuna@cs.wustl.edu">Yamuna +Krishnamurthy</a></h4></center> + +<center>Center for Distributed Object Computing +<br>Washington University in St.Louis</center> + +<hr WIDTH="100%"> +<h3> +Overview</h3> +Traditionally DOC Middleware has provided facilities to design application-level +objects at a higher level of abstraction, away from low-level details of +network programming and distribution. The aspect of multimedia application +that could benefit from this is an interoperable standard design of multimedia +interfaces defined in IDL. The OMG A/V Specification defines such a set +of interfaces which helps in type-safe ,robust and flexible applications. +Also as proved in our earlier work,ORBs with IIOP implementation cannot +be used for streaming multimedia data since they're optimized for request-response +semantics. To circumvent this the application developer will have to use +Out of Band data connection to stream the data while using the ORB to negotiate +QoS, bind type-safe devices and explore their properties. +<p>Also it is important for a Multimedia framework to have the ability +to support different transports and be able to plug and configure them +dynamically and statically .For example, a wireless link based application +may want to use the Wireless link protocol to stream the data. RTP is gaining +wide significance as the Transport protocol for streaming Audio and Video +Data over the Internet. Our framework provides an implementation of RTP/RTCP +for the audio/video profile. RTP is internet-centric and doesn't provide +facilities to transport IDL-defined flows. SFP is a Simple Flow Protocol +specified by the OMG for A/V Streaming and it can be mapped to different +transports like UDP, RTP and ATM AAL5. Our framework provides an implementation +of SFP that runs over UDP and multicast UDP. +<p>The OMG specification defines the flow specification syntax that is +to be used for the bind_devs calls for connection establishment. It defines +the protocol names and also the syntax for specifying the transport/flow +protocol information but it doesn't define any interfaces for the protocol +implementation as such. Our framework bridges this gap by defining a uniform +API for the different flow protocols like RTP and SFP while taking +care of the variations using a Policy interface. We solve this with our +Pluggable Protocol Framework using design patterns like Layer, +<br>Acceptor, Connector, Facade and Abstract Factory. Please look at this +<a href="http://www.cs.wustl.edu/~naga/pluggable_av.ps.gz">paper</a> +for more documentation on the TAO AV Service Pluggable Protocol Framework. +<p> +<hr WIDTH="100%"> +<h3> +Implementing the Pluggable Protocol</h3> +In order to add a new pluggable transport and flow protocol to the AVStreams +framework, without making changes to the framework itself, the pluggable +protocol must implement the following components of the Pluggable Protocol +framework: +<h4> +The Transport Protocol Components</h4> + +<h4> +<i>Acceptor and Connector: </i></h4> +These are implementations of the Acceptor and Connector design patterns. +In the case of connectionless protocols like UDP, calling accept and connect +will result in the creation of handlers immediately. +<p>The pluggable transport protocol implementation should inherit from +the following abstract classes declared in <a href="./Transport.h"><orbsvcs/orbsvcs/AV/Transport.h>:</a> +<p>/** +<br> * @class TAO_AV_Acceptor +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Acceptor +<br>{ +<br>public: +<br> TAO_AV_Acceptor (void); +<br> virtual ~TAO_AV_Acceptor (void); +<br> virtual int open (TAO_Base_StreamEndPoint *endpoint, +<br> +TAO_AV_Core *av_core, +<br> +TAO_FlowSpec_Entry *entry, +<br> +TAO_AV_Flow_Protocol_Factory *factory) = 0; +<p> virtual int open_default (TAO_Base_StreamEndPoint *endpoint, +<br> +TAO_AV_Core *av_core, +<br> +TAO_FlowSpec_Entry *entry, +<br> +TAO_AV_Flow_Protocol_Factory *factory) = 0; +<p> const char *flowname (); +<br> virtual int close (void) = 0; +<br>protected: +<br> ACE_CString flowname_; +<br> TAO_AV_Core *av_core_; +<br> ACE_Addr *address_; +<br>}; +<br> +<p>/** +<br> * @class TAO_AV_Connector +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Connector +<br>{ +<br>public: +<br> TAO_AV_Connector (void); +<br> virtual ~TAO_AV_Connector (void); +<br> const char *flowname (void); +<p> virtual int open (TAO_Base_StreamEndPoint *endpoint, +<br> +TAO_AV_Core *av_core, +<br> +TAO_AV_Flow_Protocol_Factory *factory) = 0; +<p> virtual int connect (TAO_FlowSpec_Entry *entry, +<br> +TAO_AV_Transport *&transport) = 0; +<p> virtual int close (void) = 0; +<br>protected: +<br> ACE_CString flowname_; +<br>}; +<br> +<br> +<h4> +<i>Transport and Transport Factory:</i></h4> +The transport class provides a common interface for different protocols +for performing operations like open, close, send and recv. The trasnport +factory is an interface for creating acceptors and connectors. +<p>The pluggable transport protocol implementation should inherit from +the following abstract classes declared in <a href="./Transport.h"> +<orbsvcs/orbsvcs/AV/Transport.h>:</a><i></i> +<p>/** +<br> * @class TAO_AV_Transport +<br> * @brief A Base class for the different transport protocols. +<br> * All the different +transports should derive and implement +<br> * the open,close,send +and recv methods. +<br> */ +<br>class TAO_AV_Export TAO_AV_Transport +<br>{ +<br>public: +<br> TAO_AV_Transport (void); +<p> virtual ~TAO_AV_Transport (void); +<p> virtual int open (ACE_Addr *address) = 0; +<p> virtual int close (void) = 0; +<p> virtual int mtu (void) = 0; +<br> virtual ACE_Addr *get_peer_addr (void) = 0; +<br> virtual ACE_Addr *get_local_addr (void); +<p> virtual ssize_t send (const ACE_Message_Block *mblk, +<br> +ACE_Time_Value *s = 0) = 0; +<p> /// Write the contents of the buffer of length len to the connection. +<br> virtual ssize_t send (const char *buf, +<br> +size_t len, +<br> +ACE_Time_Value *s = 0) = 0; +<p> /// Write the contents of iovcnt iovec's to the connection. +<br> virtual ssize_t send (const iovec *iov, +<br> +int iovcnt, +<br> +ACE_Time_Value *s = 0) = 0; +<p> /// Read len bytes from into buf. +<br> virtual ssize_t recv (char *buf, +<br> +size_t len, +<br> +ACE_Time_Value *s = 0) = 0; +<p> /// Read len bytes from into buf using flags. +<br> virtual ssize_t recv (char *buf, +<br> +size_t len, +<br> +int flags, +<br> +ACE_Time_Value *s = 0) = 0; +<p> /// Read received data into the iovec buffers. +<br> virtual ssize_t recv (iovec *iov, +<br> +int iovcnt, +<br> +ACE_Time_Value *s = 0) = 0; +<p>}; +<br> +<p>/** +<br> * @class TAO_AV_Transport_Factory +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Transport_Factory : public ACE_Service_Object +<br>{ +<br>public: +<br> /// Initialization hook. +<br> TAO_AV_Transport_Factory (void); +<br> virtual ~TAO_AV_Transport_Factory (void); +<br> virtual int init (int argc, char *argv[]); +<br> virtual int match_protocol (const char *protocol_string); +<br> virtual TAO_AV_Acceptor *make_acceptor (void); +<br> virtual TAO_AV_Connector *make_connector (void); +<br>}; +<br> +<h4> +<i>Flow handler :</i></h4> +All the transport handlers derive from the TAO_AV_Flow_Handler which +has methods to start and stop and provide flow specific functionality for +timeout upcalls to the Callbacks. +<p>The pluggable transport protocol implementation should inherit from +the following abstract class declared in<a href="./Transport.h"> +<orbsvcs/orbsvcs/AV/Transport.h>:</a> +<p>/** +<br> * @class TAO_AV_Flow_Handler +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Flow_Handler +<br>{ +<br>public: +<br> /// Constructor. +<br> TAO_AV_Flow_Handler (void); +<p> /// Start/stop the flow handler. +<br> virtual int start (TAO_FlowSpec_Entry::Role role); +<br> virtual int stop (TAO_FlowSpec_Entry::Role role); +<p> /// Schedule timer. Uses the get_timeout method on the callback. +<br> virtual int schedule_timer (void); +<p> /// get the transport. +<br> TAO_AV_Transport *transport (void); +<p> /// set/get protocol_object. +<br> TAO_AV_Protocol_Object* protocol_object (void); +<br> void protocol_object (TAO_AV_Protocol_Object *protocol_object); +<p> /// set the callback. +<br> void callback (TAO_AV_Callback *callback); +<p> /// Handle timeout. called from reactor. +<br> int handle_timeout (const ACE_Time_Value &tv, const void +*arg = 0); +<p> /// set the remote address. +<br> virtual int set_remote_address (ACE_Addr *address); +<p> /// get the underlying event handler. To be overridden by the +derived clases. +<br> virtual ACE_Event_Handler* event_handler (void) = 0; +<p> virtual int change_qos (AVStreams::QoS); +<p>protected: +<br> TAO_AV_Transport *transport_; +<br> TAO_AV_Callback *callback_; +<br> TAO_AV_Protocol_Object *protocol_object_; +<br> long timer_id_; +<br> ACE_Reactor *reactor_; +<br> void *timeout_arg_; +<br>}; +<br> +<h3> +The Flow Protocol Components</h3> + +<h4> +<i>Flow Protocol Factory:</i></h4> +The flow protocol factory is an interface for creating flow protocol +objects. +<p>The pluggable flow protocol implementation should inherit from the following +abstract class declared in <a href="./Protocol_Factory.h"><orbsvcs/orbsvcs/AV/Protocol_Factory>:</a> +<p>/** +<br> * @class TAO_AV_Flow_Protocol_Factory +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Flow_Protocol_Factory : public ACE_Service_Object +<br>{ +<br>public: +<br> /// Initialization hook. +<br> TAO_AV_Flow_Protocol_Factory (void); +<br> virtual ~TAO_AV_Flow_Protocol_Factory (void); +<br> virtual int init (int argc, char *argv[]); +<br> virtual int match_protocol (const char *flow_string); +<br> virtual TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry +*entry, +<br> +TAO_Base_StreamEndPoint *endpoint, +<br> +TAO_AV_Flow_Handler *handler, +<br> +TAO_AV_Transport *transport); +<br> virtual const char *control_flow_factory (void); +<br>}; +<br> +<h4> +<i>Protocol Object:</i></h4> +This is a concrete implementation providing the flow protocol functionality. +Applications use this interface to send frames and the Protocol_Object +uses application specified Callback objects to deliver frames. +<p>The pluggable flow protocol implementation should inherit from the following +abstract class declared in <a href="./Protocol_Factory.h"><orbsvcs/orbsvcs/AV/Protocol_Factory>:</a> +<p>/** +<br> * @class TAO_AV_Protocol_Object +<br> * @brief +<br> */ +<br>class TAO_AV_Export TAO_AV_Protocol_Object +<br>{ +<br>public: +<br> TAO_AV_Protocol_Object (void); +<p> /// constructor. +<br> TAO_AV_Protocol_Object (TAO_AV_Callback *callback, +<br> +TAO_AV_Transport *transport); +<p> /// Destructor +<br> virtual ~TAO_AV_Protocol_Object (void); +<p> virtual int open (TAO_AV_Callback *callback, +<br> +TAO_AV_Transport *transport); +<p> virtual int handle_input (void) = 0; +<p> /// Called on a control object. +<br> virtual int handle_control_input (ACE_Message_Block *control_frame, +<br> +const ACE_Addr &peer_address); +<p> /// set/get policies. +<br> virtual int set_policies (const TAO_AV_PolicyList &policy_list); +<br> virtual TAO_AV_PolicyList get_policies (void); +<p> /// start/stop the flow. +<br> virtual int start (void); +<br> virtual int stop (void); +<p> /// send a data frame. +<br> virtual int send_frame (ACE_Message_Block *frame, +<br> +TAO_AV_frame_info *frame_info = 0) = 0; +<p> /// send a frame in iovecs. +<br> virtual int send_frame (const iovec *iov, +<br> +int iovcnt, +<br> +TAO_AV_frame_info *frame_info = 0) = 0; +<p> virtual int send_frame (const char *buf, +<br> +size_t len) = 0; +<p> /// end the stream. +<br> virtual void control_object (TAO_AV_Protocol_Object *object); +<br> virtual int destroy (void) = 0; +<br> TAO_AV_Transport *transport (void); +<br>protected: +<br> TAO_AV_Transport *transport_; +<br> TAO_AV_PolicyList policy_list_; +<br> TAO_AV_Callback *callback_; +<br>}; +<p>For an example of how all the above components are implemented refer +to the implementation of the UDP transport <a href="./UDP.h"><orbsvcs/orbsvcs/AV/UDP.h> </a> +and <a href="./UDP.cpp"><orbsvcs/orbsvcs/AV/UDP.cpp></a> +<p> +<hr WIDTH="100%"> +<h3> +Using a Pluggable Protocol</h3> +Once the TAO AV pluggable transport and flow protocols are implemented +they can be loaded into the AV Streams framework by adding their entries +to the Service Configurator file (eg. svc.conf) for that protocol: +<p>A typical svc.conf will look like this: +<p>dynamic TAO_AV_Resource_Factory Service_Object * TAO_AV:_make_TAO_AV_Resource_Factory() +"" +<br>dynamic ATM_Factory Service_Object * TAO_AV:_make_TAO_AV_ATM_Factory() +"" +<br>static TAO_AV_Resource_Factory "-AVTransportFactory ATM_Factory" +<br>dynamic SFP_Factory Service_Object * TAO_AV:_make_TAO_AV_SFP_Factory() +"" +<br>static TAO_AV_Resource_Factory "-AVFlowProtocolFactory SFP_Factory" +<p>The TAO_AV_Resource_Factory is a the default resource factory that helps +to load the different transport and flow protocols to the corresponding +factory sets. +<p><b><i>NOTE: The TAO_AV_Resource_Factory must be loaded in order to load +the pluggable protocols, ie. the first statement shown above is mandatory +to load the protocols.</i></b><b><i></i></b> +<p>The above entries show how to add a transport factory eg. ATM Factory +and a flow protocol factory eg. SFP Factory. The -AVTransportFactory +option causes the specified transport protocol factory to be loaded into +the AV Core and the -AVFlowProtocolFactory option causes the specified +flow protocol factory to be loaded into the AV Core. +</body> +</html> |