Bandwidth simulation

Posted: 6 January 2009 by Jason Adams in Uncategorized
Tags: , , ,

At work, we’ve been having problems with not enough bandwidth.  When more than one person uses the net at a time, performance degrades.  At times, it slows to a crawl.  No one can update their computers using that connection or else it affects everyone in the office.  We’re waiting on the data company to upgrade our service.  I’m not a networking person, and I’m not interested in becoming one.  I really don’t want to spend more time working on it than I have to.  But it’s pretty obvious that if you double your bandwidth, you not only increase the speed of your connection, but you decrease the chance of collisions (two or more users accessing the connection simultaneously).

But I wondered just how much of an effect it would have.  So I created a simulation.  My simulation consists of users with random behavior that mimicks real users.  I create random users who access between 0-120 web pages per hour, each of which varies between 75-125 KB uniformly.  I also imagine that these users download between 0-5 large downloads per day, each of which varies between 0-10 MB uniformly.  That sounds pretty reasonable to me.  Then I run through some large number of seconds, each user spawning downloads according to their models, and seeing how bandwidth is affected.

At the end of the simulation, I record the number of downloads, the average file size downloaded, the average speed of downloads, and the percentage of the maximum bandwidth that works out to be.  We expect the average speed of downloads to be greater with higher bandwidth connections, but it’s the percentage of the maximum speed that’s important.

I ran multiple simulations with 2, 5, 10, 20, 30, and 50 users over 100k seconds with 175 KB/s, 350 KB/s and 525 KB/s (approximately equivalent to a T1, 2 bonded T1s, and 3 bonded T1s).  As you can see from the table, performance degrades more rapidly for connections with less bandwidth.  Connections with higher bandwidth are more resilient as more users get connected.

# Users 175 KB/s 350 KB/s 525 KB/s
2 98.5012 98.759 99.0904
5 94.139 94.8358 95.07
10 85.7544 88.5822 88.1656
20 68.8986 75.2786 77.053
30 52.5134 67.2558 69.4318
50 14.0288 48.3792 52.1336

Values in the table are the average percentage of the maximum bandwidth that each user experiences. Nothing Earth-shattering here, but fun to play with.

bandwidth-simulation2

Update: I have published the code used for this simulation.

Comments
  1. [...] Jekyll has code highlighting built in using Liquid.  Handy!  I put up the source for my post on Bandwidth simulation.  I’ll be adding more soon, which I’ll make note of, if for some reason you’re [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>