[ns] Delay in the wifi

Gabriel Novy gabrielnovy at yahoo.com.br
Fri Feb 5 07:37:44 PST 2010


I'm sorry by my english but i'm not speak english.
I'm simulate a
scenario wifi in th NS2 but when I insert many users the delay
continues low. Whats the problem? This is my script:

set val(chan)           Channel/WirelessChannel    ;# Tipo do canal
set val(prop)           Propagation/TwoRayGround   ;# Modelo de propagação de rádio
set val(netif)          Phy/WirelessPhy            ;# Tipo de interface da rede
set val(mac)            Mac/802_11                 ;# Tipo de camada
 MAC
set val(ifq)            Queue/DropTail             ;# Tipo da interface da pilha
set val(ll)             LL                         ;# Tipo da camada de enlace
set val(ant)            Antenna/OmniAntenna        ;# Modelo da antena
set val(ifqlen)         50                        ;# Máximo valor de pacotes na pilha
set val(nn)            
 4                          ;# Número de nós na rede
set val(rp)             DumbAgent                  ;# Protocolo de roteamneto
set val(x)              600
set val(y)              600

Mac/802_11 set dataRate_ 1Mb

# Initialize Global Variables
set ns_         [new Simulator]
set tracefd     [open infra.tr w]
$ns_ trace-all $tracefd


# set up topography object
set topo       [new Topography]

$topo load_flatgrid $val(x)
 $val(y)

# Create God
create-god $val(nn)

# Create channel
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 \
                -movementTrace ON \
                -channel $chan_1_
     for {set i 0} {$i < [expr $val(nn)]} {incr i} {
                set node_($i) [$ns_
 node]

                $node_($i) random-motion 0              ;# disable random motion
                set mac_($i) [$node_($i) getMac 0]


                $mac_($i) set RTSThreshold_ 3000

                $node_($i) set X_ [expr $i * 0.01]
                $node_($i) set Y_ 0       ;# Horizontal arrangement of nodes
                $node_($i) set Z_
 0.0

        }

#Set
Node 0 and Node $val(nn) as the APs. Thus the APs are the ends of the
horizontal line. Each STA receives different power levels.


set AP_ADDR1 [$mac_(0) id]
$mac_(0) ap $AP_ADDR1


#$mac_(1) ScanType ACTIVE

for {set i 2} {$i < [expr $val(nn)]} {incr i} {
       #cria um agente UDP para o cliente
        set udp_c($i) [new Agent/UDP]
        $udp_c($i) set packetSize_ 77
        #$udp_c($i) set interval_ 11ms
        $udp_c($i) set rate_ 100Kbps
        $ns_ attach-agent $node_($i) $udp_c($i)

        #cria um repositório NULL no servidor
        set
 null_s($i) [new Agent/Null]
        $ns_ attach-agent $node_(1) $null_s($i)
        $ns_ connect $udp_c($i) $null_s($i)

        #cria uma aplicação CBR para o cliente
        set cbr_c($i) [new Application/Traffic/CBR]
        $cbr_c($i) set packetSize_ 77
        #$cbr_c($i) set interval_ 11ms
        $cbr_c($i) set rate_ 100Kbps
        $cbr_c($i) attach-agent $udp_c($i)
        $ns_ at 0.0 "$cbr_c($i) start"

}

        #cria um agente UDP para o servidor
        set udp_s [new
 Agent/UDP]
       $udp_s set packetSize_ 140
        #$udp_s set interval_ 10ms
        $udp_s set rate_ 10Kbps
        $ns_ attach-agent $node_(1) $udp_s

        #cria um repositório NULL no cliente 2
        set null_c(2) [new Agent/Null]
        $ns_ attach-agent $node_(2) $null_c(2)
        $ns_ connect $udp_s $null_c(2)

        #cria uma aplicação CBR para o servidor
        set cbr_s [new Application/Traffic/CBR]
        $cbr_s set packetSize_ 140
        #$cbr_s set interval_
 10ms
        $cbr_s set rate_ 100Kbps
        $cbr_s attach-agent $udp_s
        $ns_ at 0.0 "$cbr_s start"



$ns_ at 1200.0 "stop"
$ns_ at 1200.0 "puts \"NS EXITING...\" ; $ns_ halt"

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

puts "Starting Simulation..."
$ns_ run


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com


More information about the Ns-users mailing list