It seems that the Modulation Scheme of 802.11Ext doesn't work well.
The valid modulation is not set when the following values are changed.

Mac/802_11Ext set BasicModulationScheme_ 0       (--> 1 or 2 or 3)
Phy/WirelessPhyExt set BasicModulationScheme_ 0  (--> 1 or 2 or 3)

The package version is ns 2.34. I don't try ns 3.X.
 - Package: ns 2.34
 - OS: FreeBSD 7.2-RELEASE-p4 #0: Fri Oct 30 16:26:00 JST 2009


[Example]

The PHY_DBG tracing both BasicModulationScheme = 0 and 3.
# This trace uses the sample tcl code attached below.

(Case A) BasicModulationScheme = 0

Mod_Scheme is always BPSK.

L 2.00003 0 PHY SendDown
L 2.00003 0 PHY PHYState 0 -> 3
L 2.00003 1 PHY Sendup Id: 10 Pr: 35.684349 PL: 35.684429 SINR: 448200.865032 
TXTIME: 0.001396
L 2.00003 1 PHY PHYState 0 -> 1
L 2.00005 1 PHY Mod_Scheme : = BPSK threshold 3.162300
L 2.00005 1 PHY PHYState 1 -> 2
L 2.00142 0 PHY PHYState 3 -> 0
L 2.00142 0 PHY PMX Power: 100000000.000080 -> 0.000080
L 2.00142 1 PHY PMX Power: 35.684429 -> 0.000080
L 2.00142 1 PHY PHYState 2 -> 0
L 2.00144 1 PHY SendDown
L 2.00144 1 PHY PHYState 0 -> 3
L 2.00144 0 PHY Sendup Id: 0 Pr: 19.551215 PL: 19.551295 SINR: 245566.242300 
TXTIME: 0.000044
L 2.00144 0 PHY PHYState 0 -> 1
L 2.00146 0 PHY Mod_Scheme : = BPSK threshold 3.162300
L 2.00146 0 PHY PHYState 1 -> 2
L 2.00148 1 PHY PHYState 3 -> 0
L 2.00148 1 PHY PMX Power: 100000000.000080 -> 0.000080
L 2.00148 0 PHY PMX Power: 19.551295 -> 0.000080
L 2.00148 0 PHY PHYState 2 -> 0


(Case B) BasicModulationScheme = 3

Mod_Scheme of DATA frame is always BPSK and the other(ACK frame)
is always QAM64. I think the both modulations should be QAM64 here.

L 2.00003 0 PHY SendDown
L 2.00003 0 PHY PHYState 0 -> 3
L 2.00003 1 PHY Sendup Id: 10 Pr: 35.684349 PL: 35.684429 SINR: 448200.865032 
TXTIME: 0.001396
L 2.00003 1 PHY PHYState 0 -> 1
L 2.00005 1 PHY Mod_Scheme : = BPSK threshold 3.162300
L 2.00005 1 PHY PHYState 1 -> 2
L 2.00142 0 PHY PHYState 3 -> 0
L 2.00142 0 PHY PMX Power: 100000000.000080 -> 0.000080
L 2.00142 1 PHY PMX Power: 35.684429 -> 0.000080
L 2.00142 1 PHY PHYState 2 -> 0
L 2.00144 1 PHY SendDown
L 2.00144 1 PHY PHYState 0 -> 3
L 2.00144 0 PHY Sendup Id: 0 Pr: 19.551215 PL: 19.551295 SINR: 245566.242300 
TXTIME: 0.000024
L 2.00144 0 PHY PHYState 0 -> 1
L 2.00146 0 PHY Mod_Scheme : = QAM64 threshold 316.227800
L 2.00146 0 PHY PHYState 1 -> 2
L 2.00146 1 PHY PHYState 3 -> 0
L 2.00146 1 PHY PMX Power: 100000000.000080 -> 0.000080
L 2.00146 0 PHY PMX Power: 19.551295 -> 0.000080
L 2.00146 0 PHY PHYState 2 -> 0


[My workaround]

IMO, it needs to set the value ch->mod_scheme_ in TXC::prepareMPDU().
I made the patch below and it seems to be working well.
Is this correct?

======================================================================
% diff -C 4 mac/mac-802_11Ext.cc.orig mac/mac-802_11Ext.cc
*** mac/mac-802_11Ext.cc.orig   2009-12-02 11:54:57.000000000 +0900
--- mac/mac-802_11Ext.cc        2009-12-07 13:24:32.000000000 +0900
***************
*** 860,867 ****
--- 860,869 ----
        dh->dh_fc.fc_wep = 0;
        dh->dh_fc.fc_order = 0;
        dh->dh_scontrol = mac_->sta_seqno_++;

+       ch->mod_scheme_ = 
(ModulationScheme)mac_->phymib_.getBasicModulationScheme();
+
        ch->txtime() = mac_->txtime(ch->size(), ch->mod_scheme_);

        if ((u_int32_t)ETHER_ADDR(dh->dh_ra) != MAC_BROADCAST) {
                dh->dh_duration = 
mac_->usec(mac_->txtime(mac_->phymib_.getACKlen(),
======================================================================


[Sample tcl code]

Mac/802_11Ext set BasicModulationScheme_ 0
Phy/WirelessPhyExt set BasicModulationScheme_ 0
#Mac/802_11Ext set BasicModulationScheme_ 3
#Phy/WirelessPhyExt set BasicModulationScheme_ 3

Mac/802_11Ext set MAC_DBG 0
Phy/WirelessPhyExt set PHY_DBG_ 1

Propagation/Shadowing set pathlossExp_ 2.0
Propagation/Shadowing set std_db_ 4.0
Propagation/Shadowing set dist0_ 1.0
Propagation/Shadowing set seed_ 0

set val(chan) Channel/WirelessChannel
set val(prop) Propagation/Shadowing
set val(netif) Phy/WirelessPhyExt
set val(mac) Mac/802_11Ext
set val(ifq) Queue/DropTail
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(ifqlen) 50
set val(nn) 2
set val(rp) DumbAgent
set val(x) 200
set val(y) 200
set val(tr) sample.tr
set val(nam) sample.nam

set ns_ [new Simulator]
set namtrace [open $val(nam) w]
set tracefd [open $val(tr) w]
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
$ns_ use-newtrace
$ns_ trace-all $tracefd
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
set chan_1_ [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) \
    -topoInstance $topo \
    -agentTrace OFF \
    -routerTrace OFF \
    -macTrace ON \
    -phyTrace ON \
    -movementTrace OFF \
    -channel $chan_1_

set node_(0) [$ns_ node]
$node_(0) random-motion 0
$node_(0) set X_ 100
$node_(0) set Y_ 100
$node_(0) set Z_ 0

set node_(1) [$ns_ node]
$node_(1) random-motion 0
$node_(1) set X_ 110
$node_(1) set Y_ 100
$node_(1) set Z_ 0

set udp0 [new Agent/UDP]
$ns_ attach-agent $node_(0) $udp0
$udp0 set class_ 1
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 10KB
$cbr0 attach-agent $udp0

set null1 [new Agent/Null]
$ns_ attach-agent $node_(1) $null1

$ns_ connect $udp0 $null1

$ns_ initial_node_pos $node_(0) 10
$ns_ initial_node_pos $node_(1) 10

$ns_ at 1.0 "$cbr0 start"
$ns_ at 4.0 "$cbr0 stop"
$ns_ at 5.0 "$ns_ nam-end-wireless 5"
$ns_ at 5.000000001 "$node_(0) reset";
$ns_ at 5.000000001 "$node_(1) reset";
$ns_ at 5.000000001 "stop"
$ns_ at 5.000000001 "puts \"NS EXITING...\" ; $ns_ halt"

proc stop {} {
    global ns_ tracefd namtrace
    $ns_ flush-trace
    close $tracefd
    close $namtrace
    exit 0
}

puts "Starting Simulation..."
$ns_ run


---
   YONEYAMA Seijiro

Reply via email to