How do I Create a Link in Ns2

Most significantly, the research scholars can acquire the finest guidance form our experienced technical professionals. In this article, we have highlighted significant notes about the creation of link in network simulator 2.

Syntax for Link in Ns2

In general, the links among the server and router node is defined as the TCL script along with the utilization of below mentioned commands.

$ns duplex-link $node_($server) $node_($router) 2Mb 50ms DropTail

In which, the duplex link is defined as the specification of bi directional link, 2Mb is the representation of bandwidth, 50ms is denoted as the propagation delay and DropTail is denoted as the type of type.

Ns2 Code to Create Link between Nodes

The script code based network simulator 2 is deployed to create the wired link among the nodes to perform the wired network simulation. In addition, we have highlighted some sample Ns2 codes.

  • Code to trace all routing information into the trace file and similarly namtrace-all for the nam file

set tf [open w]

$ns trace-all $tf

set nf [open out.nam w]

$ns namtrace-all $nf

  • Code for creating duplex links

$ns duplex-link $node1 $node2 1.5Mb 10ms DropTail

$ns duplex-link $node2 $node3 1.5Mb 10ms DropTail

If you have any queries, you guys can reach us at any time to clarify your issues!!!