nsfile.ns 1.13 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
source tb_compat.tcl

set ns [new Simulator]

set node0 [$ns node]
set node1 [$ns node]
set node2 [$ns node]

set lan0 [$ns make-lan "$node0 $node1 $node2" 100Mb 0ms]

tb-set-lan-loss $lan0 0.2
tb-set-node-lan-delay $node0 $lan0 100ms
tb-set-node-lan-bandwidth $node0 $lan0 20Mb
tb-set-node-lan-loss $node0 $lan0 0.4
tb-set-node-lan-params $node1 $lan0 150ms 30Mb 0.0

set node3 [$ns node]

set link0 [$ns duplex-link $node0 $node3 100Mb 0ms DropTail]

tb-set-link-loss $link0 0.1

set node4 [$ns node]

$ns duplex-link $node4 $node0 100Mb 0ms DropTail
tb-set-link-loss $node4 $node0 0.025

tb-set-ip $node4 1.0.4.1
tb-set-ip-interface $node0 $node4 1.0.0.1
tb-set-ip-link $node0 $link0 1.0.0.2
tb-set-ip-lan $node0 $lan0 1.0.0.3

set s5 [$ns node]
set s6 [$ns node]
$ns make-lan "$s5 $s6 $node4" 100Mb 0ms

37
38
tb-set-hardware $s5 pc
tb-set-hardware $s6 pc
39
40
41
42
tb-set-hardware $node4 pc

tb-set-node-os $node4 MYOS
tb-set-node-cmdline $node4 "my command line"
43
tb-set-node-rpms $node4 /my /node /rpms
44
tb-set-node-startup $node4 "my node startup"
45
tb-set-node-tarfiles $node4 /dira /tara /dirb /tarb /dirc /tarc
46
tb-set-node-failure-action $node4 nonfatal
47

48
$ns run