Application/Traffic/Poisson - Poisson traffic generator for ns-2
NB: If you use this ns-2 module cite it as follows: K. Pentikousis, Application/Traffic/Poisson - Poisson traffic generator for ns-2. ns-2 module available from http://ipv6.willab.fi/kostas/src/Application-Traffic-Poisson/. September 2004.
Define a new Poisson traffic generator object
set p [new Application/Traffic/Poisson]
and specify either the mean time between packets (interval_):
$p set interval_ 0.005 $p set packetSize_ 100 $p set maxpkts_ 100
or, equivalently, the long-term sending rate_ of the Poisson source:
set rate_ 160kb $p set packetSize_ 100 $p set maxpkts_ 100
In the latter case, interval_ is calculated using rate_ and packetSize_.
A Poisson object is instantiated by the OTcl class Application/Traffic/Poisson (see also The ns Manual, Part VI). Packet generation is a Poisson process: the time between successive packets is independently generated from an exponential distribution with mean interval_. The important member variables that parameterize this object are:
rate_ the sending rate (b/s), set to 1 Mb/s by default.
interval_ (optional) mean packet inter-generation time (sec)
packetSize_ (optional) size of the packet generated (bytes); defaults to 500 bytes, if not set. All packets will have this size.
maxpkts_ (optional) maximum number of packets to send; defaults to 268,435,456, if not set.
If both interval_ and rate_ are (unintentionally) supplied, the former has precedence.
A Poisson traffic generator is not, in general, recommended for realistic performance evaluation simulation studies (see, for example, ``Wide-Area Traffic: The Failure of Poisson Modeling'' by V. Paxson and S. Floyd, IEEE/ACM ToN, vol. 3, no. 3, http://doi.acm.org/10.1145/190314.190338). However, you may want to take a look at recent work by Karagiannis et al., (for example, ``A nonstationary Poisson view of Internet traffic'', Proc. INFOCOM 2004, http://dx.doi.org/10.1109/INFCOM.2004.1354569).
Application/Traffic/Poisson is well-documented and may prove helpful as you go about adding new and exciting protocols to ns-2 and allows for ``cleaner'' ns-2 scripts than a ``hacked''/overloaded Exponential On/Off source. It was originally developed mainly for educational purposes.
After installing and validating ns-2.28 as per the distribution instructions, download the Application/Traffic/Poisson patch tarball ns-2.28-poisson.patch.tar.gz and save it in a temporary directory.
The tarball contains the following files:
ns-2.28-poisson.patch the patch file README this file, containing installation instructions
You will need a recent version of patch (if you are using any recent GNU/Linux distribution at hand, then worry not). The Poisson patch works fine with GNU patch 2.5.4 and later. You can check the patch version with
$ patch -v
After unpacking the tarball, copy the patch file ns-2.28-poisson.patch into the ns-2.28 directory.
$ cp ns-2.28-poisson.patch your-path-to-ns-2.28 $ cd your-path-to-ns-2.28
The patch includes modifications to some of the ns-2.28 original files, such as Makefile.in. If you want to keep backup copies of the original files, then use the following command:
$ patch -bNp1 < ns-2.28-poisson.patch
$ patch -Np1 < ns-2.28-poisson.patch
which should give you the following output:
patching file Makefile.in patching file common/packet.h patching file tcl/lib/ns-lib.tcl patching file tcl/poisson/ns-poisson.tcl patching file tcl/test/test-all-poisson patching file tcl/test/test-output-poisson/poisson1.Z patching file tcl/test/test-output-poisson/poisson1a.Z patching file tcl/test/test-output-poisson/poisson2.Z patching file tcl/test/test-suite-poisson.tcl patching file tools/poisson.cc patching file trace/cmu-trace.cc patching file trace/trace.cc patching file validate
If, instead of the above, patch starts asking questions, type CTRL-C: your patch program is too old. Get a fresh GNU patch version from http://www.gnu.org/software/patch
If the patch was successfully applied, go ahead and compile ns-2 (with the Poisson patch)
$ ./configure ... $ make clean ... $ make ...
If everything went well (it should!) then continue with the validation:
$ chmod ugo+x tcl/test/test-all-poisson $ ./validate
Note that you have to explicitly make tcl/test/test-all-poisson executable, as context diffs cannot reliably represent [..] [file] permissions (see patch(1) for more details).
The Poisson patch does not touch any part of the ns-2.28 distribution that it does not need to, so, alternatively, you can validate the Poisson generator only without worrying about the rest of the simulator code:
$ chmod ugo+x tcl/test/test-all-poisson $ cd tcl/test $ ./test-all-poisson
Now you should be all set. Make sure to read the SYNOPSIS and DESCRIPTION sections of this manual page and take a look at the examples in ns-2.28/tcl/test/test-suite-poisson.tcl
Once the patch has been installed, you can delete ns-2.28-poisson.patch from the ns-2.28 directory.
Kostas Pentikousis, kostas AT cpan dot org.
Copyright (C) 2004, 2005 by Kostas Pentikousis. All Rights Reserved.
Application/Traffic/Poisson is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Application/Traffic/Poisson is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/gpl.txt