[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns]: Problem when using TORA & Web Caching
Hi all,
I have been trying to implement the web caching example on a simple wireless
topology that used TORA as the ad-hoc routing protocol. But, surprisingly it
didnt work, though it worked fine when I used a wired toplogy, or using the
wireless toplogy with an FTP application, below is the script I used & the
error msgs I have got.
I would really appreciate any help,
Mohamed
# ======================================================================
# Define options
# ======================================================================
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(ifqlen) 50
set val(nn) 3
set val(rp) TORA
#
# Initialize Global Variables
#
set ns_ [new Simulator]
$ns_ rtproto Session
set tracefd [open simple.tr w]
set log [open http.log w]
$ns_ trace-all $tracefd
# set up topography object
set topo [new Topography]
$topo load_flatgrid 500 500
#
# Create God
#
create-god $val(nn)
#
# Create the specified number of mobilenodes [$val(nn)] and #"attach" them
# to the channel.
# Here three nodes are created : node(0), node(1) and node(1)
# configure node
$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}
#
# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
#
$node_(0) set X_ 2.0
$node_(0) set Y_ 2.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 3.0
$node_(1) set Y_ 3.0
$node_(1) set Z_ 0.0
$node_(2) set X_ 4.0
$node_(2) set Y_ 4.0
$node_(2) set Z_ 0.0
# Use PagePool/Math
set pgp [new PagePool/Math]
set tmp [new RandomVariable/Constant] ;# Size generator
$tmp set val_ 1024 ;# average page size
$pgp ranvar-size $tmp
set tmp [new RandomVariable/Exponential] ;# Age generator
$tmp set avg_ 5 ;# average page age
$pgp ranvar-age $tmp
set server [new Http/Server $ns_ $node_(2)]
$server set-page-generator $pgp
$server log $log
set cache [new Http/Cache $ns_ $node_(1)]
$cache log $log
set client [new Http/Client $ns_ $node_(0)]
set tmp [new RandomVariable/Exponential] ;# Poisson process
$tmp set avg_ 5 ;# average request interval
$client set-interval-generator $tmp
$client set-page-generator $pgp
$client log $log
proc start-connection {} {
global ns_ server cache client
$client connect $cache
$cache connect $server
$client start-session $cache $server
}
#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at 150.0 "$node_($i) reset";
}
$ns_ at 10 "start-connection"
$ns_ at 150.0 "stop"
$ns_ at 150.01 "puts \"NS EXITING...\" ; $ns_ halt"
proc stop {} {
global ns_ tracefd log
$ns_ flush-trace
flush $log
close $tracefd
close $log
}
puts "Starting Simulation..."
$ns_ run
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
Starting Simulation...
14.371121: FullTcpAgent::recv(_o79): bad ACK (21) for our SYN(1)
14.372529: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
20.368458: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
20.370829: FullTcpAgent::recv(_o79): bad ACK (21) for our SYN(1)
20.372037: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
32.368458: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
32.370829: FullTcpAgent::recv(_o79): bad ACK (21) for our SYN(1)
32.372037: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
56.368458: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
56.370829: FullTcpAgent::recv(_o79): bad ACK (21) for our SYN(1)
56.372437: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
104.368458: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
104.370829: FullTcpAgent::recv(_o79): bad ACK (21) for our SYN(1)
104.372197: FullTcpAgent::recv(_o82) got packet lacking ACK (seq 21)
NS EXITING...
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com