[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
newbie: need help joining lans
g'day,
i'm trying to simulate two lans joined by a duplex link, but am having
a bit of trouble. the first packet makes it from lan A to lan B, but
never seems to get any responding packet. i guess this is a routing
thing, but i'm at a loss to work out what's going on or how i can fix it.
the script is attached - any help would be *greatly* appreciated.
thanks
p
--
Peter Lees * Cluster Technology Consultant * Sun Microsystems Asia-Pacific
[email protected] * tel: +61 2 9466 9441 * fax: +61 2 9466 9415
## copyright disclosure: incorporates code from ns example scripts and
## documentation.
## setup environment #########################################################
Agent/TCP/FullTcp set segsize_ 1460
Http set TRANSPORT_ FullTcp
set ns [new Simulator]
set namfile [open "2lans.nam" w]
set log [open "2lans.log" w]
$ns namtrace-all $namfile
## create the network ########################################################
# home network
set n1 [$ns node]
set n2 [$ns node]
$ns make-lan "$n1 $n2" 10Mb 2ms LL Queue/DropTail Mac/802_3 Channel
# work network
set n3 [$ns node]
set n4 [$ns node]
$ns make-lan "$n3 $n4" 100Mb 2ms LL Queue/DropTail Mac/802_3 Channel
# dialup line from home to work
#$ns duplex-link $n2 $n3 36kb 10ms DropTail
$ns duplex-link $n2 $n3 5Mb 5ms DropTail
$ns rtproto Static $n2 $n3
## create the server & client ################################################
# use pagepool/compmath to create a compound page, which includes
# several embedded object (eg gifs, etc)
set pgpool [ new PagePool/CompMath ]
$pgpool set main_size_ 1024 ;# Size of main page =~ 1k
$pgpool set comp_size_ 5000 ;# Size of embedded object =~ 5k
$pgpool set num_pages_ 3 ;# Number of objects per compound page
# set random page lifetime (used by cache) to 100 sec
# embedded objects last forever
set tmp [new RandomVariable/Constant]
$tmp set val_ 100
$pgpool ranvar-main-age $tmp
# create the server on webserver
set server [new Http/Server/Compound $ns $n4]
$server set-page-generator $pgpool
$server log $log
set client [new Http/Client/Compound $ns $n1]
set tmp [new RandomVariable/Constant]
$tmp set val_ 10
$client set-interval-generator $tmp
$client set-page-generator $pgpool
$client log $log
## start-connection procedure ################################################
proc start-connection {} {
global ns server client
$client connect $server
# Comment out following line to continuously send requests
$client start-session $server $server
# Comment out following line to send out ONE request
# DON't USE with start-session!!!
# set pageid $server:[lindex [$client gen-request] 1]
# $client send-request $server GET $pageid
}
## finish procedure ##########################################################
proc finish {} {
global ns namfile client server
$client stop-session $server
$ns flush-trace
close $namfile
exec nam 2lans.nam &
exit 0
}
## run script ################################################################
$ns at 1.0 "start-connection"
$ns at 50.0 "finish"
$ns run