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

[ns] What's wrong with my code?



Hi ns-users,

I'd like make a network configuration, in which 40 nodes are connected to 1
node (gateway)
that is connected to a bottleneck link (buffer size = 20), in turn.
The tcl code for this simulation is as follows.

# Create N nodes for TCPs
for {set i 0} {$i < 40} {incr i} {
set n($i) [$ns node]
}

# Create a gateway and a TCP sink
set n(40) [$ns node]
set n(41]) [$ns node]

# Create links between the TCP nodes and the gateway
for {set i 0} {$i < 40} {incr i} {
$ns duplex-link $n($i) $n(40) 10Mb 1ms DropTail
}

# Create link between the gateway and the sink
$ns duplex-link $n(40) $n(41) 1Mb 15ms Droptail
==================================
# Set up the buffer size of the link
$ns queue-limit $n(40) $n(41) 20

However, I cannot run the ns simulation
because of the error in creating link between the node 40 and 41.
Can anyone show me how to correct the error?
Thanks in advance,

Yongmin Choi