4.11 Windows Media Encoder to Windows Media Server Pull Distribution

Pull Distribution is a concept of the Media Streaming Server System [MS-MSSOD] in which streaming content is transmitted from a source, such as Windows Media Encoder or Windows Media Services server, to a requestor, referred to as a "Distribution Server". It is possible to use the Windows Media Streaming Protocol (WMSP) client role and WMSP server role to build a system that implements Pull Distribution. The Distribution Server concept and its role in Pull Distribution are defined in [MS-MSSOD] section 1.1. In a Pull Distribution system, the Distribution Server uses the client role of a streaming protocol, such as WMSP, to connect to the source, which is typically an encoder. Similarly, if the Distribution Server has chosen to use WMSP, the source would use a WMSP server role to receive the request.

The decision to connect to the encoder is made by the higher layer of the WMSP client role used by the Distribution Server. Similarly, the higher layer also decides how to manage the content that is received by the client role. In a possible scenario, the higher layer decides to use the server role of a streaming protocol, such as WMSP, to send the content to media player clients. This scenario is illustrated and described in more detail in [MS-MSSOD] section 2.1.5.

The following sequence occurs between a Distribution Server and an encoder when streaming a single file:

  1. The client role of the Distribution Server sends a Describe request to retrieve the ASF header.

  2. The server role of the encoder responds with a $H (Header) packet.

  3. The client role of the Distribution Server sends a Play request for the file, selecting one or more streams.

  4. The server role of the encoder responds with a $H (Header) packet and $D (Data) packets.

  5. After all $D (Data) packets have been sent to the client role, the server role of the encoder sends a $E (End-of-Stream Notification) packet with the value of the Reason field set to 0, to indicate that the end of the ASF file has been reached. In certain cases, the protocol allows the server role of the encoder to send more than one $E packet, all of which will have the Reason field set to 0. For more information about this, see 3.2.4.1.

  6. The client role of the Distribution Server sends a Log request to the server role.

  7. The server role of the encoder responds with a confirmation that it received the log.

The following figure shows the previously described sequence.

Windows Media Encoder to Windows Media server Pull Distribution

Figure 14: Windows Media Encoder to Windows Media server Pull Distribution

The following example shows a typical Describe request in Pull Distribution.

 Distribution scenario:GET / HTTP/1.1
 Accept: */*
 User-Agent: NSServer/9.0.0.3171
 Host: MyServer
 Max-Forwards: 9
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Pragma: no-cache,rate=1.000,stream-time=0,stream-offset=0:0,
         packet-num=4294967295,max-duration=0
 Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, 
            com.microsoft.wm.predstrm
 Pragma: xClientGUID={00000000-0000-0000-0000-000000000000}
 Accept-Language: *
  

The following example shows a possible response from the encoder's server role.

 HTTP/1.0 200 OK
 Server: Rex/9.0.0.2837
 Cache-Control: no-cache
 Pragma: no-cache
 Pragma: client-id=1543854732
 Pragma: features="broadcast,playlist"
 Content-Type: application/vnd.ms.wms-hdr.asfv1
 Content-Length: 2680
 Connection: Keep-Alive
  
 <body of the response containing the headers ($H packets)>
  

The client role of the Distribution Server sends a Play request for one or more streams, as shown in the following example.

 GET / HTTP/1.0
 Accept: */*
 User-Agent: NSServer/9.0.0.3171
 Host: SampleServer
 Max-Forwards: 9
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Pragma: no-cache,rate=1.000,stream-time=0,
         stream-offset=4294967295:4294967295,
         packet-num=4294967295,max-duration=0
 Pragma: xPlayStrm=1
 Pragma: client-id=1543854732
 Pragma: LinkBW=2147483647, BurstBW=3500000, BurstDuration=5000
 Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, 
            com.microsoft.wm.predstrm
 Pragma: xClientGUID={00000000-0000-0000-0000-000000000000}
 Pragma: stream-switch-count=2
 Pragma: stream-switch-entry=ffff:1:0 ffff:2:0 
 Accept-Language: *
  

The server role of the encoder responds with a "200 OK" message ([RFC2616] section 10) followed by the $H (Header) and $D (Data) packets for the selected streams.

If the headers change during the course of streaming, the server role uses the $C (Stream Change Notification) packet followed by the new header data and then the ASF data. When the server role has finished sending the data, it replies with the $E (End-of-Stream Notification) packet.

Streams pulled from the server role of an encoder are considered broadcast content – "trick modes" such as fast-forward, rewind, seek, and pause are not available.

For more information about the Pragma headers in these examples, see section 2.2.1.4.