anyone please??? 


martini.spy wrote:
> 
> 
> Hello!
> I am trying to do a simple simulation with mobile ip and tcp and I do the
> same as in the scripts provided in the tutorial. However, the handovers
> don't happen as I would expect and traffic is sometimes redirected through
> the most distant base station, while packets' exchange completely stops
> from time to time, while an access point is very close to the mobile node.
> 
> Shouldn't the mobile node connect to the access point with the biggest
> signal power? In the mip-reg.cc there are no comparisons with the power
> received...
> 
> I would be very grateful if you could help me and give me any advice you
> have from your experience. I also post my code below, if anybody can take
> a look.
> Thank you very much in advance!
> Spyros
> 
> Code:
> 
> 
> set ns_        [new Simulator]
> 
> set opt(chan)       Channel/WirelessChannel
> set opt(prop)       Propagation/TwoRayGround
> set opt(netif)      Phy/WirelessPhy
> set opt(mac)        Mac/802_11
> set opt(ifq)        Queue/DropTail/PriQueue
> set opt(ll)         LL
> set opt(ant)        Antenna/OmniAntenna
> set opt(x)              1000   ;# X dimension of the topography
> set opt(y)              1000   ;# Y dimension of the topography
> set opt(ifqlen)         50            ;# max packet in ifq
> #set val(seed)           0.0
> set opt(rp)             DSDV                      ; # routing protocol
> set opt(nn)            1             ;# how many nodes are simulated
> set num_wired_nodes      2
> set num_bs_nodes         3 
> 
> set topo    [new Topography]
> 
> $ns_ node-config -addressType hierarchical
> 
> AddrParams set domain_num_ 4           ;# number of domains
> lappend cluster_num 2 1 1 1            ;# number of clusters in each
> domain
> AddrParams set cluster_num_ $cluster_num
> lappend eilastlevel  1 1 2 1 1                 ;# number of nodes in each
> cluster
> AddrParams set nodes_num_ $eilastlevel ;# of each domain
> 
> 
> # create trace object for ns and nam
> 
> set tracefd  [open tcp-mono.tr w]
> set namtrace [open tcp-mono.nam w]
> 
> $ns_ trace-all $tracefd
> $ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)
> 
> # define topology
> $topo load_flatgrid $opt(x) $opt(y)
> 
> 
> #create wired nodes
> set Server [$ns_ node 0.0.0]
> $Server set X_ 500.0
> $Server set Y_ 850.0
> $Server set Z_ 0.0
> 
> set W_node [$ns_ node 0.1.0]
> $W_node set X_ 500.0
> $W_node set Y_ 710.0
> $W_node set Z_ 0.0
> 
> set god_ [create-god $opt(nn)+3]
> 
> # Create channel #1 and #2
> set chan_1 [new $opt(chan)] ;#umts
> 
> #gia to  umts
> Mac/802_11 set dataRate_ 2.0Mb ;# UMTS data rate
> Phy/WirelessPhy set Pt_ 4.5099 ;# UMTS coverage: r=500m
> Phy/WirelessPhy set freq_ 2.175e9 ;# UMTS radio frequency
> 
> $chan_1 set delay 10ms
> Phy/WirelessPhy set bandwidth_ 384k
> 
> $ns_ node-config -mobileIP ON \
>          -adhocRouting $opt(rp) \
>                  -llType $opt(ll) \
>                  -macType $opt(mac) \
>                  -ifqType $opt(ifq) \
>                  -ifqLen $opt(ifqlen) \
>                  -antType $opt(ant) \
>                  -propType $opt(prop) \
>                  -phyType $opt(netif) \
>          -topoInstance $topo \
>          -agentTrace ON \
>                  -routerTrace OFF \
>                  -macTrace ON \
>                  -wiredRouting ON \
>          -channel $chan_1        
> 
> # Create BSs
> set BS_umts [$ns_ node 1.0.0]
> $BS_umts random-motion 0
> $BS_umts radius 500
> 
> $BS_umts set X_ 150.0
> $BS_umts set Y_ 610.0
> $BS_umts set Z_ 0.000000000000
> 
> $ns_ node-config -wiredRouting OFF
>  
> #dimioyrgia toy purina toy kinitoy komboy
> set MN [$ns_ node 1.0.1] 
> $MN random-motion 0 
>           
> $MN set X_ 160.0
> $MN set Y_ 530.0
> $MN set Z_ 0.0
> 
> set HAaddress [AddrParams addr2id [$BS_umts node-addr]]
> [$MN set regagent_] set home_agent_ $HAaddress
> 
> $ns_ node-config -wiredRouting ON
>  
> Mac/802_11 set dataRate_ 11.0Mb ;# 802.11b data rate
> Phy/WirelessPhy set bandwidth_ 5Mb
> 
> Phy/WirelessPhy set Pt_ 0.28183815
> #Phy/WirelessPhy set freq_ 914e+6
> 
> #dimioyrgia toy BS wlan
> set BS_wlan [$ns_ node 2.0.0]
> $BS_wlan random-motion 0
> $BS_wlan radius 250
> 
> $BS_wlan set X_ 500.0
> $BS_wlan set Y_ 610.0
> $BS_wlan set Z_ 0.000000000000
> 
> #gia to  umts
> Mac/802_11 set dataRate_ 2.0Mb ;# UMTS data rate
> Phy/WirelessPhy set Pt_ 4.5099 ;# UMTS coverage: r=500m
> Phy/WirelessPhy set freq_ 2.175e9 ;# UMTS radio frequency
> Phy/WirelessPhy set bandwidth_ 384k
> 
> set BS_umts2 [$ns_ node 3.0.0]                                           
> $BS_umts2 random-motion 0
> $BS_umts2 radius 500
> 
> $BS_umts2 set X_ 950.0
> $BS_umts2 set Y_ 610.0
> $BS_umts2 set Z_ 0.000000000000
> 
> $ns_ at 1.0 "$MN setdest 950.0 530.0 15.0"
> # create links between wired and BaseStation nodes
> $ns_ duplex-link $Server $W_node 50Mb 0.2ms DropTail
> $ns_ duplex-link-op $Server $W_node orient down
> 
> $ns_ duplex-link $W_node $BS_umts 50Mb 0.2ms DropTail
> $ns_ duplex-link-op $W_node $BS_umts orient down-left
> 
> $ns_ duplex-link $W_node $BS_wlan 50Mb 0.2ms DropTail
> $ns_ duplex-link-op $W_node $BS_wlan orient down
> 
> $ns_ duplex-link $W_node $BS_umts2 50Mb 0.2ms DropTail
> $ns_ duplex-link-op $W_node $BS_umts2 orient down-right
> 
> set tcp1 [new Agent/TCP]
> set sink1 [new Agent/TCPSink]
> 
> $ns_ attach-agent $Server $tcp1
> $ns_ attach-agent $MN $sink1
> 
> $ns_ connect $tcp1 $sink1
> 
> set ftp0 [new Application/FTP]
> $ftp0 attach-agent $tcp1
> 
> $ns_ at 0.5 "$ftp0 start"
> $ns_ at 42.5 "$MN setdest 105.0 530.0 15.0"
> $ns_ at 81.0 "$MN setdest 950.0 530.0 15.0"
> #$ns_ at 102.5 "$MN setdest 105.0 530.0 15.0"
> #$ns_ at 141.0 "$MN setdest 950.0 530.0 15.0"
> 
> $ns_ at  100 "stop";
> $ns_ at  100 "puts \"NS EXITING...\" ; $ns_ halt"
>  
> proc stop {} {
>     global ns_ tracefd
>     $ns_ flush-trace
>     close $tracefd
> exec nam tcp-mono.nam &
>     exit 0
> }
> 
> $ns_ run
> 
> 
> 
> 
> 
>       
> ___________________________________________________________ 
> Χρησιμοποιείτε Yahoo!; 
> Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail 
> διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών 
> μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-mobile-ip-tp22647389p22656146.html
Sent from the ns-users mailing list archive at Nabble.com.


Reply via email to