Ns2 Tutorial

Ns2 Tutorial for engineers.For Creating  latest ad hoc network,wireless sensor network simulations using ns-2 contact us also for best implementation.Our staff helps in clearing all your doubts with best effort.Get guidance also for better implementation of ns-2 projects.

What is Ns2?

  • Ns2 Tutorial is a discrete event simulator also for networking research and also work at packet level research. It also also simulates both wired and also wireless network.
  • Ns2 was Developed by UC Berkeley and also is currently maintained by usc.

Components of ns-2:

  • Nam.
  • Ns2.
  • Post processing like simple trace analysis, often also in AWK, perl or OTCL.
  • Pre-processing like traffic and also topology generators.

 Procedures to create simulating script:

  • Create the event scheduler.
  • Turn on tracing.
  • Create network.
  • Setup routing.
  • Insert errors.
  • Create transport connection.
  • Create traffic.
  • Transmit also in application-level data.

Advantages of simulation:

  • Cheaper.
  • Can simulate detail also at arbitrary level.
  • Generality.
  • Find bugs also in advance.

Sample code for how to set node configuration in ns-2:

set val(chan)       Channel/WirelessChannel
set val(prop)       Propagation/TwoRayGround
set val(netif)      Phy/WirelessPhy
set val(mac)        Mac/802_11
set val(ifq)        Queue/DropTail/PriQueue
set val(ll)         LL
set val(ant)        Antenna/OmniAntenna
set val(x)              1300    
set val(y)              1300    
set val(ifqlen)         201            
set val(seed)           0.0
set val(routingprotocol) AMMNET 
set val(nn)             50  
set val(nnn)             49             
set val(cp)            cbr
set val(sc)            scen
set val(stop)           27.3 
set val(stop1)           16.0             
set val(traffic)        tcp
set val(rxPower)        0.1                          
set val(txPower)        0.1     
set val(energymodel)    EnergyModel     
set val(initialenergy)  1000                       
set val(sleeppower)     0.00005   
set val(ener)           500
set val(energy)         cal
set val(freq)        node


NS2 Member Accounts | |
© 2005 - 2024 Vanet Projects

© 2005 - 2024 Matlab Projects