[ns] can't read "basicrate_" :no such variable

2009-08-25 Thread ali bala


hi dear
i add 802.11e tkn and ns start to run the sample but middle of runnig the 
multi_udpflows.tcl(the example that exist in the 802_11e folder for testing)
i see the new error :
ns:mac/802_11e set basicrate_:can't read "basicrate_" :no such variable
(object set line1)
invoked from within
"mac/802_11e set basicrate_"
 mr.ali.balador
homepage:www.balador.org 



  


[ns] OldSim class err

2009-08-25 Thread Ali Al-Shra'ah.



 Hi all,
Whenever I try to compile a tcl script, I get the following error message:

% ns example1.tcl

"error when calling class OldSim: example1.tcl"

Can any one tell me how to avoid / prevent this?

Regards
Ali Hussein


  


[ns] problems with flow_id in AWK-Script

2009-08-25 Thread Tom G

Hi ns2 users,

I created my AWK-Script by copying a lof from other scrips.
So I created propably my own faiture.
It would be nice if someone could show me my mistake.

I get datas like this:
...
+ 0.2 0 2 ra 210 --- 0 0.0 4.0 -1 8
- 0.2 0 2 ra 210 --- 0 0.0 4.0 -1 8
+ 0.2 0 2 ra 210 --- 0 0.0 4.0 -1 9
+ 0.2 1 2 cbr 1000 --- 2 1.0 5.0 0 10
- 0.2 1 2 cbr 1000 --- 2 1.0 5.0 0 10
+ 0.2 1 2 cbr 1000 --- 2 1.0 5.0 1 11
...

and here is my AKW Script following, with this I like to calculate the Delay of 
the CBR Data
If I set  " if ( action == "r" && flow_id == 2 ) " to " if ( action == "r" && 
flow_id == 0 ) "
It works without problems by calculating delay for the RealAudio Applikation. 

BEGIN {
highest_packet_id = 0;
highest_packet_duration = 0;
lowest_packet_duration = 9;
hpd = 0;
lpd = 0;
apd = 0;
i = 0;
}
{
   action = $1;
   time = $2;
   from = $3;
   to = $4;
   type = $5;
   pktsize = $6;
   flow_id = $8;
   src = $9;
   dst = $10;
   seq_no = $11;
   packet_id = $12;
 
   if ( packet_id > highest_packet_id )
 highest_packet_id = packet_id;
 
   if ( start_time[packet_id] == 0 ) 
start_time[packet_id] = time;
 
   if ( action == "r" && flow_id == 2 ) {
end_time[packet_id] = time;
} 
else {
  end_time[packet_id] = -1;
   }
} 
END {
#printf("packet_id | type | start | end | packet_duration\n")

for ( packet_id = 0; packet_id <= highest_packet_id; packet_id++ ) 
{
start = start_time[packet_id];
end = end_time[packet_id];
packet_duration = end - start;

if ( packet_duration > highest_packet_duration )
highest_packet_duration = packet_duration;
if ( lowest_packet_duration > packet_duration && packet_duration > 0 )
lowest_packet_duration = packet_duration;
hpd = highest_packet_duration;# / i;
lpd = lowest_packet_duration;# / i;
apd = packet_duration;# / i;

   }if (start < end ) printf("%f %f %f\n", hpd, lpd, apd );
}

thanks for helt
best regards Tom



  


[ns] simulation stops before stop time configured

2009-08-25 Thread Oladapo Oluwadiya

hello all,

my mipv6 simulation finally works but it stops 10s into simulation instead of 
130s i configured. do u know what could be wrong. below is my script.

# Basic Mobile IPv6 example without using ns-topoman
# Needs proc defined in file proc-mipv6-config.tcl
# ==
# Define options
# ==

set opt(chan)   Channel/WirelessChannel    ;# channel type
set opt(prop)   Propagation/TwoRayGround   ;# radio-propagation model
set opt(netif)  Phy/WirelessPhy    ;# network interface type
set opt(mac)    Mac/802_11 ;# MAC type
set opt(ifq)    Queue/DropTail/PriQueue    ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant)    Antenna/OmniAntenna    ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 1  ;# number of mobilenodes
set opt(adhocRouting)   DSDV   ;# routing protocol

set opt(cp) "" ;# cp file not used
set opt(sc) "" ;# node movement file. 

set opt(x)  1500    ;# x coordinate of topology
set opt(y)  1500    ;# y coordinate of topology
set opt(seed)   0.0    ;# random seed
set opt(stop)   130  ;# time to stop simulation

set opt(ftp1-start)  10.0

set num_wired_nodes  4
#set num_bs_nodes   4  ; this is not really used here.

# ==


Agent/MIPv6/MN set bs_forwarding_ 0   ; # 1 if forwarding from previous 
BS

proc log-mn-movement_no_topo { } {
  global logtimer ns
  Class LogTimer -superclass Timer
  LogTimer instproc timeout {} {
     global mobile_
    $mobile_ log-movement 
    $self sched 1 
  }
  set logtimer [new LogTimer]
  $logtimer sched 1  
}


# Create Topology

proc create-my-topo {} {
  global ns opt topo mobile_ cn_ mnn_nodes_

  # Create and define topography
  set topo    [new Topography]
  #   set prop    [new $opt(prop)]
  #   $prop topography $topo
  $topo load_flatgrid 1500 1500 

  # god is a necessary object when wireless is used
  # set to a value equal to the number of mobile nodes
  create-god 5 

 # Call node-config
  $ns node-config \
    -addressType hierarchical \
     -agentTrace ON \
     -routerTrace ON 



  # Set NS Addressing
  AddrParams set domain_num_ 5 
  AddrParams set cluster_num_ {4 1 1 1 1 }
  AddrParams set nodes_num_ {1 1 1 1 2 1 1 1}

  # Create Nodes
  set cn_ [create-router 0.0.0]
  set router1_ [create-router 1.0.0]
  set router2_ [create-router 2.0.0]
  set router3_ [create-router 3.0.0]
  set bs1_ [create-base-station 2.1.0 2.0.0 250 1050 0]
  set bs2_ [create-base-station 2.2.0 2.0.0 1050 600 0]
  set bs3_ [create-base-station 3.1.0 3.0.0 950 300 0]
  set bs4_ [create-base-station 3.2.0 3.0.0 250 300 0]
  set mobile_ [create-mobile 2.1.1 2.0.0 250 1000 0 1 0.01]
  $bs1_ random-motion 0
  $bs2_ random-motion 0
  $bs3_ random-motion 0
  $bs4_ random-motion 0

  

 # Create Links
  $ns duplex-link $cn_ $router1_ 100Mb 2ms DropTail
  $ns duplex-link $router1_ $router2_ 100Mb 2ms DropTail
  $ns duplex-link $router1_ $router3_ 100Mb 2ms DropTail
  $ns duplex-link $router2_ $bs1_ 100Mb 2ms DropTail
  $ns duplex-link $router2_ $bs2_ 100Mb 2ms DropTail
  $ns duplex-link $router3_ $bs3_ 100Mb 2ms DropTail
  $ns duplex-link $router3_ $bs4_ 100Mb 2ms DropTail
  
 $ns duplex-link-op $cn_ $router1_ orient down
  $ns duplex-link-op $router1_ $router2_ orient left-down
  $ns duplex-link-op $router1_ $router3_ orient right-down
  $ns duplex-link-op $router2_ $bs1_ orient left-down
  $ns duplex-link-op $router2_ $bs2_ orient right-down
  $ns duplex-link-op $router3_ $bs3_ orient down
  $ns duplex-link-op $router3_ $bs4_ orient right-down



 
  display_ns_addr_domain
}


# End of Simulation

proc finish { } {
  global tracef ns namf opt mobile_ cn_
  
  puts "Simulation finished" 
  # Dump the Binding Update List of MN and Binding Cache of HA
  [[$mobile_ set ha_] set regagent_] dump
  [$cn_ set regagent_] dump
  [$mobile_ set regagent_] dump

  $ns flush-trace
  flush $tracef
  close $tracef
  close $namf
  #puts "running nam with $opt(namfile) ... "
  #exec nam $opt(namfile) &
  exit 0
}



# Main 

proc main { } {
   global opt ns TOPOM n

[ns] Strange behavior of TimerHandler.

2009-08-25 Thread Mazurek Marcin

Hi,

I'm creating new modified TCP agent that need to make some actions
every few seconds. I've implemented new timer to do that - i used
RtxTimer from tcp.cc like a base example so implementation should be
correct. Nevertheless something strange happens. Even if function that
is triggered by timer is empty, it changes result of the simulation.
When i run the simulation a few times with the same parameters,
results are different (congestions in links). Since this is simulation
this should not happen, right ? Please let me know if scheduling of
timer can change work of agent like that ?

Ps. Does anyone know why in ns-documentation example virtual expire
function returns double ? Is seems to not work since base type returns
void.

Thanks,

Marcin Mazurek



[ns] finally, my mobile ipv6 patch works but.......

2009-08-25 Thread Oladapo Oluwadiya

hello,

finally, my mobile ipv6 patch worked. i was able to run the simple-mipv6.tcl 
script that came with the patch. however, my own tcl script doesnt run at all. 
it comes up with 0 byte output tracefile and 0 byte nam output file.what could 
be wrong? below is my tcl script and attached is the scenario i m trying to 
achieve.

# Basic Mobile IPv6 example without using ns-topoman
# Needs proc defined in file proc-mipv6-config.tcl

Agent/MIPv6/MN set bs_forwarding_ 0   

proc log-mn-movement_no_topo { } {
  global logtimer ns
  Class LogTimer -superclass Timer
  LogTimer instproc timeout {} {
 global mobile_
    $mobile_ log-movement 
    $self sched 1 
  }
  set logtimer [new LogTimer]
  $logtimer sched 1  
}


# Create Topology

set opt(chan)   Channel/WirelessChannel    ;# channel type
set opt(prop)   Propagation/TwoRayGround   ;# radio-propagation model
set opt(netif)  Phy/WirelessPhy    ;# network interface type
set opt(mac)    Mac/802_11 ;# MAC type
set opt(ifq)    Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant)    Antenna/OmniAntenna    ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 1  ;# number of mobilenodes
set opt(adhocRouting)   DSDV   ;# routing protocol

set opt(cp) "" ;# cp file not used
set opt(sc) "" ;# node movement file. 

set opt(x)  1500    ;# x coordinate of topology
set opt(y)  1500    ;# y coordinate of topology
set opt(seed)   0.0    ;# random seed
set opt(stop)   130  ;# time to stop simulation

set opt(ftp1-start)  10.0

set num_wired_nodes  4
#set num_bs_nodes   4  ; this is not really used here.

proc create-my-topo {} {
  global ns opt topo mobile_ cn_ mnn_nodes_

  # Create and define topography
  set topo    [new Topography]
  #   set prop    [new $opt(prop)]
  #   $prop topography $topo
$topo load_flatgrid $opt(x) $opt(y) 
  

  # god is a necessary object when wireless is used
  # set to a value equal to the number of mobile nodes
  create-god 5 

  # Call node-config
  $ns node-config \
 -mipv6 ON \
    -mipagent BS \
    -mobileIP ON \
    -wiredRouting ON \
    -adhocRouting DSDV \
    -llType LL \
    -macType Mac/802_11 \
    -ifqType Queue/DropTail/PriQueue \
    -ifqLen 50 \
    -antType Antenna/OmniAntenna \
    -propType Propagation/TwoRayGround \
    -phyType Phy/WirelessPhy \
    -channelType Channel/WirelessChannel \
    -topoInstance $topo \
    -agentTrace ON \
    -routerTrace ON



  # Set NS Addressing
  $ns node-config -addressType hierarchical 
  AddrParams set domain_num_ 5 
  AddrParams set cluster_num_ {4 1 1 1 1}
  AddrParams set nodes_num_ {1 1 1 1 2 1 1 1 }

  # Create Nodes
  set cn_ [create-router 0.0.0]
  set router1_ [create-router 1.0.0]
  set router2_ [create-router 2.0.0]
  set router3_ [create-router 3.0.0]
  set bs1_ [create-base-station 1.1.0 1.0.0 200 200 0]
  set bs2_ [create-base-station 1.2.0 1.0.0 200 600 0]
  set bs3_ [create-base-station 1.3.0 1.0.0 600 200 0]
  set bs4_ [create-base-station 1.4.0 1.0.0 600 600 0]
  set mobile_ [create-mobile 1.1.1 1.1.0 190 190 0 1 0.01]
  $bs1_ random-motion 0
  $bs2_ random-motion 0
  $bs3_ random-motion 0
  $bs4_ random-motion 0

  # Position (fixed) for base-station nodes (HA & FA).
  $bs1_ set X_ 250.
  $bs1_ set Y_ 1050.
  $bs1_ set Z_ 0.

  $bs2_ set X_ 950.
  $bs2_ set Y_ 1050.
  $bs2_ set Z_ 0.

  $bs3_ set X_ 950.
  $bs3_ set Y_ 300.
  $bs3_ set Z_ 0.

  $bs4_ set X_ 250.
  $bs4_ set Y_ 300.
  $bs4_ set Z_ 0.




  # Create Links
  $ns duplex-link $cn_ $router1_ 100Mb 2ms DropTail
  $ns duplex-link $router1_ $router2_ 100Mb 2ms DropTail
  $ns duplex-link $router1_ $router3_ 100Mb 2ms DropTail
  $ns duplex-link $router2_ $bs1_ 100Mb 2ms DropTail
  $ns duplex-link $router2_ $bs2_ 100Mb 2ms DropTail
  $ns duplex-link $router3_ $bs3_ 100Mb 2ms DropTail
  $ns duplex-link $router3_ $bs4_ 100Mb 2ms DropTail

  $ns duplex-link-op $cn_ $router1_ orient down
  $ns duplex-link-op $router1_ $router2_ orient left-down
  $ns duplex-link-op $router1_ $router3_ orient right-down
  $ns duplex-link-op $router2_ $bs1_ orient left-down
  $ns duplex-link-op $router2_ $bs2_ orient right-down
  $ns duplex-link-op $router3_ $bs3_ orient down
  $ns duplex-link-op $router3_ $bs4_ orient right-down

  # movement of the MH
  $mobile_ set Z_ 0.000