Home Tutorials Forums Articles Blogs Movies Library Employment Press
By Haik Sahakian
|
Published
Measuring bandwidth

YouTube’s speed testing site gives a good estimate of how fast videos can play on a computer. Video streaming servers often have their bandwidth limited for a particular connection to 140% of the highest needed bandwidth for the video to play, so it’s normal for a video to not fill up its buffer as fast as a network connection could allow.

YouTube’s numbers for its customers show that typical bandwidth for the USA is 4.21 Mbps. This is more than enough for online video applications. As a comparison, today’s high quality “HD” web video is about 3 Mbps, regular DVD is 5 Mbps, and Blu-Ray DVD is 40 Mbps. In 2005, typical web video was 0.3 Mbps (300kbps).

Reproducing a low-bandwidth environment

The easiest way to test on a low-bandwidth environment is to use a macintosh and ask the Mac OS firewall to limit the speed on a specific network port. This will limit the network speed on that port for the entire computer.

The ports that should be limited to simulate low-bandwidth web video performance issues are:
Port 80: Non-encrypted HTTP traffic
Port 443: Encrypted HTTPS traffic
Port 1935: Streaming RTMP video

These are the only 3 ports required to limit. Note that this will reduce bandwidth for all applications using these ports, so you will notice the performance difference for all web pages, not just the ones you are testing.

O'Reilly's Mac Dev center has a good introduction to the Mac OS firewall, and MacTipsAndTricks.com has a good overview of using it to reduce bandwidth.

As an example, to limit network activity to 50K a second (400Kbps, 0.4 Mbps), open a Terminal window in the Mac OS and enter the following:

sudo ipfw pipe 1 config bw 50KByte/s
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw pipe 2 config bw 50KByte/s
sudo ipfw add 2 pipe 2 src-port 1935
sudo ipfw pipe 3 config bw 50KByte/s
sudo ipfw add 3 pipe 3 src-port 443

To remove the bandwidth limiting, enter the following:
sudo ipfw delete 1
sudo ipfw delete 2
sudo ipfw delete 3

The bandwidth limits are set per port, so the browser's true bandwidth will be is higher because multiple ports may be used to render a page. HTML content is almost always loaded on port 80; streaming video is usually on port 1935. Once an HTML page has loaded and the video is playing, the bandwidth limit on streaming video will be accurate.


Spread The Word


4 Responses to "Measuring and Reproducing a Low-Bandwidth Environment for Flash Video"

 
Gary Jezorski Scam
said this on 24 Dec 2010 11:03:46 PM CDT
Awesome techniques!!
I know completely aware with the badwidth detection but find useful when i came to know about this completely..Thanks a lot for your valuable advice.

 
Pablo Schklowsky
said this on 08 Jul 2010 2:30:57 PM CDT
Haik, nicely written article. I've used this technique before for testing bandwidth detection and bitrate switching in the JW Player (I'm a developer on the player) and it works wonders.

Another method I've employed has been to use Charles Proxy (a web debugging tool) to limit bandwidth over HTTP/80. For RTMP streams, I'll switch over to RTMPT so that the traffic gets routed over port 80 and, therefore, gets picked up and throttled by Charles.

 
wagster
said this on 03 Jan 2011 8:18:16 AM CDT
"The easiest way to test on a low-bandwidth environment is to use a macintosh"

That's not the easiest way if you don't have access to a Mac! I'll have a look at Charles Proxy

 
Casey
said this on 30 Mar 2011 7:51:53 AM CDT
Awesome, thanks Pablo... Instead of rtmp:// I used rtmpt:// and it showed up in Charles. You are my hero!




Leave a reply:
Your Name *: Email (private) *: Website:
Please copy the characters from the image below into the text field below. Doing this helps us prevent automated submissions.
Security Code: img

Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.