i have to do a scenario containing:
one node "AP" eight nodes transmitting to the APthe AP resend packets to the
node
Thus, I want to do transmission with full duplex mode.
So, I tried with this tcl script file:
--------------tcl script--------------
set ns [new Simulator]
# choix des couleurs:
$ns color 0 blue
$ns color 1 red
$ns color 2 green
$ns color 3 red
$ns color 4 orange
$ns color 5 blue
$ns color 6 green
$ns color 7 black
#$ns color 8 orange
#$ns color 9 blue
# les dix noeuds:
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n6 [$ns node]
set n7 [$ns node]
set n8 [$ns node]
# création des outputs trace et nam:
set f [open emna1.tr w]
$ns trace-all $f
set nf [open emna1.nam w]
$ns namtrace-all $nf
# ======================================================================
# 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) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(rp) DumbAgent ;# routing protocol
set val(start) 0.0
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 9
set val(tr) "trace"
set val(X) 500
set val(Y) 500
set val(CWmin) 16
set val(CWmax) 1024
set val(SlotTime) 0.000009
set val(SIFS) 0.000016
set val(basicRate) 2Mb
set val(dataRate) 54Mb
set val(PreambleLength) 104
set val(PLCPHeaderLength) 48
#------------------------------------------------------------------------
# Codec: G.711
#------------------------------------------------------------------------
#set val(ON) 1500ms
#set val(OFF) 1500ms
#set val(AppRate) 96Kb
#set val(pktsize) 160 #160 octets
#set val(pktinterval) 0.020
#set pktsize $val(pktsize) #160 octets
#set pktinterval $val(pktinterval)
#set val(run) 50.0
#------------------------------------------------------------------------
# MAC MIB
#------------------------------------------------------------------------
Mac/802_11 set basicRate $val(basicRate)Mb
Mac/802_11 set dataRate $val(dataRate)Mb
Mac/802_11 set CWMin $val(CWmin)
Mac/802_11 set CWMax $val(CWmax)
Mac/802_11 set SlotTime $val(SlotTime)
Mac/802_11 set SIFS $val(SIFS)
Mac/802_11 set PreambleLength $val(PreambleLength);# no preamble
Mac/802_11 set PLCPHeaderLength
$val(PLCPHeaderLength) ;# 128 bits
Mac/802_11 set PLCPDataRate 1.0e6 ;# 1Mbps
# set up topography object
set topo [new Topography]
#$topo load_flatgrid $val(X) $val(Y)
# 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) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF \
-movementTrace OFF
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns node]
$node_($i) random-motion 0 ;# disable random motion
}
# connection des noeuds entre eux:
# $ns simple-link (duplex-link) $n0 $n1 <bandwidth> <delay> <queue_type>
$ns duplex-link $n1 $n0 1Mb 20ms DropTail
$ns duplex-link $n2 $n0 1Mb 20ms DropTail
$ns duplex-link $n3 $n0 1Mb 20ms DropTail
$ns duplex-link $n4 $n0 1Mb 20ms DropTail
$ns duplex-link $n5 $n0 1Mb 20ms DropTail
$ns duplex-link $n6 $n0 1Mb 20ms DropTail
$ns duplex-link $n7 $n0 1Mb 20ms DropTail
$ns duplex-link $n8 $n0 1Mb 20ms DropTail
$ns duplex-link-op $n1 $n0 orient right
$ns duplex-link-op $n2 $n0 orient right-down
$ns duplex-link-op $n3 $n0 orient up
$ns duplex-link-op $n4 $n0 orient left-down
$ns duplex-link-op $n5 $n0 orient left
$ns duplex-link-op $n6 $n0 orient left-up
$ns duplex-link-op $n7 $n0 orient down
$ns duplex-link-op $n8 $n0 orient right-up
# la création de l'"agent" / set ... [new Agent/type]
set rtp0 [new Agent/RTP]
# communication agent-network ($ns attach-agent $node $agent)
$ns attach-agent $n0 $rtp0
# la création de l'application / set ... [new Application/type]
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $rtp0
$ns at 0.5 "$cbr0 start"
set null0 [new Agent/Null]
$ns attach-agent $n0 $null0
# c'est la relation (sending-receiving) ($ns connect $s_agent $r_agent)
#$ns connect $rtp0 $null0
set rtp1 [new Agent/RTP]
$ns attach-agent $n1 $rtp1
$rtp1 set class_ 1
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $rtp1
$ns at 0.5 "$cbr1 start"
set null1 [new Agent/Null]
$ns attach-agent $n1 $null1
$ns connect $rtp1 $null0
$ns connect $rtp0 $null1
set rtp2 [new Agent/RTP]
$ns attach-agent $n2 $rtp2
$rtp1 set class_ 2
set cbr2 [new Application/Traffic/CBR]
$cbr2 attach-agent $rtp2
$ns at 0.5 "$cbr2 start"
set null2 [new Agent/Null]
$ns attach-agent $n2 $null2
$ns connect $rtp0 $null2
$ns connect $rtp2 $null0
set rtp3 [new Agent/RTP]
$ns attach-agent $n3 $rtp3
$rtp3 set class_ 3
set cbr3 [new Application/Traffic/CBR]
$cbr3 attach-agent $rtp3
$ns at 0.5 "$cbr3 start"
set null3 [new Agent/Null]
$ns attach-agent $n3 $null3
$ns connect $rtp0 $null3
$ns connect $rtp3 $null0
set rtp4 [new Agent/RTP]
$ns attach-agent $n4 $rtp4
$rtp4 set class_ 4
set cbr4 [new Application/Traffic/CBR]
$cbr4 attach-agent $rtp4
$ns at 0.5 "$cbr4 start"
set null4 [new Agent/Null]
$ns attach-agent $n4 $null4
$ns connect $rtp0 $null4
$ns connect $rtp4 $null0
set rtp5 [new Agent/RTP]
$ns attach-agent $n5 $rtp5
$rtp4 set class_ 5
set cbr5 [new Application/Traffic/CBR]
$cbr5 attach-agent $rtp5
$ns at 0.5 "$cbr5 start"
set null5 [new Agent/Null]
$ns attach-agent $n5 $null5
$ns connect $rtp0 $null5
$ns connect $rtp5 $null0
set rtp6 [new Agent/RTP]
$ns attach-agent $n6 $rtp6
$rtp6 set class_ 6
set cbr6 [new Application/Traffic/CBR]
$cbr6 attach-agent $rtp6
$ns at 0.5 "$cbr6 start"
set null6 [new Agent/Null]
$ns attach-agent $n6 $null6
$ns connect $rtp0 $null6
$ns connect $rtp6 $null0
set rtp7 [new Agent/RTP]
$ns attach-agent $n7 $rtp7
$rtp6 set class_ 7
set cbr7 [new Application/Traffic/CBR]
$cbr7 attach-agent $rtp7
$ns at 0.5 "$cbr7 start"
set null7 [new Agent/Null]
$ns attach-agent $n7 $null7
$ns connect $rtp0 $null7
$ns connect $rtp7 $null0
set rtp8 [new Agent/RTP]
$ns attach-agent $n8 $rtp8
$rtp6 set class_ 8
set cbr8 [new Application/Traffic/CBR]
$cbr8 attach-agent $rtp8
$ns at 0.5 "$cbr8 start"
set null8 [new Agent/Null]
$ns attach-agent $n8 $null8
$ns connect $rtp0 $null8
$ns connect $rtp8 $null0
# c'est la relation (sending-receiving) ($ns connect $s_agent $r_agent)
puts [$cbr0 set packetSize_ 160]
puts [$cbr0 set interval_ 20ms]
puts [$cbr1 set packetSize_ 160]
puts [$cbr1 set interval_ 20ms]
puts [$cbr2 set packetSize_ 160]
puts [$cbr2 set interval_ 20ms]
puts [$cbr3 set packetSize_ 160]
puts [$cbr3 set interval_ 20ms]
puts [$cbr4 set packetSize_ 160]
puts [$cbr4 set interval_ 20ms]
puts [$cbr5 set packetSize_ 160]
puts [$cbr5 set interval_ 20ms]
puts [$cbr6 set packetSize_ 160]
puts [$cbr6 set interval_ 20ms]
puts [$cbr7 set packetSize_ 160]
puts [$cbr7 set interval_ 20ms]
puts [$cbr8 set packetSize_ 160]
puts [$cbr8 set interval_ 20ms]
$ns at 10.0 "finish"
proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf
puts "running nam..."
exec nam emna1.nam &
exit 0
}
$ns run
-----------end of tcl script-----------
my problem is:
when runnig the name trace and the trace file, i find that:
the nodes are transmitting to the node_0 "AP"But the full duplex mode is
applied only for the last one "node_8"
Why this problem?
What's wrong?
Please some help