Path discovery Route path error Roto Link Source node Destination node Mobile Ad hoc NETwork There is no static infrastructure such as the base station. If two hosts are not within the radius range, all message communication between them must pass through one or more intermediate hosts that double as routers. Network Simulator 2 (ns-2) NS-2 is a discrete event simulator aimed at networked research. Nsprovides substantial support for TCP simulation, routing and multicast protocols over wired and wireless networks (local and satellite).
In the simulation aspect, the main component in the design of a mobile adhoc network is the mobility model, while the other components include the node configuration, the random topology and the communication model. In the mobility model, the mobility of a node from one location to another can be enabled by using the keyword "setdest" in the tool command language (TCL) script. The specifications for the target location of a node include x coordinates, and coordinates along with velocity. The nodes are configured with the channel components, network interface, radio propagation model, medium access control protocol (MAC), adhoc routing protocol, interface queue, link layer, topographic object and antenna type. In dynamic topology, the neighbors of each node vary with the location of that particular node. The nodes in the adhoc network communicate using the communication model. Sample14.tcl illustrates the design of the mobile ad hoc network consisting of 3 mobile nodes. The movements of the mobile nodes are limited to an area of 500mX500m with the pause time of 3s. Data transmission is established between nodes using the UDP agent and CBR traffic. These intermediate routers forward packets generated by other nodes to their destination.