You first have to select the source routing mode

$ns src_rting 1

and then specify the route you want. For example if you want to 
send packets between a TCP Agent in node 0, and a sink in node 1, 
you can do it as follows:

#Create a TCP agent and attach it to node n0
set cbr0 [new Agent/TCP]
$ns attach-agent $n0 $cbr0
$cbr0 set fid_ 0

#Create a TCP agent and attach it to node n3
set cbr1 [new Agent/TCP]
$ns attach-agent $n3 $cbr1

$cbr1 set fid_ 1

$cbr0 target [$n0 set src_agent_]
$cbr1 target [$n3 set src_agent_]

set temp [$n0 set src_agent_]
$temp install_connection [$cbr0 set fid_] 0 1 0 2 4 3 1
set temp [$n3 set src_agent_]
$temp install_connection [$cbr1 set fid_] 3 4 3 2 4

set null0 [new Agent/TCPSink]
set null1 [new Agent/TCPSink]

$ns attach-agent $n1 $null0
$ns attach-agent $n4 $null1


$ns connect $cbr0 $null0
$ns connect $cbr1 $null1


Where the route between nodes 0 and 1 is [0 2 4 3 1]



On Fri Feb 29 04:17:52 CET 2008, Sakthivel Subramanian 
<[EMAIL PROTECTED]> wrote:

> 
> Hi,Is source routing concept available in ns2 
> simulator...ie.,what i am
> trying to say is "the user can select his/her own route to send 
> the packet
> to destination...ie.,user can select ISP through which his packet 
> should
> sent.....Please help me friends..
> 



null

Reply via email to