Routing Protocols in ns2 for Wireless Network

  • Usage of AODV Routing Protocol in tcl script as follows:

    # Defining Options
    set rp AODV;# routing protocol
    set ifq Queue/DropTail/PriQueue ;# interface queue type
    # Creating nodes with this Configuration
    $ns node-config -adhocRouting $rp \
    – ifqType $val(ifq)
    set totalNodes 50 ;#Total Number of nodes in the network
    for {set i 0} {$i < $totalNodes } { incr i } {
    set node_($i) [$ns node]
    }

  • Usage of DSR Routing Protocol in tcl script as follows:

    # Defining Options
    set rp DSR ;# routing protocol
    set ifq CMUPriQueue ;# interface queue type
    # Creating nodes with this Configuration
    $ns node-config -adhocRouting $rp \
    – ifqType $val(ifq)
    set totalNodes 50 ;#Total Number of nodes in the network
    for {set i 0} {$i 7lt; $totalNodes } { incr i } {
    set node_($i) [$ns node]
    }

  • Usage of DSDV Routing Protocol in tcl script as follows:

    # Defining Optionsset rp AODV ;# routing protocolset ifq Queue/DropTail/PriQueue ;# interface queue type# Creating nodes with this Configuration$ns node-config -adhocRouting $rp \- ifqType $val(ifq)set totalNodes 50 ;#Total Number of nodes in the networkfor {set i 0} {$i < $totalNodes } { incr i } {set node_($i) [$ns node]

    }