<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- A set of on-line citation libraries are maintained on the xml2rfc web site.
     The next line defines an entity named RFC2629, which contains the necessary XML
     for the reference element, and is used much later in the file.  This XML contains an
     anchor (also RFC2629) which can be used to cross-reference this item in the text.
     You can also use local file names instead of a URI.  The environment variable
     XML_LIBRARY provides a search path of directories to look at to locate a 
     relative path name for the file. There has to be one entity for each item to be
     referenced. -->
<!ENTITY RFC2234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2234.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC4234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4234.xml">
<!-- There is also a library of current Internet Draft citations.  It isn't a good idea to
     actually use one for the template because it might have disappeared when you come to test 
     this template.  This is the form of the entity definition
     &lt;!ENTITY I-D.mrose-writing-rfcs SYSTEM 
     "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.mrose-writing-rfcs.xml">
     corresponding to a draft filename draft-mrose-writing-rfcs-nn.txt. The citation will be
     to the most recent draft in the sequence, and is updated roughly hourly on the web site.
     For working group drafts, the same principle applies: file name starts draft-ietf-wgname-..
     and entity file is reference.I-D.ietf-wgname-...  The corresponding entity name is 
     I-D.ietf-wgname-... (I-D.mrose-writing-rfcs for the other example).  Of course this doesn't
     change when the draft version changes.
     -->
<!-- Fudge for XMLmind which doesn't have this built in -->
<!ENTITY nbsp    "&#160;">
]>

<!-- Extra statement used by XSLT processors to control the output style. -->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>


<!-- Processing Instructions can be placed here but if you are editing 
     with XMLmind (and maybe other XML editors) they are better placed
     after the rfc element start tag as shown below. -->
     
<!-- Information about the document.
     category values: std, bcp, info, exp, and historic
     For Internet-Drafts, specify attribute "ipr".
     (ipr values are: full3667, noModification3667, noDerivatives3667),
     Also for Internet-Drafts, can specify values for
     attributes "docName" and, if relevant, "iprExtract".  Note
     that the value for iprExtract is the anchor attribute
     value of a section (such as a MIB specification) that can be 
     extracted for separate publication, and is only
     useful whenhe value of "ipr" is not "full3667". -->
    <!-- TODO: verify which attributes are specified only
               by the RFC editor.  It appears that attributes
               "number", "obsoletes", "updates", and "seriesNo"
               are specified by the RFC editor (and not by
               the document author). -->
<rfc
    category="std"
    ipr="trust200902"
    docName="draft-liu-webrtc-http-interactive-protocol-00">
    <!-- Processing Instructions- PIs (for a complete list and description,
          see file http://xml.resource.org/authoring/README.html and below... -->

    <!-- Some of the more generally applicable PIs that most I-Ds might want to use -->
    
    <!-- Try to enforce the ID-nits conventions and DTD validity -->
    <?rfc strict="yes" ?>

    <!-- Items used when reviewing the document -->
    <?rfc comments="no" ?>  <!-- Controls display of <cref> elements -->
    <?rfc inline="no" ?>    <!-- When no, put comments at end in comments section,
                                 otherwise, put inline -->
    <?rfc editing="no" ?>   <!-- When yes, insert editing marks: editing marks consist of a 
                                 string such as <29> printed in the blank line at the 
                                 beginning of each paragraph of text. -->

    <!-- Create Table of Contents (ToC) and set some options for it.  
         Note the ToC may be omitted for very short documents,but idnits insists on a ToC 
         if the document has more than 15 pages. --> 
   <?rfc toc="yes"?>
   <?rfc tocompact="yes"?> <!-- If "yes" eliminates blank lines before main section entries. -->
   <?rfc tocdepth="3"?>    <!-- Sets the number of levels of sections/subsections... in ToC --> 

    <!-- Choose the options for the references. 
         Some like symbolic tags in the references (and citations) and others prefer 
         numbers. The RFC Editor always uses symbolic tags.
         The tags used are the anchor attributes of the references. --> 
    <?rfc symrefs="no"?>
    <?rfc sortrefs="yes" ?> <!-- If "yes", causes the references to be sorted in order of tags.
                                 This doesn't have any effect unless symrefs is "yes" also. -->

    <!-- These two save paper: Just setting compact to "yes" makes savings by not starting each 
         main section on a new page but does not omit the blank lines between list items. 
         If subcompact is also "yes" the blank lines between list items are also omitted. -->
    <?rfc compact="yes" ?>
    <?rfc subcompact="no" ?>
    <!-- end of list of popular I-D processing instructions -->

    <!-- ***** FRONT MATTER ***** -->
<front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 42 characters -->
    <title abbrev="Protocol for interactive low-latency media transmission system">WebRTC-HTTP Interactive Signaling Protocol(WHISP)</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->
    <author
        fullname="Dapeng(Max) Liu" 
        initials="D." 
        surname="Liu">

        <!-- abbrev not needed but can be used for the header
             if the full organization name is too long -->
        <organization abbrev="Alibaba Group">Alibaba Group</organization>
        <address>
            <postal>
                <!-- I've omitted my street address here -->
                <street/>
                <city></city>
                <!--
                    The IETF seems to meet once a year in Minneapolis,
                    so that's practically my US address. If so, I would
                    add the following elements:
                <region>MN</region>
                <code>55403</code>
                However, if I lived in France, the <code> comes before the city.  xml2rfc
                preserves the order of <city>, <region>, <code> and <country> elements in 
                output so that they can reflect any possible the national scheme
                -->
                <!-- The country element is supposed to contain an ISO3166 two letter country
                     code. -->
                <country></country>
            </postal>
        <email>max.ldp@alibaba-inc.com</email>
        <!--
            If I had a phone, fax machine, and a URI, I could add the following:
                <phone>+1-408-555-1234</phone>
                <facsimile>+1-555-911-9111</facsimile>
                <uri>http://www.example.com/</uri>
            -->
        </address>
    </author>


     <author
        fullname="Yaming He" 
        initials="Y." 
        surname="He">

        <!-- abbrev not needed but can be used for the header
             if the full organization name is too long -->
        <organization abbrev="Alibaba Group">Alibaba Group</organization>
        <address>
            <postal>
                <!-- I've omitted my street address here -->
                <street/>
                <city></city>
                <!--
                    The IETF seems to meet once a year in Minneapolis,
                    so that's practically my US address. If so, I would
                    add the following elements:
                <region>MN</region>
                <code>55403</code>
                However, if I lived in France, the <code> comes before the city.  xml2rfc
                preserves the order of <city>, <region>, <code> and <country> elements in 
                output so that they can reflect any possible the national scheme
                -->
                <!-- The country element is supposed to contain an ISO3166 two letter country
                     code. -->
                <country></country>
            </postal>
        <email>heyaming.hym@alibaba-inc.com</email>
        <!--
            If I had a phone, fax machine, and a URI, I could add the following:
                <phone>+1-408-555-1234</phone>
                <facsimile>+1-555-911-9111</facsimile>
                <uri>http://www.example.com/</uri>
            -->
        </address>
    </author>
    
    <!-- Another author who claims to be an editor -->
    <author fullname="Xiaobo Yu" 
            initials="X." 
            surname="Yu">
      <organization>Alibaba Group</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country></country>
        </postal>

        <phone></phone>

        <facsimile></facsimile>

        <email>shibo.yxb@alibaba-inc.com</email>
        
      </address>
         </author>
      
                  <!-- Another author who claims to be an editor -->
    <author fullname="Xiao Kai" 
            initials="X." 
            surname="Kai">
      <organization>Alibaba Group</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country></country>
        </postal>

        <phone></phone>

        <facsimile></facsimile>

        <email>xiaokaikai.xk@alibaba-inc.com</email>
        
        <uri></uri>
        </address>
                      
    </author>
    
                      <!-- Another author who claims to be an editor -->
    <author fullname="Songlin Li" 
            initials="S." 
            surname="Li">
      <organization>Alibaba Group</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country></country>
        </postal>

        <phone></phone>

        <facsimile></facsimile>

        <email>songlin.lsl@alibaba-inc.com</email>
        
        <uri></uri>
        </address>
                      
    </author>    

    <date year="2023" month="July"/> <!-- month="March" is no longer necessary
                                           note also, day="30" is optional -->
    <!-- WARNING: If the month and year are the current ones, xml2rfc will fill in the day for 
         you. If only the year is specified, xml2rfc will fill in the current day and month 
         irrespective of the day.  This silliness should be fixed in v1.31. -->
         
    <!-- Meta-data Declarations -->
    
    <!-- Notice the use of &amp; as an escape for & which would otherwise
         start an entity declaration, whereas we want a literal &. -->
    <area>ART</area>

    <!-- WG name at the upperleft corner of the doc,
         IETF fine for individual submissions.  You can also
         omit this element in which case in defaults to "Network Working Group" -
         a hangover from the ancient history of the IETF! -->
    <workgroup> </workgroup>
    
    <!-- The DTD allows multiple area and workgroup elements but only the first one has any
         effect on output.  -->
    <!-- You can add <keyword/> elements here.  They will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff output. -->
    
    
    <abstract>
        <t>
            This document introduces a protocol used for allowing WebRTC-based pull, merge and switch of content supported by media transmission network.
        </t>
    </abstract>

    <note title="Requirements Language">
        <t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;,
        &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
        &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
        &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be
        interpreted as described in <xref target="RFC2119">RFC 2119</xref>.
        </t>
    </note>

</front>

<middle>
    <section title="Introduction">
        <t> 
          Emerging real-time interactive video/audio communication applications bring new challenges for existing protocols.
          This documents introduces the use cases, requirements and protocol for WebRTC-HTTP interactive low-latency multimedia 
          transmission network over the Internet.
        </t>

        <t>
            Interactive real-time media communication is getting popular with the rapid growth of short video, on-line education, on-line gaming and other similar applications.
            Some application providers build their own interactive real-time media communication network to support their applications yet facing high costs and technical issues.
            For example, interactive communication between users is unpredictable, which results in high costs when dedicated entity for interaction is used and the wastage of reserved resources for interaction. 

        </t>

        <t>   
            To avoid the aforementioned issues and challenges, some other application providers attempt to use third party's interactive real-time media communication network 
            provided by cloud operators. However, there are several challenges of existing protocol to support the above mentioned scenarios.

        </t>

        <t>    
            1. Interactive online broadcasting service is flexible and much more complicated compared with traditional media broadcasting service. 
            For interactive online broadcasting applications, audiences may occasionally request to setup bidirectional real-time communication with
             the broadcaster and all the other audiences are expected to be able to receive the merged interactive media traffic containing the 
             broadcaster and connected audience. To meet this end, there is a need for standardized
            signaling protocol which can support media stream merging，switching and pulling to support those complicated scenarios.
        </t>

        <t>
            2. Applications such as interactive online broadcasting, short video, on-line education, on-line gaming are very delay sensitive. Thus, the protocols for media stream merging，
            switching and pulling are expected to be able to meet the latency requirement for those applications.
        </t>

        <t>
            3. Nowadays, WebRTC is widely used in the multimedia ecosystem. The protocols for media stream merging，switching
            and pulling are expected to be able to compatible with WebRTC in order to deliver interactive media services to customers. 
        </t>

      
    </section>

    <section title="System Architecture">
        

        <t>
            This section specifies the system architecture of the Interactive real-time media communication system.

        </t>

        <t>

            <figure title="Architecture" anchor="architecture"><artwork><![CDATA[
                                                   
                                        Sever for media streaming control
                                                +-----------+
                                                |           |
                                                |           |
                                                |           |
                                                |           |
                                                |           |
                                                +-----+-----+                        +-----+
   +-----+                                            |                              |     |
   |     |                                            |                              |     |
   |     |                                            |                              |     |
   |     |<------+                                    |                     +------->|     |
   |     |       |                +-----------------v------------------+    |        |     |
   |     |       |                |                                    |    |        +-----+
   +-----+       |                |                                    |    |       Audience
  Broadcaster    |                |                                    +----+        +-----+
                 +--------------->|                                    |             |     |
                                  |                                    |             |     |
                                  |    WHISP communication network     +------------>|     |
   +-----+       +--------------->|                                    |             |     |
   |     |       |                |                                    |             |     |
   |     |       |                |                                    +----+        +-----+
   |     |<------+                |                                    |    |        Audience
   |     |                        |                                    |    |        +-----+
   |     |                        +-------------^-----+----------------+    |        |     |
   +-----+                                      |     |                     |        |     |
  Audience                                      |     |                     +------->|     |
connected with                                  |     |                              |     |
 the broadcaster                              +-+-----v--+                           |     |
                                              |          |                           +-----+
                                              |          |                           Audience
                                              |          |
                                              |          |
                                              |          |
                                              +----------+
                                    Server for media stream merging


]]></artwork></figure>
</t>
<t>The WHISP communication network can be provided by cloud providers. The communication network can provide fundamental capabilities of media stream, including media pulling. In addition, the network can also support capabilities such as media merging and media switching. The capabilities can be triggered by control server and server for media streaming merging, which can be provided by 3rd party. Based on those capabilities, the audience can receive corresponding media from broadcaster or merged media between broadcaster and requested audience for interaction seamlessly.</t>

    </section>
    
    
    <section title="Protocol Operation">
	    <!--
	    <t>
	    In order to set up a pulling, merging and switching session, a SDP exchange is needed in order to negotiate the protocol capabilties between a WHISP client and the WHISP server. The exchange is triggered by the WHISP client which sends the HTTP POST request to the WHISP server.
	    </t>
	    
	    <t>
	     The content type of the HTTP POST request is "application/json" and the request also contains the SDP offer. Upon the receipt of the SDP offer, 
	     WHISP server replies with a SDP answer together with a 
	    "201 Created" response with the same content type of "application/json".
	    </t>
		    
	    <t>
	    For pulling session, the SDP offer <bcp14>SHOULD</bcp14> use the "recvonly" attribute and the SDP answer <bcp14>SHOULD</bcp14> use the "sendonly" attribute. For merging session, the SDP
	    offer <bcp14>SHOULD</bcp14> use the "sendrecv" attribute and the SDP answer <bcp14>SHOULD</bcp14> use the "sendrecv" attribute. For switching session, the SDP offer <bcp14>SHOULD</bcp14>
	    use the "inactive" attribute and the SDP answer <bcp14>SHOULD</bcp14> use the "sendonly" attribute.	    
	    </t>
	    -->
		    	    
	    
    </section>

    <section title="Overview">
        <t>
            This section defines the signaling procedure of WHISP communication network. 
        </t>
      
      <!--
        <t>  
            The WHISP session setup and teardown procedure is similar with WHIP. The WebRTC-HTTP Interactive Signaling Protocol (WHISP) uses an HTTP POST request to implement SDP offer/answer, 
            which can ensure the establishment of ICE/DTLS session between the encoder/media producer (WHIP client) and the broadcasting interactive endpoint (Media server) which support media streaming pulling, merging and switching.
        </t>
        
        
        <t>
	        In the case of pulling, once the session is set up, the media will flow unidirectionally from the WHISP  to the WHISP . 
	    </t>
	       
	    <t> 
		    In the case of merging, WHISP client is the server for media stream merging, and the WHISP client requests for media pulling and obtains the media to be merged from the
		    broadcaster and the target client. The WHISP client then performs the media merging and ingests the merged media to the broadcasting interactive endpoint. 
        </t>
        
        <t>
	        In the case of switching, WHISP client is the server for media streaming control. The WHISP client requests for media switching. Upon the receipt of the request, the media server 
	        ingests the merged media to the broadcaster and the target customers. 
	    </t>
	     -->        
	   <t>

            <figure title="Procedure" anchor="procedure"><artwork><![CDATA[


                            Audience                                                                     Interactive real-time
                            connected with                                        Server for media         media communication
Broadcaster                the broadcaster               Control Server            stream merging                network                    Audience
+--------------+            +--------------+            +--------------+           +--------------+          +--------------+           +--------------+
|              |            |              |            |              |           |              |          |              |           |              |
|              |            |              |            |              |           |              |          |              |           |              |
|              |            |              |            |              |           |              |          |              |           |              |
|              |            |              |            |              |           |              |          |              |           |              |
+------+-------+            +-------+------+            +-------+------+           +------+-------+          +-------+------+           +------+-------+
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |       push media stream   |                            |                          |                         |
    +----------------------------+---------------------------+-------------------------+---------------------------->|                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |     pull media stream   |
    |                            |                           |                            |                          |<------------------------+
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |      push media stream     |                          |                         |
    |                            +---------------------------+----------------------------+------------------------->|                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |    pull media stream       |                           |                            |                          |                         |
    +----------------------------+---------------------------+----------------------------+------------------------->|                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |                          |                         |
    |                            |     pull media stream     |                            |                          |                         |
    |                            +---------------------------+----------------------------+------------------------->|                         |
    |                            |                           |                            |                          |                         |
    |                            |                           | Command for stream merging |                          |                         |
    |                            |                           +--------------------------->| pull stream for merging  |                         |
    |                            |                           |                            +------------------------->|                         |
    |                            |                           |                            |                          |                         |
    |                            |                           |                            |  push merged stream      |                         |
    |                            |                           |                            +------------------------->|                         |
    |                            |                           |Command for stream switching|                          |                         |
    |                            |                           +----------------------------+------------------------->|                         |
    |                            |                           |                            |                          +--+                      |
    |                            |                           |                            |                          |  |                      |
    |                            |                           |                            |                          |<-+                      |
    |                            |                           |                            |                          |Perform stream switch    |
    |                            |                           |                            |                          |                         |


]]></artwork></figure>
</t>
             
        <t>    
             Figure 2 shows the signaling
              procedure of Interactive real-time media communication among broadcaster, requested audience for interaction 
            and other audiences. HTTP POST is used for the signaling in the aforementioned procedure. The broadcaster and audience firstly ingest their media streams to the interactive real-time media communications
             network. A audience wishes to interact with the broadcaster and thus sends a request to the control server for interaction.
             The control server processes the request and sends command for media merging to the server for media stream merging. 
             Upon the receipt of merging request from control server, the server for media stream merging pulls the corresponding streams from both the 
             broadcaster and the requested audience for interaction and processes with the media merging.
        </t>
        
        <t>
             After the completion of media merging, the server for media stream merging ingests the merged media to the Interactive
             real-time media communication network which then sends the merged media to corresponding edge media distribution servers which connect
             the audiences who consume the media. After the distribution, the control server sends the command for media switching to the Interactive real-time media communication network.
              The network then forwards the switching signaling message to the edge node. Up the receipt of the signaling message, the edge node
              performs the media switching by ingesting the merged media to the audiences.
        </t>
        
        
</section>


<section title="Signaling Specification">
  <t>This section defines the signaling specification for the interactive real time media communication. In order to achieve the merging and switching functionalities for different media source,
signaling messages need to be delivered to the corresponding entities (e.g. control server, edge node, etc) in order to perform the proper operations. All the messages below are transmitted using HTTP POST.
The signaling message of interactive media control protocol is shown as follows:</t>
         
<figure title="Interactive media signaling message" anchor="Interactive media signaling message"><artwork><![CDATA[
Interactive Media Control Message {
  Message Type (i),
  Message Length (i),
  Message Payload (..),
}
]]></artwork></figure>  

<t>To process with the signaling message, the corresponding entities need to identify the type of signaling message. This can be achieved via using message type which can be carried by the message header. The message types of Interactive media control protocol can be described as follows:</t> 

 <texttable title="Message types of Interactive media control protocol">
      <ttcol align='right'>ID</ttcol>
      <ttcol align='left'>Messages</ttcol>
      <c>0x0</c>
      <c>Merging</c>
      <c>0x1</c>
      <c>Switching</c>
      <c>0x2</c>
      <c>Pulling</c>
      <c>0x3</c>
      <c>Grabbing</c>
      </texttable>

<t>The message length indicates the total length of the message payload filed in bytes. Message payload contains the information
for controlling media merging and media switching. The subsequent sub-section describes these two message types and related payload in detail.</t>
     
	      
	     <!--  <xref target="message-object"/> ... -->   
         <!--         
        <t>
            TODO: 

                <t>1、信令格式：JSON还是TLV  </t>
                <t>2、具体的信令类型还有哪些；除了切流是否还有其他的</t>
                <t>3、参数的具体内容:流的标识的具体格式? HTTP的话是否要有一个header来区分什么是流控的包，否则如果只是应用层区分（例如port）不是标准的写法≠</t>
                <t>4、安全机制</t>
                <t>5、传输层或应用层承载协议</t>
        </t>
                -->

<section title="Merging signaling message">    
	
<t>Merging signaling message is used to request the server for media stream merging to perform media merging between a broadcaster and an audience.
The merging signaling message is shown as follows:</t>

<figure title="Merging signaling message" anchor="Merging signaling message"><artwork><![CDATA[
Merging Message: 
{

 POST /whisp/merging/endpoint HTTP/1.1
 Host: whisp.example.com
 Content-Type: application/json
 Content-Length:
 {

 "main media": {
    "media ID":[
      "amsid":[
        "rts audio"
      ],
      "vmsid":[
        "rts video"
      ]
    
    ],
    "URL":"http://demo.example.com/liveapp****/liveStream****1",
 }
 
 "secondary media": {
    "media ID":[
      "amsid":[
        "rts audio"
      ],
      "vmsid":[
        "rts video"
      ]
    
    ],
    "URL":"http://demo.example.com/liveapp****/liveStream****2",
  } 
  
  "merge template": {
    "merge template id"[
       "01"
    ]
  }
 }
}
]]></artwork></figure>
<t>The payload type field "/whisp/merging/endpoint" in the header indicates the merging signaling message. Main media decides the media-related parameters (such as video format) of the merged media and the secondary media needs to comply with the parameters when conducting merging. Merge template decides the video layout of the merged media when merging main media and secondary media. The merge template id represents the id of the merge template. Media ID
represents the ID of an media. Amsid and vmsid stand for audio stream id and video stream id, respectively. The ID is comprised of a string which
represents the unique ID of an media source and the format of media ID follows the definition in <xref target="RFC8830">RFC 8830</xref>. The media URL represents the address of edge node which interacts with the audience and format of URL follows the definition in <xref target="RFC3986">RFC 3986</xref>.</t>           
</section>
        
<section title="Switching signaling message">

<t>Switching signaling message is used to instruct the Interactive real-time media communication system to perform media switching
upon the receipt of the request from the control server. The switching signaling message is shown as follows:</t>
		 
<figure title="Switching signaling message" anchor="Switching signaling message"><artwork><![CDATA[
Switching Message:
{

 POST /whisp/switching/endpoint HTTP/1.1
 Host: whisp.example.com
 Content-Type: application/json
 Content-Length:
 {
 
  "source media": {
    "media ID":[
      "amsid":[
        "rts audio"
      ],
      "vmsid":[
        "rts video"
      ]
    
    ],
    "URL":"http://demo.example.com/liveapp****/liveStream****1",
 } 
 
  
  "destination media": {
    "media ID":[
      "amsid":[
        "rts audio"
      ],
      "vmsid":[
        "rts video"
      ]
    
    ],
    "URL":"http://demo.example.com/liveapp****/liveStream****2",
  }  
 }
}
]]></artwork></figure>

<t>The payload type field "/whisp/switching/endpoint" in the header indicates the switching signaling message. Source media contains the information regarding source media from the broadcaster. 
Destination media contains the information regarding destination media which is the merged media between the broadcaster and the requested audience for interaction. 
Each media contains the media ID, media URL.
</t>

<t>The switch signaling message is sent to the edge node which manages the media delivery for the audience. If the edge node acknowledges the media switching, it re-directs 
the media content with the destination media using WebRTC protocol. Upon the receipt of the switching signaling message, the media transmission 
protocol decides time-stamp, information regarding I-frame, and optionally the sequence number to achieve the re-direction of the new merged media. 
This is to make sure that the audience can smoothly switch to the merged media without the negative impact on user experience.
</t>
         	  
</section>


<section title="Grabbing signaling message">


<t>Grabbing signaling message is used to instruct the Interactive real-time media communication system to switch edge node for audience, for example, in mobility scenario. In the mobility case, the Interactive real-time media communication system may decide to switch a more suitable edge node for media ingestion for an audience according the location information. The grabbing signaling message is shown as follows:</t>

<figure title="Grabbing signaling message" anchor="Grabbing signaling message"><artwork><![CDATA[
Grabbing Message:
{
 
 POST /whisp/grabbing/endpoint HTTP/1.1
 Host: whisp.example.com
 Content-Type: application/json
 Content-Length:
 {

  
  "new media": {
    "media ID":[
      "amsid":[
        "rts audio"
      ],
      "vmsid":[
        "rts video"
      ]
    
    ],
    "URL":"http://demo.example.com/liveapp****/liveStream****",
  }  
 error_code,
 }
}
]]></artwork></figure>

<t>The grabbing signaling message is sent from Interactive real-time media communication system to the edge node. A new edge node firstly starts ingesting media to the audience. Meanwhile, it registers the service to the Interactive real-time media communication system. The system detects that the media ingesting service already exists and thus sends the grabbing signaling message to the old edge node. For the old edge node, the grabbing signaling message is used to instruct the node to drop the media ingestion to the audience. The error code indicates the reason for dropping. The reasons are shown below:
</t>

 <texttable title="Error code for grabbing signaling message">
      <ttcol align='right'>Reason</ttcol>
      <ttcol align='left'>Code</ttcol>
      <c>0x0</c>
      <c>Dropped by Mobility</c>
      <c>0x1</c>
      <c>Proactive dropping</c>
      <c>0x2</c>
      <c>Passive dropping</c>      
</texttable>


<t>Dropped by Mobility indicates the case where a new edge node has taken place and ingests the media to the audience instead of the old edge node. Proactive dropping indicates the case where an edge node gets issues on the media ingestion and the audience can request for re-connection for the delivery of the media. Passive dropping indicates the case where the corresponding media has been banned and thus can not be ingested anymore.
</t>
	
</section>


<section title="Pulling signaling message">
	
<t>Pulling signaling message is sent from audience to the edge node. Once the pulling signaling message is acknowledged, the edge node sends the corresponding media to the audience. The pulling signaling message is shown below:
</t>

<figure title="Pulling signaling message" anchor="pulling signaling message"><artwork><![CDATA[
Pulling Message:
{
 
 POST /whisp/pulling/endpoint HTTP/1.1
 Host: whisp.example.com
 Content-Type: application/json
 Content-Length:
 {

  
  "media": {
    "URL":"http://demo.example.com/liveapp****/liveStream****",
  }  
 } 
}
]]></artwork></figure>

<t>The payload type field in the header indicates the pulling signaling message. The media URL indicates the address of the target media which can be obtained from the edge node.</t>
	
<t>	
The edge node allocates an media ID for the broadcaster or the requested audience for interaction so that the media can be uniquely identified in the communication system. Upon the receipt of the pulling signaling message, the edge node acknowledges the signaling message with the media ID which uniquely identifies the target media.
</t>
	
</section>


<!--
<section title="Pushing signaling message">
	
<t>Pushing signaling message is sent from broadcaster or the requested audience for interaction to the edge node in order to start pushing media to the edge node. The pulling signaling message is shown below:
</t>

<figure title="Pushing signaling message" anchor="Pushing signaling message"><artwork><![CDATA[
Pushing Message {
  Payload Type (i),
  Media info {
    Media URL (b),
  }
}
]]></artwork></figure>	

<t>The payload type field in the header indicates the pushing signaling message. The media ID indicates the media that is about to sent to the edge node. The URL represents the address of the broadcaster or the requested audience for interaction which push media to the edge node. Upon the receipt of the pulling signaling message, the edge node acknowledges the signaling message with a media ID which uniquely identifies the pushed media.</t>	
	
</section>
-->

</section>	
<!--           
          <t>
                <figure title="signaling" anchor="signaling"><artwork><![CDATA[
                    {
                        "action": "switch",
                        "dst": {
                            "msids": [
                                "audio1",
                                "video1"
                            ],
                            "url": "B"
                        },
                        "src": {
                            "msids": [
                                "audio1",
                                "video1"
                            ],
                            "url": "A"
                        }
                    }

                    ]]></artwork></figure>
            </t>
   -->
            

   
    <section anchor="Acknowledgements" title="Acknowledgements">
       <t>
       </t>
    </section>

<!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
        <t>TBD.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
        <t>The signaling messages defined in this document should be protected by security mechanism. </t>
    </section>
</middle>

<!--  *****BACK MATTER ***** -->
<back>
    <!-- References split to informative and normative -->
    <references title="Normative References">
        

        <!-- A *really* full, totally OTT reference - Note, the "target" attribute of the 
	     "reference": if you want a URI printed in the reference, this is where it goes. -->
        <reference anchor='RFC2119'
                   target='http://xml.resource.org/public/rfc/html/rfc2119.html'>
            <front>
                <title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement 
                Levels</title>
                <author initials='S.' surname='Bradner' fullname='Scott Bradner'>
                    <organization>Harvard University</organization>
                    <address>
                        <postal>
                            <street>1350 Mass. Ave.</street>
                            <street>Cambridge</street>
                            <street>MA 02138</street>
                        </postal>
                        <phone>- +1 617 495 3864</phone>
                        <email>sob@harvard.edu</email>
                    </address>
                </author>
                <date year='1997' month='March' />
                <area>General</area>
                <keyword>keyword</keyword>
                <abstract>
                    <t>In many standards track documents several words are used to signify
                    the requirements in the specification.  These words are often
                    capitalized.  This document defines these words as they should be
                    interpreted in IETF documents.  Authors who follow these guidelines
                    should incorporate this phrase near the beginning of their document:

                        <list>
                            <t>
                            The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, 
                            &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
                            &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
                            &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be 
                            interpreted as described in RFC 2119.</t>
                        </list>
                    </t>
                    <t> 
                    Note that the force of these words is modified by the requirement level of 
                    the document in which they are used.</t>
                </abstract> 
            </front>
        </reference>
        
        <reference anchor="RFC3986">
          <front>
            <title>Uniform Resource Identifier (URI): Generic Syntax</title>
            <author fullname="Tim Berners-Lee" initials="T." surname="Berners-Lee">
              <organization/>
            </author>
            <author fullname="Roy T. Fielding" initials="R." surname="T.Fielding">
              <organization/>
            </author>
            <author fullname="Larry M Masinter" initials="L." surname="Masinter">
              <organization/>
            </author>
            <date month="January" year="2005"/>
            <abstract>
              <t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3986"/>
          <seriesInfo name="DOI" value="10.17487/RFC3986"/>
        </reference>
        
       <reference anchor="RFC8830">
          <front>
            <title>WebRTC MediaStream Identification in the Session Description Protocol</title>
            <author fullname="Harald T. Alvestrand" initials="H." surname="Alvestrand">
              <organization/>
            </author>
            <date month="January" year="2021"/>
            <abstract>
              <t>This document specifies a Session Description Protocol (SDP) grouping mechanism for RTP media streams that can be used to specify relations between media streams. This mechanism is used to signal the association between the SDP concept of "media description" and the Web Real-Time Communication (WebRTC) concept of MediaStream/MediaStreamTrack using SDP signaling.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8830"/>
          <seriesInfo name="DOI" value="10.17487/RFC8830"/>
        </reference>        

        <!-- Right back at the beginning we defined an entity which (we asserted) would contain
             XML needed for a reference... this is where we use it. -->
        &RFC2629;
    </references>

</back>

</rfc>