Hi all,

I have been trying to implement a very simple web caching example on a 
simple wireless
topology. There are two nodes, one is the client and the other is the 
server. The nodes doesn´t move
and they are in the coverage area of the other.
But 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 scrip I used.

I have tried using some rtproto sentences and disabling wired routing.

It seems to be an error with the FullTCPAgent. The client send a GET but 
it never reach the server because
there is a problem with the ACKs but I don't know how to solve it.

I am using ns allinone 2.31

I would really appreciate any help,
Francisco


# ======================================================================
# Define options
# ======================================================================
set val(chan)           Channel/WirelessChannel    ;# channel type
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation 
model
set val(netif)          Phy/WirelessPhy            ;# network interface type
set val(mac)            Mac/802_11                 ;# MAC type
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type
set val(ll)             LL                         ;# link layer type
set val(ant)            Antenna/OmniAntenna        ;# antenna model
set val(ifqlen)         50                         ;# max packet in ifq
set val(nn)             2                          ;# number of mobilenodes
set val(rp)             DSDV                       ;# routing protocol

# ======================================================================
# Main Program
# ======================================================================


#
# Initialize Global Variables
#
set ns        [new Simulator]
set tracefd     [open simple.tr w]
set log        [open http.log w]
#$ns use-newtrace
$ns trace-all $tracefd

# set up topography object
set topo       [new Topography]

$topo load_flatgrid 1500 300

#
# Create God
#
create-god $val(nn)

#
#  Create the specified number of mobilenodes [$val(nn)] and "attach" them
#  to the channel.
#  Here two nodes are created : node(0) 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           
             
$ns node-config -wiredRouting 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_ 0.0    ;#servidor
$node_(0) set Y_ 150.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 10.0    ;#Cliente
$node_(1) set Y_ 150.0
$node_(1) set Z_ 0.0

#$ns rtproto Session

#Generador de páginas
set pgp [new PagePool/Math]
set tmp [new RandomVariable/Constant]
$tmp set val_ 1024        ;#Page size generator
$pgp ranvar-size $tmp

set tmp [new RandomVariable/Exponential]
$tmp set avg_ 5            ;#Page age generator
$pgp ranvar-age $tmp

set server [new Http/Server $ns $node_(0)]    ;#Crea un servidor en el nodo0
$server set-page-generator $pgp
$server log $log

set client [new Http/Client $ns $node_(1)]    ;#Crea un cliente en el nodo1
set tmp [new RandomVariable/Exponential]
$tmp set avg_ 5
$client set-interval-generator $tmp
$client set-page-generator $pgp
$client log $log

proc start-connection {} {
    global ns server client
   
    $client connect $server
    $client start-session $server $server
}

proc finish {} {
    global ns tracefd log
    $ns flush-trace
    flush $log
    close $log
    close $tracefd
    exit 0
}

set starttime 1
set stoptime 50
$ns at $starttime "start-connection"
$ns at $stoptime "finish"

#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
    $ns at $stoptime "$node_($i) reset";
}

puts "Starting Simulation..."
$ns run


num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
6.877574: FullTcpAgent::recv(_o59): bad ACK for our SYN:  [3:0.0>1.0] (hlen:40, 
dlen:20, seq:0, ack:21, flags:0x1a (<PSH,ACK,SYN>), salen:0, reason:0x0)
9.877710: FullTcpAgent::recv(_o59): bad ACK for our SYN:  [6:0.0>1.0] (hlen:40, 
dlen:20, seq:0, ack:21, flags:0x1a (<PSH,ACK,SYN>), salen:0, reason:0x4)
15.877190: FullTcpAgent::recv(_o59): bad ACK for our SYN:  [13:0.0>1.0] 
(hlen:40, dlen:20, seq:0, ack:21, flags:0x1a (<PSH,ACK,SYN>), salen:0, 
reason:0x4)
27.877130: FullTcpAgent::recv(_o59): bad ACK for our SYN:  [18:0.0>1.0] 
(hlen:40, dlen:20, seq:0, ack:21, flags:0x1a (<PSH,ACK,SYN>), salen:0, 
reason:0x4)


Reply via email to