EIFS Problem

 

[Description-Large EIFS Problem]


After the completion of the ACK, before node A backsoff by a random period, it has to defer by EIFS duration rather than by DIFS as done by the other nodes (e.g., nodes B andC). Since EIFS is equal to SIFS + TxTime (ACK) + DIFS, the deferment at node A is certainly of much longer duration than that at the other nodes. We call this large-EIFS problem because the EIFS value is larger than it should be to reflect the state of the medium. In fact, the EIFS value should be equal to DIFS in this case.

 

Please refer to [1] for more information.

 

[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

# the Transmission Range (TR) is 120m, and the Sensing Range (SR) is 150 m

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 3

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 < 3} {incr i} {

        set node_($i) [$ns node]

        $node_($i) random-motion 0

}

 

# nodes 0 and 2 out of TR but within the SR of each other.

$node_(0) set X_ 30.0

$node_(0) set Y_ 30.0

$node_(0) set Z_ 0.0

$node_(1) set X_ 130.0

$node_(1) set Y_ 30.0

$node_(1) set Z_ 0.0

$node_(2) set X_ 170.0

$node_(2) set Y_ 30.0

$node_(2) set Z_ 0.0

 

#define static routing

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

eval $cmd

 

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

eval $cmd

 

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

eval $cmd

 

set udp [new Agent/UDP]

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

set null [new Agent/Null]

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

$ns connect $udp $null

set cbr [new Application/Traffic/CBR]

$cbr attach-agent $udp

$cbr set type_ CBR

$cbr set packet_size_ 1000

$cbr set rate_ 5Mb

$cbr set random_ false

$cbr set maxpkts_ 1

$ns at  1.50 "$cbr start"

$ns at 15.0 "$cbr stop"

 

set udp2 [new Agent/UDP]

$ns attach-agent $node_(1) $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_ 5Mb

$cbr2 set random_ false

$cbr2 set maxpkts_ 2

$ns at  1.5 "$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

 

[Result]

 snap.jpg

Node 1 sends out a RTS packet to node 2. Then node 2 replies a CTS packet to node 1. At the same time, node 0 gets the CTS packet. But it is in a Sensing Range. So it is an error packet. Node 0 needs to wait for EIFS (see 1). Following node 1 sends the Data packet to node 2. Node 2 then replies an ACK back to node 1. At the same time, node 0 gets this ACK. Again, this ACK is in a SR. Node 0 needs to wait for EIFS (see 2). After this transmission, node 1 needs to wait for  DIFS and backoff time, and then it can send out RTS packet again. For node 0, it needs to wait for EIFS and backoff time. So node 1 wins. It can send out the RTS (see 4).

 

[Homework]

The reader can try to measure the throughput for the flow from node 0 to node 1 and the flow from node 1 to node 2.

 

[Description-Small EIFS Problem]

Node D is out of the SR of A, node D cannot hear this Data frame and thus it determines that the medium be idle though in fact it is busy. Moreover, since the EIFS value is much smaller than the transmission time of the Data frame, after deferring for the EIFS duration, node D backs-off and then sends out a frame even though node A is still transmitting the Data frame. The two transmissions result in a collision at node B and thus node B discards the frames. Likewise, due to symmetry in the topology, node C is also likely to drop the Data frame of a FES(D,C), explaining why the throughputs degrade so much. We call this the small-EIFS problem because the EIFS value is smaller than it should be to reflect the state of the medium.

 

[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_     1Mb

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

# the Transmission Range (TR) is 120m, and the Sensing Range (SR) is 150 m

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_ 30.0

$node_(0) set Y_ 30.0

$node_(0) set Z_ 0.0

$node_(1) set X_ 140.0

$node_(1) set Y_ 30.0

$node_(1) set Z_ 0.0

$node_(2) set X_ 250.0

$node_(2) set Y_ 30.0

$node_(2) set Z_ 0.0

$node_(3) set X_ 280.0

$node_(3) set Y_ 30.0

$node_(3) set Z_ 0.0

 

#define static routing

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

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 1 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 udp [new Agent/UDP]

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

set null [new Agent/Null]

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

$ns connect $udp $null

set cbr [new Application/Traffic/CBR]

$cbr attach-agent $udp

$cbr set type_ CBR

$cbr set packet_size_ 2000

$cbr set rate_ 5Mb

$cbr set random_ false

$cbr set maxpkts_ 1

$ns at  1.495 "$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_ 100

$cbr2 set rate_ 1k

$cbr2 set random_ false

$cbr2 set maxpkts_ 1

$ns at  1.5 "$cbr2 start"

$ns at 15.0 "$cbr2 stop"

 

for {set i 0} {$i < 4} {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

 

[Result]

 snap.jpg

 

[Reference]

1.     Zhifei Li, Sukumar Nandi, and Anil K. Gupta, “Improving MAC Performance in Wireless Ad-Hoc Networks Using Enhanced Carrier Sensing (ECS)”, IFIP Networking 2004

 

[Contact information]

Chih-Heng Ke

smallko@gmail.com

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

 

Last modified date:2009/07/06