CaseStudyForm
Title Buffering Data for a Link
DateSubmitted 26 Jul 2009
CaseStudyType TeachingCaseStudy
OperationsResearchTopics SimulationModelling
ApplicationAreas Telecommunications Networks
ProblemDescription When data is transmitted on a computer network, it must leave the component, e.g., server, switch, PC, via a connection, e.g., network interface card (NIC), port, host-bus adapter (HBA), and be transmitted across a link to another component. The ouput connection must buffer data (i.e., store the data in some memory) if the link is already being used by another piece of data. This is know as output buffering.

One common question asked by network engineers is: "How big does my output buffer need to be so I don't lose data very often?".

In this case study we are going to consider data being sent from a server, via a NIC and ethernet link, to some data storage. The data gets split into packets and transmitted across the link. The size of the data determines the number of packets and, thus, the time the link needs to send the data.

The data being generated on the server is video being compressed before being sent. The time between transmissions is exponentially distributed with mean 1 minute. The size of the data follows a triangular distribution with minimum 3.75GB, mode 7.5GB and maximum 11.25GB. Given that the ethernet link has 1 Gbps of bandwidth and there are 8 bits in a byte, the transmission times also follow a triangular distribution with minimum 0.5 mins, mode 1 min and maximum 1.5 mins.

The goal of this simulation study is to find the average buffer size required in bytes.

ProblemFormulation This problem may be modelled as a single-server queue. The data forms the customers waiting for service and once data is being transmitted, it is being "served" by the link.

The interarrival and processing times are given by exponential and triangular distributions respectively. Although the interarrivals are Markovian, the service times are not. Thus we cannot use the M/M/1 queueing model analytical solution and must solve this problem numerically via simulation.

ComputationalModel This model requires one instance of each of three flowchart modules: Create, Process and Dispose. Data is created at the Create module, moves to the Process module to be transmitted across the link and then leaves via the Dispose module. See the Arena Guide for a demonstration of adding and connecting modules.

The time between arrivals of data is exponentially distributed with mean 1 minute. We can edit the Create module to implement this. Note that nothing interesting happens in the system until the first arrival, so we create the first arrival at the start of the simulation. Figure 1 shows the completed Create module.

Figure 1 Create Module

| Name | =Data Arrives=| | Entity Type | `Data` | | Time Between Arrivals Area || | Type | `Random (Expo)` | | Value | `1` | | * Units* | `Minutes` |

If you are following along, you may want to save your model at this point.

Now that you've have defined the `Data` entity type, you may want to change its initial animation picture. Try making data appear as `Picture.Blue Ball`.

Now that data is arriving, you need to send it across the link (and store it in the buffer if necessary). Edit the Process module to set the time for data to cross the link according to a triangular distribution with minimum value 0.5 minutes, most likely (mode) 1 minute and maximum 1.5 minutes. Figure 2 shows the completed Process module.

Figure 2 Process Module

| Name | `Transmission across Link` | | Action | `Seize Delay Release` | | *Resources (secondary dialog via Add button)*|| || Type | `Resource` | || Resource Name | `Link` | || Quantity | =1=| | Delay Type | `Triangular` | | Units | `Minutes` | | Minimum | `1` | | Value | `3` | | Maximum | `6` |

If you are still following along, now is a good time to save your model.

You can click on the Resource or Queue data modules in the Basic Process template to see the `Link` resource and `Transmission across Link.Queue`. If you needed to edit the resources or queues you could do it here, but we can simply use the defaults for this model.

Finally, rename the Dispose module to reflect data leaving the system. Figure 3 shows the final Dispose module.

Figure 3 Dispose Module

| Name | `Data Leaves` |

### Building an Animation

While not necessary for this simulation model to work, it is always nice, and very useful for demonstrations, to have an animation of the systems we are simulating. In this model we would like to animate the link resource.

Here we will use an empty link (a simple rectangle) to show an idle link and a link with an arrow to show a link that is transmitting data. Figure 4 shows the different pictures for the `Idle` and `Busy` states.

Figure 4 Resource Pictures

The last additon to our model is a dynamic plot that will keep track of the amount of data in the buffer waiting for the link. We add a dynamic plot and use the Expression Builder to set it to plot the number of entities in the `Transmission across Link.Queue`. Figure 5 shows the dialogues for the dynamic plot.

Figure 5 Dynamic Plot

| Plot | Expressions (secondary dialog via Add button) || || Expression | `NQ(Transmission across Link.Queue)` | || Initial Maximum | =5=| || Color | black | | *Plot*||| || Time Range | `20` | || X-Labels | clear (i.e., uncheck) | || Title - Use Title | select | || Horiz. Alignment | `Center` | || Title Text | =Link: Number Waiting=|

Results UP TO HERE!!!

Once your Arena model is complete, you can run the model for multiple replications and get estimates for various different quantities:

Conclusions Need to show what the size of the buffer needs to be in GB. Get count of data in queue and multiply by size of data - what is average of triangular distribution? to get GBs
ExtraForExperts Rather than run trial replications in order to estimate how many replications are necessary to ensure the accuracy of a particular output, we can use dynamic simulation. Dynamic simulation measures the accuracy, i.e., half-width, of an output at the end of each replication and stops replicating once the desired accuracy has been achieved.

In Arena, this is implemented by setting the maximum number of replications "on the fly". However, this means that one extra replication is always performed. See the attached flash movie for a tutorial on implementing dynamic simulation: