Blocking Problem

 

[Description]

The following figure is from reference [1].

  

Node C is blocked due to the communication between node A and node B. Therefore, node D does not get any response to the RTS packets it sends and enters backoff.

In figure, node C receives both RTS and CTS and is therefore neither a hidden nor an exposed node. Therefore, we prefer to call this problem the blocking problem.

 

[Have to be done before simulation]

1.      Install NOAH routing protocol

2.      Disable ARP function (please refer to http://csie.nqu.edu.tw/smallko/ns2_old/arp.htm)

3.      Replace the file with mac-802_11.cc and mac-802_11.h  (mac/mac-802_11.cc mac/mac-802_11.h, remember only for ns-2.31 version)

4.      Recompile the ns.

 

If you don’t want to see the message, change the value of mydebug to 1 in mac/mac-802_11.cc and recompile ns again.

#define mydebug 0

 

[Tcl Script]

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)         100                        

set val(rp)                  NOAH

 

set ns [new Simulator]

 

#enable RTS/CTS

Mac/802_11 set RTSThreshold_        0

 

Mac/802_11 set dataRate_    11Mb

Mac/802_11 set basicRate_   1Mb

 

Antenna/OmniAntenna set X_ 0

Antenna/OmniAntenna set Y_ 0

Antenna/OmniAntenna set Z_ 1.5

Antenna/OmniAntenna set Gt_ 1.0

Antenna/OmniAntenna set Gr_ 1.0

 

Phy/WirelessPhy set CPThresh_ 10.0

Phy/WirelessPhy set CSThresh_ 2.81838e-9

Phy/WirelessPhy set RXThresh_ 6.88081e-9

Phy/WirelessPhy set bandwidth_ 2e6

Phy/WirelessPhy set Pt_ 0.281838

Phy/WirelessPhy set freq_ 9.14e+6

Phy/WirelessPhy set L_ 1.0

 

set f [open test.tr w]

$ns trace-all $f

$ns eventtrace-all

set nf [open test.nam w]

$ns namtrace-all-wireless $nf 500 500

 

set topo       [new Topography]

$topo load_flatgrid 500 500

create-god 4

set chan [new $val(chan)]

 

$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) \

                -channel $chan \

                -topoInstance $topo \

                -agentTrace ON \

                -routerTrace ON \

                -macTrace ON \

                -movementTrace OFF

 

for {set i 0} {$i < 4} {incr i} {

        set node_($i) [$ns node]

        $node_($i) random-motion 0

}

 

$node_(0) set X_ 40.0

$node_(0) set Y_ 50.0

$node_(0) set Z_ 0.0

$node_(1) set X_ 100.0

$node_(1) set Y_ 50.0

$node_(1) set Z_ 0.0

$node_(2) set X_ 70.0

$node_(2) set Y_ 140.0

$node_(2) set Z_ 0.0

$node_(3) set X_ 70.0

$node_(3) set Y_ 200.0

$node_(3) set Z_ 0.0

 

#define static routing

set cmd "[$node_(0) set ragent_] routing 4 0 0 1 1 2 2 3 2"

eval $cmd

 

set cmd "[$node_(1) set ragent_] routing 4 0 0 1 1 2 2 3 2"

eval $cmd

 

set cmd "[$node_(2) set ragent_] routing 4 0 0 1 1 2 2 3 3"

eval $cmd

 

set cmd "[$node_(3) set ragent_] routing 4 0 2 1 2 2 2 3 3"

eval $cmd

 

set phy2 [$node_(2) set netif_(0)]

$phy2 set CPThresh_ 5.0

 

set udp [new Agent/UDP]

$ns attach-agent $node_(1) $udp

set null [new Agent/Null]

$ns attach-agent $node_(0) $null

$ns connect $udp $null

set cbr [new Application/Traffic/CBR]

$cbr attach-agent $udp

$cbr set type_ CBR

$cbr set packet_size_ 150

$cbr set rate_ 5Mb

$cbr set random_ false

#only send out a packet from node 1 to node 0

$cbr set maxpkts_ 1

$ns at  1.5 "$cbr start"

$ns at 15.0 "$cbr stop"

 

set udp2 [new Agent/UDP]

$ns attach-agent $node_(3) $udp2

set null2 [new Agent/Null]

$ns attach-agent $node_(2) $null2

$ns connect $udp2 $null2

set cbr2 [new Application/Traffic/CBR]

$cbr2 attach-agent $udp2

$cbr2 set type_ CBR

$cbr2 set packet_size_ 1000

$cbr2 set rate_ 4Mb

$cbr2 set random_ false

#only send out a packet from node 3 to node 2

$cbr2 set maxpkts_ 1

$ns at  1.50109 "$cbr2 start"

$ns at 15.0 "$cbr2 stop"

 

for {set i 0} {$i < 3} {incr i} {

        $ns initial_node_pos $node_($i) 30

        $ns at 20.0 "$node_($i) reset";

}

 

$ns at 20.0 "finish"

$ns at 20.1 "puts \"NS EXITING...\"; $ns halt"

 

proc finish {} {

        global ns f nf val

        $ns flush-trace

        close $f

        close $nf

}

 

$ns run

 

[Results]

snap.jpg

[Explanation]

1: node 1 sends out a RTS packet to node 0

3: node 0 receives the RTS packet sent from node 1

4: node 2 also receive the RTS packet sent from node 1

5: node 0 sends out a CTS packet to node 1

7: node 1 receives the CTS packet sent from node 0

8: node 2 also receives the CTS packet sent from node 0

9: node 3 sends out a RTS packet to node 2

10: node 1 sends out a Data packet to node 0

11: node 2 receives the RTS packet from node 3 and the Data packet from node 1 almost at the same time. But due to the capture effect, the RTS packet wins. Node 2 receives the RTS packet (see 15) Blocking Problem: Node 2 is blocked due to the communication between node 1 and node 0. Therefore, node 3 does not get any response to the RTS packets it sends and enters backoff.

13. node 0 receives the Data packet sent from node 1.

16: node 0 sends out an ACK to node 1.

18: node 1 receives the ACK from node 0.

After the packet sending from node 1 to node 0, node 3 can send the packet to node 2 (see 20 to 33)

 

[Reference]

1.      Saikat Ray, Jeffrey Carruthers, and David Starobinski, ``RTS/CTS-induced Congestion in Ad-Hoc Wireless LANs,'' IEEE WCNC 2003, New Orleans, March 2003, pp. 1516-1521

 

Contact Information

Chih-Heng Ke

Email: smallko@gmail.com

Website: http://csie.nqu.edu.tw/smallko

 

Last modified data: 2009/07/03