[ns] plz help me urgent how to send a packet from a node to another one node
lukman_hanif at yahoo.com
Mon Mar 30 01:13:11 PDT 2009
> hi to all...
> here i am in need to send a message from node to a another one particular node say (from node2 to node8) how to do it please help me
> regarding this..i was suggested with flooding.tcl.. but here the peroblem is it sends message to all the nodes in the network... i was in need > to send only for a particular node...
What exactly you mean to send from one node to another node ?? The basic connection in ns is between agents inside the correspondence nodes... if you want the packet to travel to a particular node regardless of the paths it takes, you just simply put any connecting agents between those communicating nodes...
for example node(2) send TCP packet to node(8):
set source [new Agent/TCP]
set sink [new Agent/TCPSink]
$ns attach-agent $node(2) $source
$ns attach-agent $node(8) $sink
$ns connect $source $sink; #This makes node(2) connected to node(8)...packets travel from node(2) to node(8) regardless of the path it takes
set ftp [$source attach-source FTP]
$ns at 0.1 "$ftp send"
$ns at 10.0 "$ftp stop"
But if you want the packet to travel through a certain path, one way that i know is to use MPLS explicit route...there maybe other better way which I don't know....I suggest you learn from http://www.isi.edu/nsnam/ns/tutorial/index.html before start using ns-2.....
More information about the Ns-users