Programmer to ProgrammerTM  
Wrox Press Ltd  
   
  Search ASPToday Living Book ASPToday Living Book
Index Full Text
 
ASPToday Home
 
 
Home HOME
Site Map SITE MAP
Index INDEX
Full-text search SEARCH
Forum FORUM
Feedback FEEDBACK
Advertise with us ADVERTISE
Subscribe SUBSCRIBE
Bullet LOG OFF
                         
      The ASPToday Article
May 22, 2000
      Previous article -
May 19, 2000
  Next article -
May 23, 2000
 
   
   
   
Put Some "Stream" into Your Net with Windows Media Server   Dan Wahlin  
by Dan Wahlin
 
CATEGORIES:  DNA 2000, Site Design  
ARTICLE TYPE: Overview Reader Comments
   
    ABSTRACT  
 
Article Rating
 
   Useful
  
 68 responses

Advances in streaming video technology have transformed it from something used to watch a live "netcast" of a fish bowl in someone's living room to a full-fledged training and informational medium available to users around the world. If you think your client or company doesn't have a need for it think again. In the first part of this series, Dan Wahlin takes you through several topics ranging from unicast and multicast streams to setting up multicast stations. Armed with this knowledge you can take advantage of the many benefits streaming media has to offer your customers.

   
                   
    Article Discussion   Rate this article   Related Links   Index Entries  
   
 
    ARTICLE

If a client, manager, or colleague hasn’t approached you yet about your "Streaming Video" knowledge they probably will soon. Advances in streaming video technology have transformed it from something used to watch a live "netcast" of a fish bowl in someone’s living room to a full-fledged training and informational medium available to users around the world. If you think your client or company doesn’t have a need for it think again. Productivity and sales opportunities abound if you take the time to consider the possibilities.

Although there are many elements involved with enabling streaming video (networks and bandwidth, servers, scheduling, client players, etc.) on a Website, this article is intended to jump-start those with little or no experience in working with it. We’ll discuss items such as "multicast vs unicast", installing the Windows Media Server, setting up "multicast" stations for an Intranet, and how multicast streams can conserve network bandwidth. Once these topics are completed, we’ll discuss test results run on my company’s network to see how much bandwidth multicast streams can consume in order to efficiently plan for present and future bandwidth needs.

As I’m sure you’re aware, there are many alternatives to the Windows Media Server. Before deciding to use any streaming video product I recommend taking a serious look at all of the available products on the market. The "References" section of this article contains several links to information on streaming video products so that you can decide what will fit into your environment and work best for the end users you support.

Why Stream Video?

If you’ve ever downloaded an AVI, MOV, or other type of video file over a 28.8 modem you know how long it takes before you can actually start watching the video. It’s not much fun because depending on the size of the file and the speed of your Internet connection, you wait and wait until the file downloads to your computer. Streaming video attempts to eliminate this latency by streaming a compressed segment to you that can begin playing right away.

This initial stream is "buffered" in the client viewer. From then on, the video segment you are watching is "behind" the incoming stream that continues to be buffered as it comes from the remote server. If the network connection becomes congested, you may catch up to the stream depending on how much has been buffered in advance. This makes the video you’re watching look more like a slide-show than a video.

The stream that arrives at the client can vary in quality depending on how the initial video or sound clip is encoded. A client connecting through a 28.8 modem obviously cannot handle a 200k stream and will be forced to drop a lot of frames in order to try to keep up with the stream (the slide-show effect). Through taking advantage of specialized "encoding" technology, you can adjust the stream rate to encompass various user connection speeds by using a technology Microsoft calls "Intelligent Streaming." With Intelligent Streaming the server and client work together to determine the available bandwidth. Based on this information, the server then sends the most appropriate bit rate stream to the client.

Multicast Vs. Unicast

Before we discuss setting up a Windows Media Server, there are two concepts that need to be addressed first. Depending upon the network your target audience is on, you can choose between two types of video streams: multicast and unicast.

Multicast

I like to think of multicast streams as being similar to a television broadcast. A scheduled program is broadcast from a central site and many receivers (TVs) can tune into this stream. End users viewing the stream have no power over when the stream starts or ends, and can’t fast-forward or rewind (unless they record it of course).

Multicast streams from a media server work in a similar fashion to television. Rather than being sent out to every individual client on the network, a multicast stream is sent out only once and only to those clients that choose to view the scheduled stream. This is accomplished by the end-user’s computer telling the network card to listen for the IP address associated with the desired multicast. The figure below shows a representation of how a multicast stream works:

Figure 1

Multicasting forwards requests for media streams based on user requests. In this diagram, 3 users all 'listen' to the same stream rather than receiving their own individual stream.

If 3 separate clients each want to watch a 200k stream on an Intranet, only 200k is sent over the network as compared to 3 * 200k = 600k. The amount of bandwidth saved obviously increases as the number of multicast users increases. This has a nice calming affect on stressed-out Network Administrators concerned with maintaining a consistent level of bandwidth.

Although a multicast stream does limit end user interaction as mentioned (it’s not on-demand, no fast-fowarding or rewinding, etc.), it conserves bandwidth very well if used on an appropriate network with properly configured routers. Multicast does have limitations as to where it can be used, however, because of its reliance on the sender’s ability to forward data to the appropriate recipients. Until the routers on the Internet become multicast enabled, "multicast via the Internet will be limited to tunneling and services offered by multicast-enabled islands and/or ISP's." (Implementing IP Multicast in different network infrastructures)

As a result, multicast is more easily implemented on corporate LANs and WANs. If you’re interested in some of the Internet multicast initiatives available on the Internet such as Internet Multicast Backbone or MBone, please take a look at the supporting links included with this article.

In order to allow a multicast stream to be viewed throughout my company’s Intranet, the LAN Manager(s) had to enable the IGMP (Internet Group Management Protocol) on the routers and the CGMP (Cisco Group Management Protocol) on the switches. Although the names and acronyms may change depending on the equipment manufacturer, if the routers and switches within your network aren’t already setup for multicasting (they must be able to interpret Class D IP addresses) then some work will have to be done by the appropriate LAN personnel. Once the routers are enabled to support multicasts, the following process occurs:

"When a client joins a group, it initiates two processes: First, an IGMP message is sent to the client's local router to inform the router that the client wants to receive data sent to the group. Second, the client sets its IP process and network card to receive the multicast on the group's address and port. Multicast addresses are Class D IP addresses ranging from 224.0.0.0 to 239.255.255.255. Class D IP addresses map automatically to IEEE-802 Ethernet multicast addresses, which simplifies the implementation of IP multicasting on Ethernet. When a client leaves a group and is the only one receiving the multicast on that particular subnetwork, the router stops sending data to the client's subnetwork, thereby freeing bandwidth on that portion of the network." (Multicast Streaming: An Introduction)

Unicast

The alternative to multicast technology is unicast. While much less complex to implement from a network perspective and more user friendly (due to the ability to start, stop, fast-forward, and rewind at will), unicasts have their own pitfalls. These come in the form of bandwidth consumption. Because a unicast stream is sent to each user on-demand (point-to-point connection between client and server), the amount of bandwidth consumed increases as the number of end user requests increase. A comparison between unicast and multicast streams can be seen in the figure below.

Figure 2 (MS Deployment Guides)

Unicast is the current standard seen across the web today. Visit almost any site that offers video content and you’ll see that you control when the movie starts and ends. If we were to redraw Figure 1 it would have solid rather than dotted lines connecting to the clients (see Figure 3). This is due to each client receiving his or her own unique stream from the server. Each of these streams can start at different times and collectively decrease the available bandwidth on the network.

Figure 3

With unicast steams, the media server sends a separate stream to each client. Although not efficient for bandwidth consumption, unicast streams allow the client to request steams 'on-demand'.

Having said this, I don’t want to infer that unicasts are bad. Unicasts are appropriate when information must be disseminated to the client on-demand. There are many examples of this such as on-demand training, online support or troubleshooting and product sales.

Windows Media 4.1 Installation

Now that we’ve covered some of the important streaming topics, we’ll discuss the process of installing a windows media server. The first time I installed the server components I was pleasantly surprised how smoothly the process went. The installation was easy to follow and took very little time to complete.

Before proceeding, make sure that you have NT Server 4.0 with Service Pack 4 or higher installed. For those with Windows 2000 Server, Windows Media Server comes bundled with it. If it wasn’t installed during the initial OS installation you can access it from the Add/Remove Programs option in the Control Panel. Once there select Add/Remove Windows Components and click the Windows Media Services option. The installation on Windows 2000 is different to NT 4.0 so you will not see the screens shown below.

Make sure that you are logged into the system with Administrative privileges before starting the installation. If you haven’t already downloaded the server components from Microsoft, go to http://www.microsoft.com/windows/windowsmedia/en/download/default.asp?WROXEMPTOKEN=1554032ZSI7xBBqijp3EcWPomL to get them. On this page locate the Windows Media Tools and Services section and download Windows Media Services Version 4.1. Once the download is complete and you execute the file, you should see the following screen:

Continue to hit Next until you reach the Installation Options page. On this page select Complete Installation from the available choices. The next two screens allow you to specify where the server components are installed and where the asfroot will be. The asfroot will act as the root store for your media files. After choosing the paths, hit Next once again and you should see the following screen:

This screen is important depending on whether or not you will be streaming through firewalls. If you want to enable HTTP streaming and are installing the media server components on a machine that also runs IIS4, you’ll need to make several adjustments to registry settings and server properties so that the media server and webserver can both bind to port 80. The help installed with the Windows Media Server covers this topic well.

Since the example I’ll be outlining is for an Intranet with no firewalls to go through, we’ll choose the Do not enable HTTP streaming option for now. I recommend choosing this option either way if your webserver is on the same machine because you can easily change to HTTP streaming through the media server administrator once the installation is complete.

Once you have determined whether or not to enable HTTP streaming, you will be prompted to create a NetShowServices account or enter a specific account with administrative privileges. If you choose to create a NetShowServices account, the account will be in a group that is a subset of the Administrators group. Since I already had administrative privileges on the machine I was installing on, I entered my user id and password instead of creating a new NetShowServices account.

Hitting the Finish button will start the installation process. At this point you can kickback until the installation process concludes. Once it does, you’ll be given the opportunity to start the administrator program. If you choose to start this you’ll see a web-based program that lets you control everything you need from a browser. This will work on any machine that has the Windows Media Administrator installed on it (along with IE4+) and the appropriate access rights to the server. An example of the administration interface is shown below:

Using this interface you can setup your unicast publishing points, multicast stations, watch activity on the server, and configure server properties. If you chose not to utilize HTTP streaming during the installation process, you can enable it by clicking the Server Properties link followed by the HTTP Streaming and Distribution tab.

Creating a Multicast Station and Program

At this point you should have Windows Media Server 4.1 successfully installed onto your server and be ready to see it in action! The screen shot of the administration interface shown above should say Connected to followed by the name of the server you installed onto. If you experienced any problems connecting or installing, consult the help file provided with the installation file you downloaded from Microsoft.

Due to the limited space of this article, I won’t be able to give the appropriate amount of detail to each item in the administration console. However, I will explain the basics of setting up a multicast station and program so you can begin to see streaming media in action. A word of warning... the following section was written as a step-by-step guide and assumes you are following along and performing the actions to your server as you read.

To start a multicast, you must first setup and establish a station. A station provides an IP address and port for the client to "listen" to and can be thought of as a "channel" when comparing to television (i.e. a television tunes into a specific frequency). The creation of a station is easily accomplished by clicking the "Multicast Stations" link on the administration console. Once you click it, you should see a screen similar to the one shown below:

Click the Stations button and choose New . Assuming everything is installed correctly, a wizard application should appear. Click Next twice and then provide a name and description for your station.

Choose Multicast Only from the available radio button selections. Click Next again and provide a name for your program. A program serves as a container for different streams. Whereas a station is similar to a TV channel, a stream is similar to an individual show on that channel. One station can have several streams associated with it.

If you want the streams within the program to loop upon completion, check the appropriate checkbox. In Part 2 of this article I’ll present an application written in Visual Basic that controls the multicast program scheduling using XML and ASP. For now, however, enable program looping if you want your streams to play continuously.

Click Next yet again and choose Advanced Streaming Format (.asf) File from the available choices. On the next screen add the name of the .asf file you want to multicast to the path already shown. Go ahead and add sample.asf so that the line reads mms://Your_Server_Name/sample.asf . Continue clicking next and then browse to the path of the .asf file that you entered on the previous screen. You will find sample.asf in the asfroot you defined during installation.

The next screen is very important. In order for multicasting to work correctly, the client PC must know what IP address and port (station) to listen to. The wizard we are walking through will generate a .nsc file that will provide this information to the client. If you installed the Windows Media Server on a machine that also has a webserver on it, browse to a virtual directory where you would like the .nsc file to be saved into. If you don’t have a server installed on the same machine, choose any path. You’ll want to copy the generated .nsc file as well as one other text file ( .asx file discussed below) to your webserver in this case.

On the next screen, specify the http:// path to the .nsc file you created on the previous screen. This will be the path to whatever virtual directory you place the .nsc (and .asx ) file on your webserver. Once this has been done you’ll see the following screen:

Aside from the default selection that is chosen for you (the creation of the .asx file), choose to have the .htm file created as well (shown above). Click Next again followed by Finish and you will see a dialogue box that asks where you would like the save the .asx file to. Choose the same directory that you installed the .nsc file to. Follow the same process when prompted to save the .htm file. For those with a webserver on a different machine, you’ll need to copy the .nsc , .asx , and .htm files into the virtual directory specified earlier when you filled in the http:// path.

Assuming all these steps are successfully completed, you should see a screen containing buttons that say " Test .asx " and " Test .htm w/<href> ". Clicking the " Test .htm " button will result in your browser opening to the location you specified on your webserver. If you click the link on the page, a multicast program should play in Windows Media Player!

About .nsc and .asx Files

The .nsc and .asx files created during the process above are essential for the multicast to work on remote clients. Since both of these files are ASCII files, you can open them up in Notepad or any other text editor to view their contents. the code below shows an example of an .asx file.

<asx version = "3.0">
  <title>Program1</title>
  <entry>
    <ref href = "http://Your_Server_Name/Your_Virtual/Station1.nsc"/>
    <title>Program1</title>
    <abstract></abstract>
    <copyright></copyright>
    <author></author>
  </entry>
</asx>

The first thing you’ll notice is that this file follows XML conventions making it easy to understand each node’s purpose. The .asx file’s main purpose is to tell the client application what IP address and port to listen to by giving the client the path to the .nsc file. If you open the .nsc file you’ll see that specific information such as the "NSC URL", "Player URL", "IP Address", and "IP Port" are listed among other items. The .nsc file contains all of the crucial information needed to make the multicast work on a properly configured network.

Multicast Test Results

Now that we’ve covered some of the Windows Media basics, let’s assume that your manager is really excited about enabling multicast training videos on your Intranet site. Let’s also assume that he or she is very skeptical about multicast streams and their alleged bandwidth conservation. How can you put their concerns to rest?

Although the above situation is hypothetical, our Network Administrators raised this concern, as would any good manager charged with keeping the network from grinding to a hault. To show them that it worked as advertised we ran several tests in a controlled network environment. The hub where the tests were run had no users or applications eating away at the bandwidth. This made it simple to measure increases in bandwidth consumption as a varying number of multicast streams were started. The test involved 15 different client computers and began by playing one multicast stream to two of the PCs on the hub. We gradually added as many as 10 additional PCs to this stream. The first 4 bars in Figure 4 show the addition of PCs all viewing this initial stream.

Figure 4

Although this chart alone doesn’t buy us much, combining it with the second chart provides us with the percentage of bandwidth utilized. Equating the time from the first chart with the second one provides the expected result. Adding more PC’s to "listen" to the initial multicast stream resulted in the percentage of bandwidth consumption remaining relatively constant (around 3.5% of the total bandwidth). As additional streams played on client PCs the percentage of bandwidth being consumed increased proportionally but did not change much as additional PCs "listened" to the new stream.

Although this wasn’t the most scientific of tests, the results were exactly what the Network Administrators needed to see in order for us to precede with adding streaming video to our Intranet. They reinforce the fact that multicast enabled networks can take advantage of streaming media without having to incur a significant decrease in bandwidth.

While multicasting is clearly more economical with bandwidth than unicasting, this test only takes you part of the way there. Additional tests should be performed with a less "controlled" network environment (i.e. one with real network traffic) to determine a) if the streaming media still performs in an acceptable fashion, and b) that the impact to current applications is minimal.

Conclusion

We’ve covered several topics ranging from unicast and multicast streams to setting up multicast stations. Although this article has only scratched the surface of streaming media, I hope it helps "jump-start" your streaming endeavors. Armed with this knowledge you can take advantage of the many benefits streaming media has to offer your customers.

 
 
   
  RATE THIS ARTICLE
  Please rate this article (1-5). Was this article...
 
 
Useful? No Yes, Very
 
Innovative? No Yes, Very
 
Informative? No Yes, Very
 
Brief Reader Comments?
Your Name:
(Optional)
 
  USEFUL LINKS
  Related Tasks:
 
 
   
  Related ASPToday Articles
   
  • Creating a TV Guide Style Multicast Scheduling System using VB, XML, and ASP (May 23, 2000)
  •  
           
     
     
      Related Sources
     
  • QuickTime Server: http://www.apple.com/quicktime/servers/
  • Denial of Service Attacks Vulnerability Path: http://www.microsoft.com/technet/security/bulletin/fq00-013.asp
  • PIM-SM Multicast Routing Protocol: http://www.microsoft.com/technet/win2000/pimsm2.asp
  • Windows Media Homepage: http://www.microsoft.com/windows/windowsMedia
  • Windows Media Server/Windows Media Tools Download: http://www.microsoft.com/windows/windowsmedia/en/download/default.asp
  • Getting start with Streaming: http://www.realnetworks.com/getstarted/index.html
  • RealNetworks Server: http://www.realnetworks.com/products/basicserver/index.html
  • StartDust Multicasting Site: http://www.stardust.com/multicast/
  • The evolution of Multicast: http://www.stardust.com/multicast/whitepapers/interdomain.htm
  •  
     
           
      Search the ASPToday Living Book   ASPToday Living Book
     
      Index Full Text Advanced 
     
     
           
      Index Entries in this Article
     
  • .asx files
  •  
  • .nsc files
  •  
  • bandwidth consumption
  •  
  • bandwidth saved
  •  
  • current standard on web
  •  
  • description
  •  
  • diagram
  •  
  • easily implemented on corporate LANs and WANs
  •  
  • elements involved
  •  
  • heavy bandwidth consumption
  •  
  • installing
  •  
  • Intelligent Streaming
  •  
  • limits to end user interaction
  •  
  • multicast station and program
  •  
  • multicast streams
  •  
  • multicast vs unicast
  •  
  • setting up
  •  
  • streaming video
  •  
  • test results
  •  
  • unicast streams
  •  
  • Windows Media 4.1
  •  
     
     
    HOME | SITE MAP | INDEX | SEARCH | REFERENCE | FEEDBACK | ADVERTISE | SUBSCRIBE
    .NET Framework Components Data Access DNA 2000 E-commerce Performance
    Security Admin Site Design Scripting XML/Data Transfer Other Technologies

     
    ASPToday is brought to you by Wrox Press (http://www.wrox.com/). Please see our terms and conditions and privacy policy.
    ASPToday is optimised for Microsoft Internet Explorer 5 browsers.
    Please report any website problems to webmaster@asptoday.com. Copyright © 2001 Wrox Press. All Rights Reserved.