[ns] 802_11 Bandwidth issue. basicRate_ ??
Saikat Ray
raysaikat at lycos.com
Sun Feb 29 10:14:19 PST 2004
Probably now I see light in your confusion.
EVERY IEEE 802.11 packet (e.g. RTS, CTS, DATA, ACK etc) has two parts, the PLCP part and the *information* part. In *ANY* datarate setting, the PLCP part is *always* transmitted at 1 Mb/s. Therefore, that part always takes 192 \mu s (or something close to that number). If you read the standard, the PLCP is mentioned by the transmission time (in sec) and not by the number of bits.
So, if your data packet is 53 bytes, it will (roughly) take
(192+ 53*8/11) \mu s
which is almost the number you are seeing.
In other words, the PLCP transmission time is dominating the whole transmission time.
So, in order to check the datarate properly, you should use the maximum size packet, so that the PLCP transmission time becomes negligible.
Another point is that with small packets, you will see very low data rate, as you already observed. This is not a flaw of the standard, by the way. This design is needed for making practical radios work.
Hope this settles the issue.
----------- Original Message ---------
DATE: Sat, 28 Feb 2004 13:09:46
From: Rohan S <syphy8 at yahoo.com>
To: ns-users at ISI.EDU
Cc:
>
>Hi Saikat,
>The protocol does work fine now. Just one more
>question. Why is the PLCP header and PLCP data rate
>inlcuded in the calculation for the data packet
>transmission time.
>
>Results:
>=============
>So if MAC data rate is set to 11Mbps,
>For packet size 53 bytes (includes header), we get
>txtime under sendData module (MAC-802_11.cc) = .230
>msec.
>Now (53*8)/.230 ~ 2Mbps which is the same as the
>result in the trace file.
>
>And for packet size 552 bytes I get around 7.6MBPS
>which totally makes sense.
>
>Is this because we are providing reliability. Lower
>the data rate higher the reliabilty. Is that why
>smaller packets are tx'd at a lower data rate?
>
>Thanks again for your help
>
>
>
>--- Saikat Ray <raysaikat at lycos.com> wrote:
>> Did you try to run the code I posted? That may
>> clarify whether the issue is with your code or the
>> installation (did you change the core ns files?)?
>>
>> ----------- Original Message ---------
>>
>> DATE: Fri, 27 Feb 2004 15:34:30
>> From: Rohan S <syphy8 at yahoo.com>
>> To: ns-users at ISI.EDU
>> Cc:
>>
>> >
>> >Thank You for the clarification. I did calculate
>> the
>> >dataRate as mentioned below.But I guess its just
>> with
>> >my code, I am still getting 2Mbps after settign
>> data
>> >rate to 11Mbps.
>> >
>> >
>> >--- Saikat Ray <raysaikat at lycos.com> wrote:
>> >>
>> >> I hope this mail helps resolving some very basic
>> >> things.
>> >>
>> >> The following script sets up a connection between
>> a
>> >> pair of nodes.
>> >>
>> >> # Start of script
>> >>
>>
>>======================================================================
>> >> # Define options
>> >> #
>> >>
>>
>>======================================================================
>> >> 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) CMUPriQueue
>>
>> >> ;# 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) 2
>>
>> >> ;# number of mobilenodes
>> >> set val(rp) DumbAgent
>>
>> >> ;# routing protocol
>> >>
>> >> #
>> >>
>>
>>======================================================================
>> >> #
>> >>
>>
>>======================================================================
>> >> # Main Program
>> >> #
>> >>
>>
>>======================================================================
>> >>
>> >> # Initialize Global Variables
>> >> #-------------------------------------------
>> >>
>> >> set stoptime_ 100
>> >> set lambda 10
>> >> set ns_ [new Simulator]
>> >> puts "stoptime=$stoptime_"
>> >> #$ns_ use-newtrace
>> >> #$ns_ use-smalltrace
>> >> set tracefd [open testpoisson.tr w]
>> >> $ns_ trace-all $tracefd
>> >>
>> >> #Set -66 dBm of both RX and CS Threshold
>> >> Phy/WirelessPhy set CSThresh_ 2.5e-10
>> >> Phy/WirelessPhy set RXThresh_ 2.5e-10
>> >> #Set datarate
>> >> Mac/802_11 set dataRate_ 11e6
>> >>
>> >> # Set up topography object
>> >> set topo [new Topography]
>> >> $topo load_flatgrid 800 800
>> >>
>> >> # Create God
>> >> #-------------------------------------------
>> >> create-god $val(nn)
>> >>
>> >> # configure node
>> >> $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 \
>> >> -movementTrace OFF \
>> >> -channel [new $val(chan)]
>> >>
>> >> for {set i 0} {$i < $val(nn) } {incr i} {
>> >> set node_($i) [$ns_ node]
>> >> $node_($i) random-motion 0 ;# disable random
>> motion
>> >> }
>> >>
>> >> # Provide initial (X,Y, for now Z=0) co-ordinates
>> >> for mobilenodes
>> >> $node_(0) set X_ 50.0
>> >> $node_(0) set Y_ 200.0
>> >> $node_(0) set Z_ 0.0
>> >>
>> >> $node_(1) set X_ 250.0
>> >> $node_(1) set Y_ 200.0
>> >> $node_(1) set Z_ 0.0
>> >>
>> >> # Now place the nodes
>> >> $ns_ at 0 "$node_(0) setdest 50.0 200.0 0.0"
>> >> $ns_ at 0 "$node_(1) setdest 250.0 200.0 0.0"
>> >>
>> >> # Setup traffic flow between nodes
>> >>
>> >> Agent/UDP set packetSize_ 3000
>> >>
>> >> set udp0 [new Agent/UDP]
>> >> $udp0 set class_ 1
>> >> set cbr0 [new Application/Traffic/CBR]
>> >> $cbr0 set packetSize_ 2000
>> >> set ival_ [expr 1.0/$lambda]
>> >> $cbr0 set interval_ $ival_
>> >> puts "$ival_"
>> >> $cbr0 attach-agent $udp0
>> >>
>> >> set sink1 [new Agent/Null]
>> >>
>> >> $ns_ attach-agent $node_(0) $udp0
>> >> $ns_ attach-agent $node_(1) $sink1
>> >>
>> >> $ns_ connect $udp0 $sink1
>> >> $ns_ at 0.2 "$cbr0 start"
>> >> $ns_ at $stoptime_ "stop"
>> >>
>> >> proc stop {} {
>> >> global ns_ tracefd
>> >> $ns_ flush-trace
>> >> close $tracefd
>> >> exit 0
>> >> }
>> >> puts "Starting Simulation ..."
>> >> $ns_ run
>> >>
>> >> #### End of script #############
>> >>
>> >> If you comment out the line:
>> >> Mac/802_11 set dataRate_ 11e6
>> >>
>> >> then the datarate is 1Mb/s. The "proof" is the
>> >> following two lines from the trace file.
>> >>
>> >> s 0.396486743 _0_ MAC --- 3 cbr 2052 [13a 1 0
>> 800]
>> >> ------- [0:0 1:0 32 0] [3] 0 0
>> >> r 0.412903410 _1_ MAC --- 3 cbr 2000 [13a 1 0
>> 800]
>> >> ------- [0:0 1:0 32 0] [3] 1 0
>> >>
>> >> Subtract the receive instant from the send
>> instant,
>> >> you will get: 16,416 \mu s. i.e. about 16,000 mu
>> s
>> >> for a 2000 byte packet, which is what you expect
>> for
>> >> 1 Mb/s connection.
>> >>
>> >> Now uncomment the line; you will get, e.g.:
>> >> s 0.711621177 _0_ MAC --- 4 cbr 2052 [13a 1 0
>> 800]
>> >> ------- [0:0 1:0 32 0] [4] 0 0
>> >> r 0.713288753 _1_ MAC --- 4 cbr 2000 [13a 1 0
>> 800]
>>
>=== message truncated ===
>
>
>__________________________________
>Do you Yahoo!?
>Get better spam protection with Yahoo! Mail.
>http://antispam.yahoo.com/tools
>
>
____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
More information about the Ns-users
mailing list