The code which we are going to describe further is to be
written in the .tcl file which we described above.
1 A new node object is created with the command $ns node and
it is written as:
set n0 [$ns node]
set n1 [$ns node]
The above written code creates two nodes and assigns them to
handles n0 and n1.
2 Next step is to create links between the nodes to connect
the nodes which is done using the following code, since we have created the
nodes n0 and n1 above so we are going to connect them as:
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
This line tells the simulator object to connect
the two nodes n0 and n1 with duplex link having bandwidth 1 Mega bit , a delay
of 10 ms and a DropTail queue.The figure above shows the two nodes namely 1 and 2 with link between them.
The next step is how to send and receive data .
No comments:
Post a Comment