patch - A patch for the traffic trace generator code in ns-2.28


NAME

Application/Traffic/Trace patch - A patch for the traffic trace generator code in ns-2.28


SYNOPSIS

  set tfile [new Tracefile]
  $tfile filename some_trace.bin
  $tfile set randomize_ true
  $tfile set debug_ false

The Net Times


DESCRIPTION

The patch cleans up the code in ~ns/trace/traffictrace.cc a bit, adds graceful failure handling during setup(), and removes the harmless yet rather disturbing warning:

  $ ns traffictrace.tcl
  warning: no class variable Trace:debug_
        see tcl-object.tcl in tclcl for info about this warning.

Finally, the patch introduces a new instance variable called randomize_. If randomize_ is true (the default) the traffic trace generator starts from a random record of the trace maintaining backward compatibility. However, in some scenarios you may be interested in replaying the traffic trace exactly as it was captured, i.e. starting from the first record instead of an arbitrary point. After applying the patch, set randomize_ to false and the traffic trace generator will replay the trace from the first record instead of a random point.


INSTALLATION

After installing and validating ns-2.28 as per the distribution instructions, download the Application/Traffic/Poisson patch tarball ns-2.28-traffictrace.patch.tar.gz and save it in a temporary directory.

Icon  Name                              Last modified      Size  Description
[DIR] Parent Directory - [   ] ns-2.28-traffictrace.patch.tar.gz 15-Aug-2005 16:33 4.5K

The tarball contains the following files:

  ns-2.28-traffictrace.patch  the patch file
  README                      this file, containing installation instructions

Requirements

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

Apply the Patch

After unpacking the tarball, copy the patch file ns-2.28-poisson.patch into the ns-2.28 directory.

  $ cp ns-2.28-ns-2.28-traffictrace.patch.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. If you want to keep backup copies of the original files, then use the following command:

  $ patch -bNp1 < ns-2.28-traffictrace.patch

otherwise, type

  $ patch -Np1 < ns-2.28-traffictrace.patch

which should give you the following output:

  patching file doc/applications.tex
  patching file tcl/lib/ns-default.tcl
  patching file trace/traffictrace.cc

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

Compile ns-2 with the newly installed patch

If the patch was successfully applied, go ahead and compile ns-2

  $ ./configure
  ...
  $ make clean
  ...
  $ make
  ...

Now you should be all set. Make sure to read the SYNOPSIS and DESCRIPTION sections of this manual page

Cleanup

Once the patch has been installed, you can delete ns-2.28-traffictrace.patch from the ns-2.28 directory.


AUTHOR

Kostas Pentikousis, kostas AT cpan dot org.


COPYRIGHT AND LICENSE

Copyright (C) 2004, 2005 by Kostas Pentikousis. All Rights Reserved.

This patch to Application/Traffic/Trace 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.

The patch 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

web tracker