Jan 24, 2006

Links properties of two nodes

To send packets between two nodes, there should be a link between two nodes. In Ns-2, the link properties can be modified to effect bandwidth, delay and queue type.

Link Types

A data rate is the flow of data measured in bits across a network, through an Internet connection, or between I/O devices such as disk drives. NS-2 supports emulation a number of different data flow types across a variety of wired and wireless media links. Links can be used to simulate different topologies such as mesh, point to point, star network topology.

After creating a set of nodes in the tcl script, (for this example we will just make two nodes) we can start by making a simple link, as with the node being composed of classifiers, a simple link is built up from a sequence of connectors. The following command describes the syntax to link two nodes with a simplex-link "$ns duplex-link node node bandwidth delay queue_type":
set ns [new Simulator]set node0 [$ns node]
set node1 [$ns node]

$ns simplex-link $node0 $node1 1Mb 10ms DropTail

The command creates a link from node0 to node1, with specified bandwidth and delay characteristics, the link uses a queue of type DropTail.

The "simplex-link" is a uni-directional link which means that traffic can only travel in one direction along the link. Therefore in order to have bi-directional traffic the "duplex-link" should be used allowing communication in opposite directions simultaneously.

note: two simples-link's in opposite direction are equivalent to one duplex-link, e.g: duplex-link, e.g:

$ns simplex-link $node0 $node1 1Mb 10ms DropTail
$ns simplex-link $node1 $node0 1Mb 10ms DropTail


the same result can be achieved with:

$ns duplex-link $node0 $node1 1Mb 10ms DropTail

Bandwidth and Delay

Both the commands above create a link from node0 to node1, with specified bandwidth and delay characteristics, these characteristics can be altered by changing the relevant parameters. The first parameter is bandwidth (in examples above "1Mb"), this is the amount of data that can be passed along the link channel in a given period of time, this parameter can be given in decimal form, for example "0.056Mb" which could also be achieved with "56Kb".

The second parameter affects the delay characteristics of the link, these characteristics can be used to simulate the delay which may be caused by propagation - the time the signal takes to travel across the cable length, noise - external signals effecting signal quality, or processing - delay caused by processing of traffic, this is given in milliseconds.

No comments: