[Olsr-users] olsrd and ns2

Ignacio Alvarez e Iñaki Fuentes telematica (spam-protected)
Tue May 5 22:23:11 CEST 2009


Hi! We connect the VM to NS2 emulation as an ethernet interface. We have
read it from a paper of magdeburg university. I agree with you because i
think that the routing will be done inside the VM, but something strange
happens, because if i put a node too far it listens the other nodes request,
but these nodes dont listen him. I think that here is the problem because
this should not happen.

 I will paste the ns2 code for you. We use a bridge connecting all the VM
because our final target is to connect a external interface as a nokia810.
We use iptables on the bridge to avoid the duplicated traffic but the
problem is not at iptables i am certain.

Could be the problem in using DumbAgent protocol?
i am very sorry for my bad english but i have tried to explain it
clearly...if you dont understand something, just ask me and i will try to
explain it better.

thanks a lot
regards



set scriptname        routingdemo
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(ifqlen)         50                         ;# max packet in ifq
set val(x)              10000               ;# x range in meters
set val(y)              10000               ;# y range in meters
#set val(rp)        AODV               ;# routing protocol
set val(rp)        DumbAgent           ;# routing protocol
set val(nn)        4               ;# number of mobile nodes
#set val(stime)        60.0               ;# simulation time
set val(stime)        360000.0           ;# simulation time = 100 hours

#establecemos un ancho de banda mayor para los enlaces wireless
Mac/802_11 set dataRate_ 11Mb
Mac/802_11 set basicRate_ 2Mb



set ns        [new Simulator]
$ns use-scheduler RealTime

set tracefd  [open "|gzip > $scriptname.tr.gz" w]
$ns trace-all $tracefd
#set tr0 [new BaseTrace/ShmGZ test.tr.gz 16 400 104857600]

set namtrace [open "|gzip > $scriptname.nam.gz" w]
#set namtrace [open "|nam -r 0.1 -" w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

#Procedure needed when running nam in real-time
proc NamTime {} {
    #Send time to nam periodically
    global ns namtrace
    set now [$ns now]
    set next [expr $now + 0.05]
    puts $namtrace "T -t $now"
    flush $namtrace
    $ns at $next "NamTime"
}

#$ns at 1.0 "NamTime"

proc UniformErr {} {
    set err [new ErrorModel]
    $err unit packet
    $err set rate_ 0.01
    $err ranvar [new RandomVariable/Uniform]
    $err drop-target [new Agent/Null]
    return $err
}

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)]

# Configure node parameters
$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 $chan_1_ \
    -IncomingErrProc UniformErr



#Procedure to configure an ns-2 node initially
proc setup_node {id x y z color} {

    global ns node_
    set node_($id) [$ns node]
    $node_($id) set X_ $x
    $node_($id) set Y_ $y
    $node_($id) set Z_ $z
    $node_($id) color $color
    $ns at 0 "$node_($id) setdest $x $y 0"
    $ns at 0 "$node_($id) color $color"
    $node_($id) random-motion 0
}

setup_node 1 100 300 0 "black"
setup_node 2 300 300 0 "green"
setup_node 3 500 300 0 "blue"
setup_node 4 6000 6000 0 "cyan"

for {set i 1} {$i <= $val(nn)} {incr i} {
    $ns at 0 "$node_($i) start";
        $ns at $val(stime) "$node_($i) reset";
}



#Network objects to access the TAP devices at the link layer
set raw1 [new Network/Raw]


$raw1 open br0 readwrite


#Tap Agent for each node
Agent/Tap set maxpkt_ 3100
set a1 [new Agent/Tap/Raw "2E:01:F0:54:0C:4D"]
set a2 [new Agent/Tap/Raw "C2:91:EA:41:C5:6D"]
set a3 [new Agent/Tap/Raw "8A:9E:7A:5E:A7:C4"]
set a4 [new Agent/Tap/Raw "9E:C3:B1:0D:AE:F4"]

puts "install nets into taps..."
#Assign network objects to TAP agents
$a1 network $raw1
$a2 network $raw1
$a3 network $raw1
$a4 network $raw1

#$ns duplex-link $node_(1) $node_(2) 10Mb 10ms DropTail


#Assign TAP agents to ns-2 nodes
$ns attach-agent $node_(1) $a1
$ns attach-agent $node_(2) $a2
$ns attach-agent $node_(3) $a3
$ns attach-agent $node_(4) $a4




$ns at $val(stime) "stop"
$ns at $val(stime) "puts \"NS EXITING ...\" ; $ns halt"

proc stop {} {
    global ns tracefd raw1
    $ns flush-trace
    close $tracefd
    $raw1 close

}

puts "okey"

$ns run





El 5 de mayo de 2009 7:29, Henning Rogge <(spam-protected)> escribió:

> Am Monday 04 May 2009 22:55:52 schrieb Ignacio Alvarez e Iñaki Fuentes
> telematica:
> > hi! I am sorry henning because we are new in this kind of forums, and we
> > are students who are learning yet ;)
> No problem, that's exactly how I started on this list two years ago... ;)
>
> >  I have upgraded to olsrd 0.5.6-r4, but it does not work too. We are
> > running this daemon in VM Debian 4.0. About the txtinfo we dont know how
> to
> > config and install it.
> make build_all install_all
>
> then look at the README file in lib/txtinfo in the olsrd trunk.
>
> >  On the other hand, we dont understand this thing what you have said:
> >
> > "If you use the NS-2 emulation mode just as a layer 1/2 emulation, OLSR
> > should not care."
> >
> > We are running ns-2 emulation feature but we are not sure if it also can
> > support olsrd running at the same time.
> I used NS-2 in emulation mode during my diploma thesis (and it was a pain
> in
> the a** ;) )... I remember there were two ways to connect a VM to NS2, as
> an
> ethernet interface or as an IP interface. But I think you already use the
> ethernet variant, so routing will be done inside the VMs.
>
> Henning
>
>
> *************************************************
> Diplom Informatiker Henning Rogge
> Forschungsgesellschaft für
> Angewandte Naturwissenschaften e. V. (FGAN)
> Neuenahrer Str. 20, 53343 Wachtberg, Germany
> Tel.: 0049 (0)228 9435-961
> Fax: 0049 (0)228 9435-685
> E-Mail: (spam-protected)
> Web: www.fgan.de
> ************************************************
> Sitz der Gesellschaft: Bonn
> Registergericht: Amtsgericht Bonn VR 2530
> Vorstand: Prof. Dr. rer. nat. Maurus Tacke (komm. Vors.), Prof. Dr.-Ing.
> Joachim Ender (Stellv.)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-users/attachments/20090505/eab9d70e/attachment.html>


More information about the Olsr-users mailing list