| 1 |
# This is a simple ns script. Comments start with #. |
|---|
| 2 |
set ns [new Simulator] |
|---|
| 3 |
source tb_compat.tcl |
|---|
| 4 |
|
|---|
| 5 |
set nodeA [$ns node] |
|---|
| 6 |
set nodeB [$ns node] |
|---|
| 7 |
set nodeC [$ns node] |
|---|
| 8 |
set nodeD [$ns node] |
|---|
| 9 |
|
|---|
| 10 |
# Use virtual nodes |
|---|
| 11 |
tb-set-hardware $nodeA pcvm |
|---|
| 12 |
tb-set-hardware $nodeB pcvm |
|---|
| 13 |
tb-set-hardware $nodeC pcvm |
|---|
| 14 |
tb-set-hardware $nodeD pcvm |
|---|
| 15 |
|
|---|
| 16 |
set link0 [$ns duplex-link $nodeB $nodeA 30Mb 50ms DropTail] |
|---|
| 17 |
tb-set-link-loss $link0 0.01 |
|---|
| 18 |
|
|---|
| 19 |
set lan0 [$ns make-lan "$nodeD $nodeC $nodeB " 100Mb 0ms] |
|---|
| 20 |
|
|---|
| 21 |
# XXX cannot change the OS |
|---|
| 22 |
#tb-set-node-os $nodeA FBSD-STD |
|---|
| 23 |
#tb-set-node-os $nodeC RHL-STD |
|---|
| 24 |
|
|---|
| 25 |
$ns rtproto Static |
|---|
| 26 |
|
|---|
| 27 |
# Go! |
|---|
| 28 |
$ns run |
|---|