I
am trying to construt a wireless tcl script that generates voice
traffic "voip", i use this tcl script but the trace file hasn't the
same contents as the trace file for "simple-wireless.tcl".
I explain more:
I use this tcl script

-----------------------------------------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]
set n9 [$ns node]



# création des outputs
 trace et nam:
set f [open emna.tr w]
$ns trace-all $f
set nf [open emna.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)             10
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
#------------------------------------------------------------------------
# Codec:  G.711
#------------------------------------------------------------------------
#set val(ON)             1500ms
#set val(OFF)            1500ms
#set val(AppRate)        96Kb
set val(pktsize)         160
set val(pktinterval)     0.020
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)
# 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 $n0 $n1 2Mb 2ms DropTail
$ns duplex-link $n0 $n2 2Mb 2ms DropTail
$ns duplex-link $n0 $n3 2Mb 2ms DropTail
$ns duplex-link $n0 $n4 2Mb 2ms DropTail
$ns duplex-link $n0 $n5 2Mb 2ms DropTail
$ns duplex-link $n0 $n6 2Mb 2ms DropTail
$ns duplex-link $n0 $n7 2Mb 2ms DropTail
$ns duplex-link $n0 $n8 2Mb 2ms DropTail
$ns duplex-link $n0 $n9 2Mb 2ms DropTail

# 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

set rtp1 [new Agent/RTP]
$ns attach-agent $n1 $rtp1
$rtp1 set class_ 1
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $rtp1

set rtp2 [new Agent/RTP]
$ns
 attach-agent $n2 $rtp2
$rtp1 set class_ 2
set cbr2 [new Application/Traffic/CBR]
$cbr2 attach-agent $rtp2

set rtp3 [new Agent/RTP]
$ns attach-agent $n3 $rtp3
$rtp3 set class_ 3
set cbr3 [new Application/Traffic/CBR]
$cbr3 attach-agent $rtp3

set rtp4 [new Agent/RTP]
$ns attach-agent $n4 $rtp4
$rtp4 set class_ 4
set cbr4 [new Application/Traffic/CBR]
$cbr4 attach-agent $rtp4

set rtp5 [new Agent/RTP]
$ns attach-agent $n5 $rtp5
$rtp4 set class_ 5
set cbr5 [new Application/Traffic/CBR]
$cbr5 attach-agent $rtp5

set rtp6 [new Agent/RTP]
$ns attach-agent $n6 $rtp6
$rtp6 set class_ 6
set cbr6 [new Application/Traffic/CBR]
$cbr6 attach-agent $rtp6

set rtp7 [new Agent/RTP]
$ns attach-agent $n7 $rtp7
$rtp6 set class_ 7
set cbr7 [new Application/Traffic/CBR]
$cbr7 attach-agent $rtp7

set rtp8 [new Agent/RTP]
$ns attach-agent $n8 $rtp8
$rtp6 set class_
 8
set cbr8 [new Application/Traffic/CBR]
$cbr8 attach-agent $rtp8

set rtp9 [new Agent/RTP]
$ns attach-agent $n9 $rtp9
$rtp9 set class_ 9
set cbr9 [new Application/Traffic/CBR]
$cbr9 attach-agent $rtp9


set null0 [new Agent/Null]
$ns attach-agent $n0 $null0
$ns attach-agent $n1 $null0
$ns attach-agent $n2 $null0
$ns attach-agent $n3 $null0
$ns attach-agent $n4 $null0
$ns attach-agent $n5 $null0
$ns attach-agent $n6 $null0
$ns attach-agent $n7 $null0
$ns attach-agent $n8 $null0
$ns attach-agent $n9 $null0

# c'est la relation (sending-receiving) ($ns connect $s_agent $r_agent)
$ns connect $rtp0 $null0
$ns connect $rtp1 $null0
$ns connect $rtp2 $null0
$ns connect $rtp3 $null0
$ns connect $rtp4 $null0
$ns connect $rtp5 $null0
$ns connect $rtp6 $null0
$ns connect $rtp7 $null0
$ns connect $rtp8 $null0
$ns connect $rtp9 $null0


$ns at 0.1 "$cbr0
 start"
$ns at 0.1 "$cbr1 start"
$ns at 0.1 "$cbr2 start"
$ns at 0.1 "$cbr3 start"
$ns at 0.1 "$cbr4 start"
$ns at 0.1 "$cbr5 start"
$ns at 0.1 "$cbr6 start"
$ns at 0.1 "$cbr7 start"
$ns at 0.1 "$cbr8 start"
$ns at 0.1 "$cbr9 start"

# pour notre cas sans tcp :) 
#set tcp [new Agent/TCP]
#$tcp set class_ 2
#set sink [new Agent/TCPSink]
#$ns attach-agent $n0 $tcp
#$ns attach-agent $n3 $sink
#$ns connect $tcp $sink
#set ftp [new Application/FTP]
#$ftp attach-agent $tcp
#$ns at 1.2 "$ftp start"


puts [$cbr0 set packetSize_]
puts [$cbr0 set interval_]

$ns at 3.0 "finish"

proc finish {} {
    global ns f nf
    $ns flush-trace
    close $f
    close $nf

    puts "running nam..."
    exec nam emna.nam &
    exit 0
}

$ns run


-----------------------------------------end of tcl 
script-------------------------------------


the nam output works well, the trace file has this format

+ 0.1 0 9 cbr 210 ------- 0 0.0 9.1 1 0
- 0.1 0 9 cbr 210 ------- 0 0.0 9.1 1 0
+ 0.1 1 0 cbr 210 ------- 2 1.0 9.1 1 1
- 0.1 1 0 cbr 210 ------- 2 1.0 9.1 1 1
+ 0.1 2 0 cbr 210 ------- 0 2.0 9.1 1 2
- 0.1 2 0 cbr 210 ------- 0 2.0 9.1 1 2
+ 0.1 3 0 cbr 210 ------- 3 3.0 9.1 1 3
- 0.1 3 0 cbr 210 ------- 3 3.0 9.1 1 3

My problem, that i know that for wirelless simulation , the trace file should 
have this format:
s 0.029290548 _1_ RTR  --- 0 message 32 [0 0 0 0] ------- [1:255 -1:255 32 0] 
s 1.119926192 _0_ RTR  --- 1 message 32 [0 0 0 0] ------- [0:255 -1:255 32 0] 
s 10.000000000 _0_ AGT  --- 2 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0 0
r 10.000000000 _0_ RTR  --- 2 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0
 0
s 12.941172739 _1_ RTR  --- 3 message 32 [0 0 0 0] ------- [1:255 -1:255 32 0] 


What's wrong???
some help please 
thanks



      

Reply via email to