Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

NePSing Example: Slotted Aloha simulator

Introduction

This is a NePSing simulation example. It provide a simulator for a very simple Slotted Aloha system with minimal features.

This simulation will assume the following Slotted Aloha protocol features:

We want to record the following quantities:

  1. the mean throughput in packets per second
  2. the (near) instantaneous throughput in packets per second
  3. the number of retransmission for a packet (probability density function)
  4. the waiting time for a packet (probability density function)
  5. S and G values, both the long term mean and the near instantaneous values.

To do do, we will use a simple structure like the one in the following figure:

inline_dotgraph_1

The class SAloha will setup the simulation and creates the first items: a devPkt Generator (devPktGen) and an Access Point (devAP). Then the devPktGen will generate a devPkt (a packet indeed) using a self-clocking event. Each devPkt will send a packet to the devAP managing also the retransmissions, if any; when the packet is sent, the devPkt dies.

The simulation have also a custom probe, Probe_SG, in order to record in a more useful way the S and G parameters.

Compile and Run

A special note about compiling this example. You will have probably to edit the "Makefile" file in order to make it suitable for your own instllation. The definition you will have to look at are:

After you have edited your Makefile, simply issue the make command (or whatever you use), and the simulation should compile (hopefully).

The simulation executable can be started by passing a paramtere file to it, e.g., ./SlottedAloha params.

To make a paramter file, launch the program itself with the right options, launching it without anything will give you a warning about the available options.

A common way to create a parameter file template is ./SlottedAloha -p -np > params.

Edit your parameter file and you are ready to start our first simulation.

Warning: do not forget to create the Probe output directory; otherwise as soon as a Probe will try to write its data files, an exception will be raisen and the program will terminate.


Generated on Wed Dec 22 23:26:43 2004 for NePSing Slotted Aloha example by doxygen 1.3.9.1 ---- Hosted by SourceForge.net Logo