Wednesday, 4 December 2013

How to install NO Ad-Hoc Routing Agent (NOAH) in NS-2.34

NO Ad-Hoc Routing Agent (NOAH)

NOAH is a wireless routing agent that (in contrast to DSDV, DSR, ...) only supports direct communication between wireless nodes or between base stations and mobile nodes in case Mobile IP is used. This allows to simulate scenarios where multi-hop wireless routing is undesired. NOAH does not send any routing related packets.

  • It has been updated to work with ns-2.26 - ns-2.30 and with non-Mobile IP scenarios. (For older versions of ns-2, take a look at but this version does not contain the bugfixes for non-Mobile IP scenarios.)
  • Further update to allow static multi-hop routes. The routes can be set up using the routing command which takes as parameters the number of destinations and then as many tuples of destination and next hop address. The following example sets up static routing for a line of nodes:
    # setup static routing for line of nodes
    for {set i 0} {$i < $val(nn) } {incr i} {
        set cmd "[$node_($i) set ragent_] routing $val(nn)"
        for {set to 0} {$to < $val(nn) } {incr to} {
     if {$to < $i} {
         set hop [expr $i - 1]
     } elseif {$to > $i} {
         set hop [expr $i + 1]
     } else {
         set hop $i
     set cmd "$cmd $to $hop"
        eval $cmd
Step-by-step installation instructions for ns-2.34
add noah/noah.o \ to OBJ_CC and tcl/mobility/noah.tcl \ to NS_TCL_LIB
Note: make sure there is no space after "\"
add noah.h and to a new subdirectory noah/
Create directory in the folder ns-2.34
add noah.tcl to tcl/mobility/
in  line 197: add source ../mobility/noah.tcl
in 634: add
            NOAH {
                   set ragent [$self create-noah-agent $node]
line 778: add
Simulator instproc create-noah-agent { node } {
    # Create a noah routing agent for this node
    set ragent [new Agent/NOAH]

    ## setup address (supports hier-addr) for noah agent
    ## and mobilenode
    set addr [$node node-addr]

    $ragent addr $addr
    $ragent node $node

    if [Simulator set mobile_ip_] {
        $ragent port-dmux [$node demux]
    $node addr $addr
    $node set ragent_ $ragent
    return $ragent
Open terminal and go to the directory ns-2.34 and type follow commands
make clean

If everything went then you have successfully installed NOAH routing protocol. 

Possible errors
Makefile:13: *** commands commence before first target.  Stop.

The reason of this error is due to the possible space after “\” in these lines noah/noah.o \ or tcl/mobility/noah.tcl \
Make sure u leave no space after “\”

1 comment:

  1. Hi Pranesh,

    I installed NS2 in ubuntu using sudo apt-get install ns2. However I can not find where ubuntu installed the ns2. Can you please tell me how to execute the above steps in detail for installing NOAH.