<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Sam Zhang&amp;#39;s Blog</title><subtitle type="html" /><id>http://blogs.iis.net/samzhang/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.iis.net/samzhang/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.iis.net/samzhang/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-05-06T16:54:00Z</updated><entry><title>Streaming == Content Protection? (Part 2)</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/samzhang/archive/2008/05/23/streaming-content-protection-part-2.aspx" /><id>http://blogs.iis.net/samzhang/archive/2008/05/23/streaming-content-protection-part-2.aspx</id><published>2008-05-23T22:41:11Z</published><updated>2008-05-23T22:41:11Z</updated><content type="html">&lt;p&gt;So in &lt;a href="http://blogs.iis.net/samzhang/archive/2008/05/22/streaming-content-protection-part-1.aspx"&gt;part one&lt;/a&gt;, I talked about technically how streaming and content protection works and why they're independent and not tied to each other. Today, I'd like to share with you how I view the claims behind this notion and what they're really about. The claims I'm going to quote here are from a technical paper that was published by a company that advocates this concept. If you're familiar with media streaming, you should know which company I'm talking about. :) For the purpose of this blog, let me call it &amp;quot;the company&amp;quot;. (Disclaimer: this is not the same &amp;quot;the company&amp;quot; that chases Michael Scofield and his brother in &amp;quot;Prison Break&amp;quot; :-) ).&lt;/p&gt;  &lt;p&gt;Below are some of the claims in that technical paper which is trying to prove that streaming helps with content protection.&lt;/p&gt;  &lt;p&gt;1. Progressive-downloaded contents are always saved in browser's cache&lt;/p&gt;  &lt;p&gt;This is true, but only with default setup. If you know HTTP protocol, you probably know that HTTP protocol defines headers that can be used to disable caching. That means your web server can actually tell browser or cache/proxy not to cache the response. It's very easy to configure and here is an example of how it can be done on IIS7:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache1_2.jpg" mce_href="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache1_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="481" alt="nocache1" src="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache1_thumb.jpg" width="632" border="0" mce_src="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache1_thumb.jpg" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Figure 1: Selecting &amp;quot;HTTP Response Headers&amp;quot; Icon&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache2_2.jpg" mce_href="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache2_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="510" alt="nocache2" src="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache2_thumb.jpg" width="634" border="0" mce_src="http://blogs.iis.net/blogs/samzhang/WindowsLiveWriter/StreamingContentProtectionPart2_C2E5/nocache2_thumb.jpg" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Figure 2: Add &amp;quot;no cache&amp;quot; headers to the response&lt;/p&gt;  &lt;p&gt;In the example above, I created a folder called &amp;quot;NoCache&amp;quot; under my default web site. Then I select &amp;quot;HTTP Response Headers&amp;quot; icon at this folder level (by doing that I only disable caching for this folder and below). Then I go into &amp;quot;HTTP Response Headers&amp;quot; UI page and add two response headers: &amp;quot;Cache-Control&amp;quot; and &amp;quot;Pragma&amp;quot; both with value as &amp;quot;no-cache&amp;quot;. &amp;quot;Cache-Control&amp;quot; header is defined in HTTP 1.1 and &amp;quot;Pragma: nocache&amp;quot; header is for legacy HTTP 1.0 clients. See HTTP protocol spec &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" mce_href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"&gt;here&lt;/a&gt; for more detail. &lt;/p&gt;  &lt;p&gt;Ok, that's it! If you want to verify, you can try this:&lt;/p&gt;  &lt;p&gt;1) Before adding these two headers, use your web player to play a media file in this &amp;quot;NoCache&amp;quot; folder. Then go to your browser's temp file folder and search for the cached file.&lt;/p&gt;  &lt;p&gt;2) Add these two headers, clean your browser's cache and then repeat (1). You should no longer be able to find the cached file.&lt;/p&gt;  &lt;p&gt;As you can see, servers can prevent progressive downloaded files from being available in a well-behaved browsers cache.&lt;/p&gt;  &lt;p&gt;2. SSL Encryption&lt;/p&gt;  &lt;p&gt;This technical paper talks about their streaming server supporting SSL encryption. What makes me uncomfortable is that it in nowhere mentions the fact that you can also easily do SSL from web server (aka HTTPS). Here I'm not going to dive into the details about how to configure SSL on IIS7. I'm sure you can find a lot of references on MSDN and iis.net.&lt;/p&gt;  &lt;p&gt;3. Proprietary Streaming Protocols &lt;/p&gt;  &lt;p&gt;Well, I can't really argue for this one because it's a well-known truth that &amp;quot;the company&amp;quot; has decided to use their own protocols and keep them in private. But using a proprietary protocol automatically makes the content &amp;quot;protected&amp;quot; just doesn't make sense to me. It's sort of saying if I speak in another language, my words will immediately become &amp;quot;protected&amp;quot;. The reality is that it's just a matter of time before people crack it with good reverse engineering effort. Technically there's nothing preventing a &amp;quot;full featured&amp;quot; streaming client from saving the streamed content once it understands the streaming protocol. All it needs to do is to re-assemble the pieces from the streaming format back into the file format. Actually today if you do a search with &amp;quot;%ProtocolName% download&amp;quot; (replace %ProtocolName% with the name of the streaming protocol of &amp;quot;the company&amp;quot;), you would find that there're already tools out there which knows how to interpret this protocol and then save the streamed content to local files. The reverse engineering effort seems to have largely succeeded.&lt;/p&gt;  &lt;p&gt;Using proprietary streaming protocol has many other limitations outside of the scope of content protection. For example, you would be locked into one particular type of streaming server, media client and file/codec format. Your contents can not easily flow to other type of clients which support standard protocols. It would be next to impossible to add support for new media formats, etc. These are all important things to consider.&lt;/p&gt;  &lt;p&gt;Ok, with all that, let me try to summarize the points I'm trying to make here:&lt;/p&gt;  &lt;p&gt;1. Streaming does not automatically give you content protection because they're not tied to each other. Content protection mechanisms can also be used with progressive download from web server. Streaming is just another way to deliver media contents. Streamed content can always be reassembled back into the file format. In another word, streamed content can also be &amp;quot;downloaded&amp;quot;.&lt;/p&gt;  &lt;p&gt;2. There're still things you can do on web server to better protect your content from being saved and trivially &amp;#8216;used&amp;#8217; by well-behaved browsers. Disabling caching and using SSL are some examples. More advanced content protection mechanism can be implemented for progressive download by implementing modules and code on web server and media clients. This is the same idea as the &lt;a href="http://learn.iis.net/page.aspx/455/sample-image-watermark-module/"&gt;watermark module&lt;/a&gt; developed by Fabio for protecting images. Modern web server like IIS7 has become a powerful programming platform on top of which you can develop all kinds of cool solutions.&lt;/p&gt;  &lt;p&gt;3. The concept of proprietary streaming protocol provides content protection is NOT time-withstanding. Without a real content protection mechanism, tools that understand that protocol can easily capture the contents. Using proprietary protocols has many other limitations that might cause business concerns.&lt;/p&gt;  &lt;p&gt;To be fair, I still need to acknowledge the fact that today it is indeed a lot easier to download and save contents from web server than from streaming server. For example, some tools do not rely on browser cache, instead they directly intercept the URL to the media file and download it separately.&amp;#160; Some tools have made it as simple as a single-click experience. As I said above, you could also find tools that can &amp;quot;download&amp;quot; and save streamed contents but those tools are not so popular today. In my view, this is mostly due the fact that most media sites today still use progressive download to deliver their contents for its low cost and ease of use. If some day a particular streaming protocol becomes very popular, I bet capturing and downloading with that streaming protocol is just going to be as easy as downloading web contents today. In that sense, if you move to streaming just for content protection, you may get some benefits for the short run. But in the long term, you're really betting that the streaming solution you chose will NOT be mainstream. Because once it is, tools will be greatly enhanced and the perceived benefit of &amp;quot;content protection&amp;quot; will disappear immediately. But if you do win the bet and get the &amp;quot;protection&amp;quot; you want, which means you ended up choosing an unpopular streaming solution, wouldn't you be losing more? &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks for reading.&lt;/p&gt;  &lt;p&gt;-Sam&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2377901" width="1" height="1"&gt;</content><author><name>samzhang</name><uri>http://blogs.iis.net/members/samzhang.aspx</uri></author><category term="Media Streaming" scheme="http://blogs.iis.net/samzhang/archive/tags/Media+Streaming/default.aspx" /><category term="Content Protection" scheme="http://blogs.iis.net/samzhang/archive/tags/Content+Protection/default.aspx" /></entry><entry><title>Streaming == Content Protection? (Part 1)</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/samzhang/archive/2008/05/22/streaming-content-protection-part-1.aspx" /><id>http://blogs.iis.net/samzhang/archive/2008/05/22/streaming-content-protection-part-1.aspx</id><published>2008-05-23T01:38:00Z</published><updated>2008-05-23T01:38:00Z</updated><content type="html">&lt;P&gt;Recently I got a chance to talk to a customer who does a lot of media streaming as well as progressive download. One thing he mentioned was that more and more people start to believe that if they want content protection, they need to switch to streaming instead of using progressive download from a web server. I know that this idea has been floating around for quite some time but I never imagined that content protection would be a major reason why people want to do streaming. Because technically they're just two different things.&lt;/P&gt;
&lt;P&gt;The fundamental difference between streaming and progressive download is the protocol which defines how client controls the media as well as how media data is packaged on the wire. For progressive download from a web server, standard HTTP protocol is used and the binary format on the wire is the same as the file format. For streaming protocols, like RTSP/RTP, media specific control commands (like pause, seek, fast forward and rewind) are defined. Also when transferring the content, the original media file is broken into meaningful pieces (like headers, streams and samples) and repackaged into streaming protocol format. So in streaming case, the binary format on the wire is not the same as file format. This repackaging, however, does NOT alter the actual media data in any way. All the samples and header information stay the same. No encryption is involved. All the data is till in clear. It's sort of like converting your old word .doc file to the new .docx format. Yes, the format did change but whatever the original document has is still there in the new format. &lt;/P&gt;
&lt;P&gt;Content protection typically happens at different layers. I usually categorize content protection into two categories: link protection and file protection. Link protection is for, as the name suggests, protecting the link. In another word, it prevents third-party application or entity that sniffs or hijacks the content transfer session. An example of link protection would be SSL. The payload is encrypted before getting transferred through the link and decrypted as soon as it reaches the destination. Link protection is usually associated with the transfer session, not the actual content or file. Because link protection is only protecting the link, it does not have any control over how the media file is used once it reaches the client machine. If you want to have control over the media file itself, you would then need a file protection mechanism. DRM is an good example of media file protection. For DRM content, the media data (usually samples) is already encrypted when the file was originally created. Web server or even streaming server can be agnostic about the media encryption. Because all they need to do is to deliver bits or samples. Whether the content is encrypted or not does not really matter. Decryption for DRM content happens when the user tries to view the content. Client machine needs to contact license server to get the license and decrypt the content. &lt;/P&gt;
&lt;P&gt;So as you can see, content protection is not tied to streaming. Yes, you can do streaming with SSL or DRM content. But you could also do progressive download with SSL or DRM content. Streaming gives you more functionality for transferring and viewing the media content by using more specialized protocol, but from network delivery's perspective, it's just another kind of pipe. Content protection is a special sauce that can be added separately and optionally to both streaming or progressive download.&lt;/P&gt;
&lt;P&gt;Ok, this is all about theoretical analysis. Next time in part 2, I will go into the details about the claims that some company are making about "Streaming == Content Protection". You feedback is always appreciated.&lt;/P&gt;
&lt;P&gt;-Sam&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2375489" width="1" height="1"&gt;</content><author><name>samzhang</name><uri>http://blogs.iis.net/members/samzhang.aspx</uri></author><category term="Media Streaming" scheme="http://blogs.iis.net/samzhang/archive/tags/Media+Streaming/default.aspx" /><category term="Content Protection" scheme="http://blogs.iis.net/samzhang/archive/tags/Content+Protection/default.aspx" /></entry><entry><title>Web Playlist and Bit-rate Throttling  - Working together</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/samzhang/archive/2008/05/06/web-playlist-and-bit-rate-throttling-working-together.aspx" /><id>http://blogs.iis.net/samzhang/archive/2008/05/06/web-playlist-and-bit-rate-throttling-working-together.aspx</id><published>2008-05-06T23:54:00Z</published><updated>2008-05-06T23:54:00Z</updated><content type="html">&lt;P&gt;&lt;SPAN style="COLOR: black"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;Hello, my name is Sam Zhang (or &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;章葛强&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt; if you can read Chinese) and&amp;nbsp;I'm a lead developer on IIS Media Pack team. I've always wanted to start my own blog to talk about IIS and media but couldn't do it until now. &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Wingdings"&gt;J&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt; IIS Media Pack team is a relatively new team with a vision to enable advanced media scenarios on IIS platform. This team has a group of bright and smart people who are really passionate about web media technologies. I hope you will find useful information in my blogs and at the same time provide us your valuable feedbacks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Tahoma"&gt;I think you've probably known or used the two Media Pack modules we've released so far: Bit-rate throttling 1.0 and Web Playlist CTP2. There have already been some great posts about the features and functionalities in these two products. So I won't go into those details again. Today I'd like to talk about how these two modules fit into IIS pipeline and how they work with each other. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Tahoma"&gt;First, let's talk about Web Playlist. If you have used Web Playlist, you probably know that Web Playlist by default handles requests with ".isx" extension. In Web Playlist, ".isx" is defined for "default playlist provider" and you can add your own playlist extension by adding a playlist provider. In IIS7 pipeline, the component that handles requests and produces responses for a particular extension is called "request handler". For example, ASP.net registers a request handler with ".aspx" extension. In IIS7, request handler only gets invoked if the request comes with the extension that it registered with. In our case, default web playlist handler is only called if the request has ".isx" extension. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Tahoma"&gt;For Bit-rate Throttling (BRT), the design approach is different. It's less about "what to return" but more about "how to return". In another word, BRT's job is to control how fast we can send the response rather than figuring out what response needs to be sent to the client. So with that, it was naturally implemented as an IIS7 module instead of a handler. In IIS7, a module listens to one or multiple event notifications which are fired for all the requests. BRT mainly listens to RQ_SEND_RESPONSE event which is fired right before the response is going to be sent. All the magic of doing bit-rate control happens at that point. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Tahoma"&gt;So, if you have both Web Playlist and BRT installed and enabled, they both exist in the request processing pipeline but get invoked at different stages. At the same time, they're totally independent with each other as well. For example, it's perfectly fine to just run Web Playlist without BRT if bandwidth consumption is not a concern. Because BRT is implemented as a module in IIS7 pipeline, it can handle all type of responses, static file or dynamic responses, as long as you have the right throttling rules defined. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;So how exactly is BRT working with Web Playlist? If you have used Web Playlist, you probably know that the entry URLs embedded in the ASX response are obfuscated. There's no way to tell which content is going to be returned just by looking at the URL. Web Playlist keeps track of the user session state and communicate with playlist provider to find out the exact content at runtime. Can it still be properly throttled? The answer is yes, and you get the same behavior as if the client is requesting a static media file. BRT does not rely on the request URL to determine where to look at. Instead, it directly intercepts the response entity and find out what is actually being returned. If the response contains a file handle, it knows how to trace back to the original location of the file, get the file extension and apply the corresponding throttling rules. If it's a media file, it will follow the same logic of parsing the encoded bit-rate from that file and use the proper media throttling rules (e.g. 20s/100%). So all you need to do is to set the right throttling rules for the file type you want to return with Web Playlist, and everything else will happen automatically. It works not only with entries entered with relative URIs in playlist but also with entries located by physical path which does not need to be in the public URL namespace. One thing to note here is that BRT won't work with remote URLs you set in your playlist because the actual downloading is going to happen on the remote server (well, you could still install BRT on your remote server &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Wingdings"&gt;J&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Tahoma"&gt;As you can see, BRT can easily work with static files as well as dynamic responses. Web Playlist is just a good example here. You can write your own request handler to dynamically return media files or any type of responses and BRT will just work. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: black"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-FAMILY: Tahoma"&gt;Want to give it a try? &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2341631" width="1" height="1"&gt;</content><author><name>samzhang</name><uri>http://blogs.iis.net/members/samzhang.aspx</uri></author><category term="IIS7 Media Pack" scheme="http://blogs.iis.net/samzhang/archive/tags/IIS7+Media+Pack/default.aspx" /><category term="Web Playlist" scheme="http://blogs.iis.net/samzhang/archive/tags/Web+Playlist/default.aspx" /><category term="Bit-rate Throttling" scheme="http://blogs.iis.net/samzhang/archive/tags/Bit-rate+Throttling/default.aspx" /></entry></feed>