Commit 7e8453c2 authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Added buddycache, ping, and trafgen tests.

parent a8fcb408
This is the buddycache experiment from Brandeis University. It's a LAN of
7 nodes, one of which, or, has a delay.
Contact for the original experiment is:
Liuba Shrira
liuba@cs.brandeis.edu
source tb_compat.tcl
set ns [new Simulator]
set fe1 [$ns node]
set fe2 [$ns node]
set fe3 [$ns node]
set fe4 [$ns node]
set fe5 [$ns node]
set proxy [$ns node]
set or [$ns node]
set lan0 [$ns make-lan "$fe1 $fe2 $fe3 $fe4 $fe5 $proxy $or" 100Mb .1ms]
tb-set-node-lan-delay $or $lan0 20ms
tb-set-node-os $fe1 RHL62-STD
tb-set-node-os $fe2 RHL62-STD
tb-set-node-os $fe3 RHL62-STD
tb-set-node-os $fe4 RHL62-STD
tb-set-node-os $fe5 RHL62-STD
tb-set-node-os $or RHL62-STD
tb-set-node-os $proxy RHL62-STD
$ns run
tb_prerun("tbprerun",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbend",0);
Very basic ping experiment.
source tb_compat.tcl
set ns [new Simulator]
# Set up two nodes, one called ping, and one called echo
set ping [$ns node]
set echo [$ns node]
# Now we define the characteristics of the link between
# the nodes - We want a 2-way link between the ping and
# echo nodes, with a bandwith of 100MB, and a delay in
# each direction of 150 ms
$ns duplex-link $ping $echo 100Mb 150ms DropTail
# Set OSes for the nodes
tb-set-node-os ping FBSD40-STD
tb-set-node-os echo MAC-PINGREPLY
tb-set-ip ping 192.168.101.1
tb-set-ip echo 192.168.101.2
# And away we go...
$ns run
tb_prerun("tbprerun",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbend",0);
Basic test of the traffic generation code.
Note: this file is designed to run with NS as well and includes some 'at'
statements that cause parser warnings.
# Simple 5 node setup: Client, server and router, with CBR cross traffic
# Server
# ^
# |
# V
# Send <-> Router <-> Consume
# ^
# |
# V
# Client
#
# To see something interesting, start up the expt, then do a flood ping
# from client to server (see /users/newbold/linktest). You can also log
# into the router and tcpdump to see the traffic going through.
source tb_compat.tcl
set ns [new Simulator]
set send [$ns node]
set consume [$ns node]
set router [$ns node]
set client [$ns node]
set server [$ns node]
set client-lan [$ns make-lan "$send $router $client" 100Mb 1ms]
set server-lan [$ns make-lan "$consume $server $router" 100Mb 1ms]
tb-set-node-os $router FBSD40-STD
tb-set-node-startup $router /users/newbold/trafgen/fbsd-router-startup
tb-set-node-os $client FBSD40-STD
tb-set-node-startup $client /users/newbold/trafgen/clientroutecmd
tb-set-node-os $server FBSD40-STD
tb-set-node-startup $server /users/newbold/trafgen/serverroutecmd
########## Magic code ###############
#Create a UDP agent and attach it to node send
set udp0 [new Agent/UDP]
$ns attach-agent $send $udp0
# Create a CBR traffic source and attach it to udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 1024
$cbr0 set rate_ 100Mbps
$cbr0 attach-agent $udp0
set null0 [new Agent/Null]
$ns attach-agent $consume $null0
$ns connect $udp0 $null0
$ns at 0.00001 "$cbr0 start"
$ns at 0.00500 "$cbr0 stop"
#####################################
$ns run
tb_prerun("tbprerun",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbend",0);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment