Hi everyone,
I am simulating 802.11. I dont know why the difference between
send and receive events at mac layer is coming 599 micro seconds . The
trace I included here.
s 1.356629577 _0_ MAC --- 943 cbr 584 [13a 1 0 800] ------- [0:0 1:0 32
1] [943] 0 0
r 1.357228855 _1_ MAC --- 943 cbr 532 [13a 1 0 800] ------- [0:0 1:0 32
1] [943] 1 0
the difference should be somewhere around 250 microseconds. Because
PLCPdatarate and basic data rate is 1mbps and mac data rate is 11mbps. I
also dont know why packet size is 584, when sending and 532 at
receiving. If I have to anlyse source code, which files should I look. I
am including my script also. Please somebody help as I badly require it.
sandeep.
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/Shadowing ;#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) 5 ;# max packet in ifq
set val(nn) 2 ;# number of mobilenodes
set val(rp) NOAH ;# routing protocol
set val(x) 500
set val(y) 500
Phy/WirelessPhy set bandwidth_ 11e6 ;#Data Rate
Antenna/OmniAntenna set Gt_ 1 ;#Transmit antenna gain
;same for WAVELAN
Antenna/OmniAntenna set Gr_ 1 ;#Receive antenna gain
;same for WAVELAN
Phy/WirelessPhy set L_ 1.0 ;#System Loss Factor
Phy/WirelessPhy set freq_ 2.472e9 ;#channel-13 2.472Ghz
Phy/WirelessPhy set Pt_ 0.031622777 ;#Transmit power
;0.2818 for WAVELAN
Phy/WirelessPhy set CPThresh_ 10.0 ;#Collision threshold
;same for 914MHz WaveLAN
Phy/WirelessPhy set CSThresh_ 5.011872e-12 ;#Carrier sense power
;1.559e-11 for 914MHz
Phy/WirelessPhy set RxThresh_ 5.82587e-09 ;#Receive power
threshold calculated under TwoRay ground model
;#3.652e-10 for WAVELAN
Phy/WirelessPhy set Rb_ 2*1e6 ;#What is this parameter
for 11b, the value given is for WAVELAN
Mac/802_11 set RTSThreshold_ 3000 ;#To suppress RTS/CTS
Packets increase the rts threshold
Mac/802_11 set SlotTime_ 0.000020 ;# 20us
Mac/802_11 set SIFS_ 0.000010 ;# 10us
Mac/802_11 set PreambleLength_ 144 ;# 144 bit
Mac/802_11 set PLCPHeaderLength_ 48 ;# 48 bits
Mac/802_11 set PLCPDataRate_ 1.0e6 ;# 1Mbps
Mac/802_11 set dataRate_ 1.0e6 ;# 11Mbps
Mac/802_11 set basicRate_ 1.0e6 ;# 1Mbps
Application/Traffic/CBR set rate_ 4e6
set ns_ [new Simulator]
set tracefd [open 802.11b-1.tr w]
$ns_ trace-all $tracefd
set na [open 802.11b-1.nam w]
$ns_ namtrace-all-wireless $na $val(x) $val(y)
set chan1 [new $val(chan)]
# set up topography object
set topo [new Topography]
$topo load_flatgrid 500 500
#
# 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) \
-channel $chan1 \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF
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_ 0
$node_(0) set Y_ 0
$node_(0) set Z_ 0
$node_(1) set X_ 1
$node_(1) set Y_ 1
$node_(1) set Z_ 0
set udp_(0) [new Agent/UDP]
$ns_ attach-agent $node_(0) $udp_(0)
set null_(0) [new Agent/Null]
$ns_ attach-agent $node_(1) $null_(0)
set cbr_(0) [new Application/Traffic/CBR]
$cbr_(0) set packetSize_ 512
$cbr_(0) attach-agent $udp_(0)
$ns_ connect $udp_(0) $null_(0)
$ns_ at 1.0 "$cbr_(0) start"
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at 50.0 "$node_($i) reset";
}
$ns_ at 50.0 "stop"
$ns_ at 50.01 "$ns_ halt"
proc stop {} {
global ns_ tracefd
$ns_ flush-trace
close $tracefd
}
$ns_ run