[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] can't send UDP packets between two base station nodes



Hi
I have the folowing Mobile IP scenario where I try to send data from the
wired node W(1) to the base station node FA1 via the other base station
node HA, but the packets only make it to the HA (I can see that in the
trace file). If I instead create HA and FA1 as normal nodes instead of
base staion nodes, there is no problem. For some reason, I can't send
data between two base staion nodes. Could anybody please help me out
with this problem??
I'm using  ns-2.1b7 and the OS is LINUX (redhat 6.2).

thanks
Babak

## wireless-mobileIP-simulation
#                       o W0                 WIRED NODES
#                       |
#                       o W1
#                       |
#                       |                 
#--*--*--*--*--*--*-    o     --*-*-*-*-*-*-*-
#                      HA                   
#                      / \                basestation nodes
#                     /   \               (home agent and foreign
agents)
#                   o      o         
#                  FA1     FA2
#
#                 o
#                 MN                WIRELESS NODE MOVING FROM FA1 TO
FA2.
#

#intial setup - set addressing to hierarchical
set ns [new Simulator]
$ns set-address-format hierarchical

AddrParams set domain_num_ 3                      ;#number of domains
lappend cluster_num 2 1 1                         ;#number of clusters
in each doamin
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 2 1                       ;#number of nodes in
each cluster
AddrParams set nodes_num_ $eilastlevel                   

## setup the wired nodes
set temp {0.0.0 0.1.0}
for {set i 0} {$i < $num_wired_nodes} {incr i} {
    set W($i) [$ns node [lindex $temp $i]] 
}

## setup ForeignAgent and HomeAgent nodes
set HA [create-base-station-node 1.0.0]
set FA1 [create-base-station-node 2.0.0]

#provide some co-ord (fixed) to these base-station nodes.
$HA set X_ 1.000000000000
$HA set Y_ 2.000000000000
$HA set Z_ 0.000000000000

$FA1 set X_ 650.000000000000
$FA1 set Y_ 650.000000000000
$FA1 set Z_ 0.000000000000

#create links between wired and BaseStation nodes
$ns duplex-link $W(0) $W(1) 5Mb 2ms DropTail 
$ns duplex-link $W(1) $HA 5Mb 2ms DropTail
$ns duplex-link $HA $FA1 5Mb 2ms DropTail

set udp_(0) [new Agent/UDP]
$ns attach-agent $W(1) $udp_(0)
set null_(0) [new Agent/Null]
$ns attach-agent $FA1 $null_(0)
$ns connect $udp_(0) $null_(0)
set cbr_(0) [new Application/Traffic/CBR]
$cbr_(0) set packetSize_ 200
$cbr_(0) set interval_ 2.0
#$cbr_(0) set random_ 1
$cbr_(0) set maxpkts_ 1000
$cbr_(0) attach-agent $udp_(0)
$ns at $opt(cbr-start) "$cbr_(0) start"