[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

disconnecting a node from a LAN in ns




 
 Hi,
 
Sorry, I am sending this message again since it came back to me
undelivered.
 
 I created a LAN with say, 3 nodes using "make-lan" command in ns-2.1b5. I
 then initiated a TCP
 session (with FTP packets)  with an external node (connected to the LAN
 through another node) as the source and one of the LAN nodes as the sink.
 I have also attached the tcl script (to be compiled in ns-2.1b5)

 After the session starts, I am not able to make the "vlink" ( which
 connects the
 TCP sink and the LAN) down. I am able to obtain the id of this vlink but
 the command "$link(src_id:dst_id) down" does not help. But with this
 command I am able to make the link down only before the TCP session
  starts, not after that. 
 
In a nutshell I would like to disconnect a node from its LAN while a TCP
session is in progress ( with this node as the sink).

I would appreciate it if anybody can help me out of this problem,
 
 Thanx,
 
 Guru.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "Great minds discuss ideas, average minds discuss events, 
  small minds discuss people"
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ************************************************************
 Guruprasad Bhaskar
 Graduate student,
 Dept. of Electrical Engineering,
 University of Texas at Dallas

 Voice : (H) 972 671 0357  ;  (W) 972 883 2305
 
 Residence : 2400 Waterview Pkwy #326
             Richardson, TX-75080
 ************************************************************
 
 

proc down_link {lid} {
 
$lid down

}

proc in {} {

set ns_ [new Simulator]

$ns_ instvar link_
$ns_ instvar Vlink_


$ns_ trace-all [open guru.rands w]
$ns_ namtrace-all [open guru.nam w]

set n1 [$ns_ node] 
set n2 [$ns_ node] 
set n3 [$ns_ node] 
set n4 [$ns_ node] 
set n5 [$ns_ node] 
set r1 [$ns_ node]  
set r2 [$ns_ node]

set lan1 [$ns_ make-lan "$n1 $n2 $n3" 4Mb 2ms LL Queue/DropTail Mac/802_3]

set lan2 [$ns_ make-lan "$n4 $n5" 4Mb 2ms LL Queue/DropTail Mac/802_3]

$ns_ duplex-link $n1 $r1 4Mb 2ms DropTail
$ns_ duplex-link $r1 $n4 4Mb 2ms DropTail
$ns_ duplex-link $r2 $n4 4Mb 2ms DropTail
$ns_ duplex-link $r2 $n1 4Mb 2ms DropTail


set tcp_ [$ns_ create-connection TCP/Reno $n2 TCPSink $n5 0]
set source_ [$tcp_ attach-source FTP]

$ns_ at 4.0 "$link_([$lan2 id]:[$n5 id]) down"
$ns_ at 4.0 "$link_([$n5 id]:[$lan2 id]) down"

$ns_ at 0.04 "$source_ start"
$ns_ at 12.0 "$ns_ halt"
$ns_ run

}

in