Research Breakthrough Possible @S-Logix pro@slogix.in

Office Address

Social List

How to create nam file in NS2?

  • Step-1:Setup nam support in ns-2 by opening file test.nam (user defined name)
  • Step-2: Call the procedure namtrace-all-wireless {}

    set ns [new Simulator]set val(x) 1000set val(y) 1000set namtrace [open test.nam w]$ns namtrace-all-wireless $namtrace $val(x) $val(y)where,val(x) → x-coordinate dimensionval(y) → y-coordinate dimensionnamtrace → file handle for test.nam

    namtrace → file handle for test.nam

    ns → Simulator instance