elabinelab.ns 1.07 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
source tb_compat.tcl

set ns [new Simulator]

set maxpcs @MAXPCS@
set security_level @SECURITY_LEVEL@

set myboss [$ns node]
set myops  [$ns node]

tb-set-hardware $myboss pc2000
12
tb-set-hardware $myops  pc850
13
14
15
16
17
18
19
20
21
22
23
24

tb-elab-in-elab 1
tb-set-node-inner-elab-role $myboss boss
tb-set-node-inner-elab-role $myops  ops

set lanstr "myboss myops "
for {set i 1} {$i <= $maxpcs} {incr i} {
	set name "mypc${i}"
	set $name [$ns node]
	append lanstr "[set $name] "
	tb-set-node-os [set $name] FBSD-STD
	tb-set-node-inner-elab-role [set $name] node
25
#	tb-set-hardware [set $name] pc600
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
}
set publiclan [$ns make-lan $lanstr 100Mb 0ms]

tb-set-ip-lan $myboss $publiclan 10.200.1.70
tb-set-ip-lan $myops  $publiclan 10.200.1.74
for {set i 1} {$i <= $maxpcs} {incr i} {
	set name "mypc${i}"
	tb-set-ip-lan [set $name] $publiclan 10.200.1.$i
}

tb-set-node-os $myboss FBSD410-UPDATE
tb-set-node-cmdline $myboss /kernel.linkdelay
tb-set-node-os $myops  FBSD410-UPDATE

if {$security_level >= 2} {
	# Set up a firewall
	set fw [new Firewall $ns]
	$fw set-type ipfw2-vlan
44
	$fw set-style open
45
46
47
48
49
}

# No routing! 
$ns run