basic.ns 515 Bytes
Newer Older
1 2
# This is a simple ns script. Comments start with #.
set ns [new Simulator]                  
3
source tb_compat.tcl
4

5 6 7 8
set nodeA [$ns node]
set nodeB [$ns node]
set nodeC [$ns node]
set nodeD [$ns node]
9

10 11 12 13
set link0 [$ns duplex-link $nodeB $nodeA 30Mb 50ms DropTail]
tb-set-link-loss $link0 0.01

set lan0 [$ns make-lan "$nodeD $nodeC $nodeB " 100Mb 0ms]
14 15

# Set the OS on a couple.
16 17
tb-set-node-os $nodeA FBSD-STD
tb-set-node-os $nodeC RHL-STD         
18

19
$ns rtproto Static
20 21 22

# Go!
$ns run