Click here to Skip to main content
15,306,886 members
Articles / Programming Languages / C#
Posted 31 Mar 2009


16 bookmarked

MOS Protocol Fundamentals

Rate me:
Please Sign up or sign in to vote.
4.52/5 (15 votes)
1 Apr 2009CPOL3 min read
MOS protocol from introduction to implementation

Table of Contents


My inspiration for writing this article is based on my experience. When I started working on MOS protocol, I found myself nowhere on the web. There was only one site (the official site for MOS protocol and perhaps the only one). I decided then that I would share my experience and thoughts once I implement this.

MOS Fundamentals 

What is MOS

MOS is a device capable of storing media objects. Media Object refers to Character Generator Objects: CGs, Still Store, Audio and Video.

What is MOS Protocol

MOS protocol is an XML-based protocol used to communicate between NCS (News Room Computer System) and MOS device.

Need of MOS Protocol

News Room Computer System automates that operation of News Room operation that includes script writing/editing to broadcast content. This process includes many devices and each device vendor has his set of protocol to talk to NCS.
The tremendous growth of media industry inspires broadcast industry to introduce a standard protocol for the communication between NRCS and MOS devices.

Exchange of Data between NCS and MOS Devices 

MOS Protocol allows Newsroom Computer Systems (NCS) and Media Object Servers (MOS) to exchange information using a standard protocol. This protocol enables the exchange of the following type of messages:

1. Descriptive Data for Media Objects  

The MOS "pushes" descriptive information and pointers to the NCS as objects are created, modified, or deleted in the MOS. This allows the NCS to be "aware" of the contents of the MOS and enables the NCS to perform searches on and manipulate the data the MOS has sent.

2. Playlist Exchange

The NCS can build and transfer playlist information to the MOS. This allows the NCS to control the sequence in which media objects are played or presented by the MOS.

3. Status Exchange  

The MOS can inform the NCS of the status of specific clips or the MOS system in general. The NCS can notify the MOS of the status of specific playlist items or running orders.


MOS Workflow 

Let me share the basic workflow of information exchange between NCS and MOS devices. NCS contain data in the form of Rundown objects (sometime called Runorder as well). A single Rundown can contain multiple stories and a single story can have multiple items. Each item corresponds to media objects, i.e. CGs, video file, audio file or still graphics.


NCS associate metadata to these items. Metadata information includes type, path, time to play and time length, etc.

Example: A Video Item Metadata

FileName: inauguration.mpeg
StartTime: 12:30:35 10-02-2009
Video Serve: MOSDEVICE 

NCS transform this metadata into MOS compliant XML and send it to MOS devices using TCP connection. In return, MOS devices send MOS XML responses to NCS.
A sample MOS XML message of the above metadata.

<storySlug>Show Open</storySlug>
<itemSlug>Hotel Fire vo</itemSlug>
<objID> inauguration</objID>
<itemEdStart>12:30:35 10-02-2009</itemEdStart>

MOS Implementation

Since MOS Protocol is an XML based protocol, its implementation is done in the standard way of XML data exchange. 

Basic Strategy

There are many MOS XML messages, e.g. <heartbeat>, <roCreate>, <roStorySend>, <roStoryMove>, etc. and for each message, we use the following strategy:

  1. Create a class that confirms one of the MOS XML message 
  2. Create object of that class and set its properties  
  3. Serialize that object to get the MOS XML message
  4. Convert MOS XML message into stream
  5. Send stream using TCP connection to MOS Device 

An Example using C# .NET 2.0  

We will create the <heartbeat> message and send it to MOS Device. <heartbeat> message is used to verify network and application continuity. 

  1. Create a MOS and heartbeat classes that confirms one of the MOS XML message:
    //<mos> message
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml;
    using System.Xml.Serialization;
    namespace mosprotocol
       public class cMOS
            string _mosID, _ncsID;
            long _messageID;
            cHeartBeat _heartbeat;
            public string mosID
                get {return _mosID; }
                set { _mosID = value; }
            public string ncsID
                get { return _ncsID; }
                set { _ncsID = value; }
            public long messageID
                get { return _messageID; }
                set { _messageID = value; }
           public cHeartBeat heartbeat
                get { return _heartbeat; }
                set { _heartbeat = value; }
    //heartbeat message
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml;
    using System.Xml.Serialization;
    namespace mosprotocol
        public class cHeartBeat
            DateTime _time;
            public DateTime time
                get { return _time; }
                set { _time = value; }
  2. Create object of mos and set its properties:
    HeartBeat heartbeat = new cHeartBeat();
    heartbeat.time = DateTime.Now;
    //create MOS message and set its heartbeat property
    cMOS mos = new cMOS();
    mos.messageID = 333;
    mos.mosID = "MOSDEVICEID";
    mos.ncsID = "NCSID";
    mos.heartbeat = heartbeat;      
  3. Serialize object into memory stream:
    //serialize MOS object
    MemoryStream ms = new MemoryStream();
    XmlSerializer xml = new XmlSerializer(typeof(cMOS));
    xml.Serialize(ms, mos);          
  4. Send the stream to MOS device over TCP connection:
    //create TCP connection with MOS device
    TcpClient mosClient = new TcpClient("", 10641);
    //write MOS object stream to MOS device



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Rizwan Qureshi
Chief Technology Officer Neuron Management Services
Canada Canada
No Biography provided

Comments and Discussions

QuestionSample Code! Pin
Member 999568816-Feb-18 3:28
MemberMember 999568816-Feb-18 3:28 
GeneralMy vote of 1 Pin
Member 1102269131-Aug-15 8:29
MemberMember 1102269131-Aug-15 8:29 
QuestionThanks Pin
domanz11119-May-12 1:30
Memberdomanz11119-May-12 1:30 
GeneralMy vote of 5 Pin
rameshmelam5-Jan-12 9:20
Memberrameshmelam5-Jan-12 9:20 
GeneralMy vote of 1 Pin
mxprml20-Oct-10 21:48
Membermxprml20-Oct-10 21:48 
QuestionSample code Pin
karak26-Apr-09 19:57
Memberkarak26-Apr-09 19:57 
AnswerRe: Sample code Pin
Rizwan Qureshi28-Apr-09 19:53
MemberRizwan Qureshi28-Apr-09 19:53 
GeneralRe: Sample code Pin
Member 999568824-May-19 7:38
MemberMember 999568824-May-19 7:38 
GeneralInteresting reading Pin
SrdjanMK1-Apr-09 6:44
MemberSrdjanMK1-Apr-09 6:44 
GeneralRe: Interesting reading Pin
Rizwan Qureshi1-Apr-09 6:57
MemberRizwan Qureshi1-Apr-09 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.