Unfairness Problem in wireless Network: Three Pair Scenario

 

[Description]

In this scenario, nodes 1 and 5 are fully independent and node 3 is in the carrier sensing range of nodes 1 and 5. With 802.11, the backoff decrement of node 3 can only take place when nodes 1 and 5 are in their silence period. As these two nodes are not synchronized, the silence period for node 3 is rare and the probability for node 3 to access the medium is low. (see reference 1 and 2)

 

[Have to be done before simulation]

1.      Download the measure.rar. And decompress it and then put the decompressed measure folder under ns-allinone-2.x/ns-2.x/

2.      Modify the Makefile.in. Add measure/mtcpsink.o measure/mudp.o measure/mudpsink.o \ in the OBJ_CC

3.      Recompile the ns (use ./configure ; make clean; make depend; make)

 

[Tcl Script]

# This script is created by NSG2 beta1

# <http://wushoupong.googlepages.com/nsg>

 

#===================================

#     Simulation parameters setup

#===================================

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)     6                          ;# number of mobilenodes

set val(rp)     AODV                       ;# routing protocol

set val(x)      700                      ;# X dimension of topography

set val(y)      500                      ;# Y dimension of topography

set val(stop)   11.0                         ;# time of simulation end

 

#===================================

#        Initialization        

#===================================

#Create a ns simulator

set ns [new Simulator]

 

#Setup topography object

set topo       [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

 

#Open the NS trace file

set tracefile [open out.tr w]

$ns trace-all $tracefile

 

#Open the NAM trace file

set namfile [open out.nam w]

$ns namtrace-all $namfile

$ns namtrace-all-wireless $namfile $val(x) $val(y)

set chan [new $val(chan)];#Create wireless channel

 

Mac/802_11 set dataRate_   11Mb

Mac/802_11 set basicRate_   1Mb

 

#===================================

#     Mobile node parameter setup

#===================================

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

                -routerTrace   OFF \

                -macTrace      ON \

                -movementTrace OFF

 

#===================================

#        Nodes Definition       

#===================================

#Create 6 nodes

set n0 [$ns node]

$n0 set X_ 200

$n0 set Y_ 400

$n0 set Z_ 0.0

$ns initial_node_pos $n0 20

set n1 [$ns node]

$n1 set X_ 500

$n1 set Y_ 400

$n1 set Z_ 0.0

$ns initial_node_pos $n1 20

set n2 [$ns node]

$n2 set X_ 800

$n2 set Y_ 400

$n2 set Z_ 0.0

$ns initial_node_pos $n2 20

set n3 [$ns node]

$n3 set X_ 200

$n3 set Y_ 200

$n3 set Z_ 0.0

$ns initial_node_pos $n3 20

set n4 [$ns node]

$n4 set X_ 500

$n4 set Y_ 200

$n4 set Z_ 0.0

$ns initial_node_pos $n4 20

set n5 [$ns node]

$n5 set X_ 800

$n5 set Y_ 200

$n5 set Z_ 0.0

$ns initial_node_pos $n5 20

 

#===================================

#        Agents Definition       

#===================================

#Setup a UDP connection

set udp0 [new Agent/mUDP]

$udp0 set_filename sd0

$ns attach-agent $n0 $udp0

set null3 [new Agent/mUdpSink]

$null3 set_filename rd0

$ns attach-agent $n3 $null3

$ns connect $udp0 $null3

$udp0 set packetSize_ 2000

 

#Setup a UDP connection

set udp1 [new Agent/mUDP]

$udp1 set_filename sd1

$ns attach-agent $n1 $udp1

set null4 [new Agent/mUdpSink]

$null4 set_filename rd1

$ns attach-agent $n4 $null4

$ns connect $udp1 $null4

$udp1 set packetSize_ 2000

 

#Setup a UDP connection

set udp2 [new Agent/mUDP]

$udp2 set_filename sd2

$ns attach-agent $n2 $udp2

set null5 [new Agent/mUdpSink]

$null5 set_filename rd2

$ns attach-agent $n5 $null5

$ns connect $udp2 $null5

$udp2 set packetSize_ 2000

 

 

#===================================

#        Applications Definition       

#===================================

#Setup a CBR Application over UDP connection

set cbr0 [new Application/Traffic/CBR]

$cbr0 attach-agent $udp0

$cbr0 set packetSize_ 1500

$cbr0 set rate_ 5.0Mb

$cbr0 set random_ null

$ns at 1.0 "$cbr0 start"

$ns at 10.0 "$cbr0 stop"

 

#Setup a CBR Application over UDP connection

set cbr1 [new Application/Traffic/CBR]

$cbr1 attach-agent $udp1

$cbr1 set packetSize_ 1500

$cbr1 set rate_ 5.0Mb

$cbr1 set random_ null

$ns at 1.5 "$cbr1 start"

$ns at 10.0 "$cbr1 stop"

 

#Setup a CBR Application over UDP connection

set cbr2 [new Application/Traffic/CBR]

$cbr2 attach-agent $udp2

$cbr2 set packetSize_ 1500

$cbr2 set rate_ 5.0Mb

$cbr2 set random_ null

$ns at 1.0 "$cbr2 start"

$ns at 10.0 "$cbr2 stop"

 

 

#===================================

#        Termination       

#===================================

#Define a 'finish' procedure

proc finish {} {

    global ns tracefile namfile

    $ns flush-trace

    close $tracefile

    close $namfile

    #exec nam out.nam &

    exit 0

}

for {set i 0} {$i < $val(nn) } { incr i } {

    $ns at $val(stop) "\$n$i reset"

}

$ns at $val(stop) "$ns nam-end-wireless $val(stop)"

$ns at $val(stop) "finish"

$ns at $val(stop) "puts \"done\" ; $ns halt"

$ns run

 

[Result]

snap.jpg

After simulation, you can get the receiver trace file rd0, rd1, and rd2.

 

Download the measure-throughput.pl to measure the throughput.

1.jpg

2.jpg

3.jpg

From the simulation results, we can see that the throughputs of flow 1 and flow 3 are very similar. But the throughput of flow 2 is low compared to the flow 1 and flow3.

 

[Reference]

1.       Impact of Heavy Traffic Beyond Communication Range in Multi-Hops Ad-Hoc Networks

 

2.  Tahiry Razafindralambo and Isabelle Guérin-Lassous. Increasing Fairness and Efficiency using the MadMac Protocol in Ad Hoc Networks. In IFIP Networking, pages 403-414, May 2006

 

[Contact information]

Chih-Heng Ke

smallko@gmail.com

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

 

Last modified date:2009/07/08