Multipath routing in the network assists in the process of load balancing, and reliable delivery during the alternative path when one path fails. Ad hoc On-demand Multipath Distance Vector (AOMDV) facilitates the multipath routing in ns-2. In file multipath_routing.tcl, multipath routing process is carried out using AOMDV routing protocol
#Filename: multipath_routing.tcl
set val(rp) AOMDV ;# routing protocol
# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON
# Node Creation
for {set i 0} {$i < 4} {incr i}
{
set node_($i) [$ns node]
$node_($i) color black
}