Re: [ns] tcl : create nodes

2011-05-19 Thread мαłłi

Tami,

For your question my answer is
1. yes u got it, i forget to put s instead i put number thanks
2. yes we can do

The topology

n1 --- n2 --- n3 --- n4 --- n5

set requiredNodes 5
for {set i 0} {$i  $requiredNodes} {incr i} {
set n$i [$ns node]
if {$i == [expr $requiredNodex - 1]} {
$ns duplex-line $n[expr $i - 1] $ns$i 5Mb 2ms Drop Tail
} else {
$ns duplex-line $n$i $ns[expr $i+1] 5Mb 2ms Drop Tail
set tcp [new Agent/TCP]
$tcp set class_ 1
$ns attach-agent $n$i $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n[expr $i+1] $sink
}
}

I didn't test the script, i generally wrote this one, please test it and let
me know status of this,
if you want specify specific bandwidth between the nodes, you manually
stored in a list
suppose *set bandwidth [ 2Mb, 3Mb, 4Mb, 5Mb, 0.2Mb] by using list index* we
can get the bandwidth
similarly what ever you need (specifically) that stored in a list and use
them

2011/5/17 Tami Nesher vessely...@gmail.com

 Thank you for all answers.
 1. Did you mean to write like this?(with s)
 set s 10
 for {set i 0} {$i  *$s*} {incr i} {

  set n$i [$ns node]

 2. I want also to create* links* between the nodes,  to *attach agents(tcp
 or  udp)* and *start them*.
  I need to do everey thing in the same way, with for ?
 ex.
 for {set j 0} {$j  $s/2} {incr j} {
  $ns duplex-link n$j n$s/2+$j 2Mb 10ms DropTail
 # Is it right to write like this?? and what can I do if I want to change
 the bandwidth sometimes?

 *Thank you!
 *

 On Tue, May 17, 2011 at 2:33 PM, мαłłi malli@gmail.com wrote:

 Tami,

 What I understand you question is you have an variable, based on that you
 need to create that much of users?
 Ex. set s 10
 for {set i 0} {$i  10} {incr i} {
  set n$i [$ns node]

 }


 On 17 May 2011 15:43, Tami Nesher vessely...@gmail.com wrote:


 Hi,
 How can I create nodes according to a variable number?
 I mean : I have a variable that contains the number of nodes that I need
 to
 create. How can I do it?




 --

 Thanks,

 The box said Requires Windows 95, NT, or better, so I installed Linux.

 Mallikarjun [:)]

 [image: YouTube] http://in.youtube.com/mallikv [image: 
 Blogger]http://basicnetworktipsntricks.blogspot.com/ [image:
 LinkedIn] http://www.linkedin.com/in/mallikarjunaraok




 --
 רבי משה בן מכיר זצל, מגדולי הראשונים כתב:
 מי שאומר את ברכת אשר יצר בכוונה, ומוציא כל מילה מפיו בקול רם וברור,  לא
 יבוא עליו שום חולי שבעולם, ולא יזדקק כלל לרופאים או לתרופות!







-- 

Thanks,

The box said Requires Windows 95, NT, or better, so I installed Linux.

Malli [:)]

[image: YouTube] http://in.youtube.com/mallikv [image:
Blogger]http://basicnetworktipsntricks.blogspot.com/ [image:
LinkedIn] http://www.linkedin.com/in/mallikarjunaraok


[ns] Delay in ns2

2011-05-19 Thread thn80


Hello,

I have two routing protocols and got the following two tracefiles (it's only
a part of each tracefile). My problem is that protocol 2 is a modification
of protocol 1 and in the following tracefiles the protocols exchange exactly
the same packets, but the time values -t in the tracefiles are different.
Can someone tell me at which positions in ns2 the packet delay is
calculated?
Protocol 1 is AOMDV on top of a WiFi connection.

Routing protocol 1:
--
s -t 5.1 -Hs 0 -Hd -2 -Ni 0 -Nx 500.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl AGT -Nw --- -CHhops 0 -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id 3.0
-It tcp -Il 1040 -If 0 -Ii 8 -Iv 32 -Pn tcp -Ps 2 -Pa 0 -Pf 0 -Po 0 
r -t 5.1 -Hs 0 -Hd -2 -Ni 0 -Nx 500.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl RTR -Nw --- -CHhops 0 -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id 3.0
-It tcp -Il 1040 -If 0 -Ii 8 -Iv 32 -Pn tcp -Ps 2 -Pa 0 -Pf 0 -Po 0 
s -t 5.1 -Hs 0 -Hd 1 -Ni 0 -Nx 500.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl RTR -Nw --- -CHhops 0 -Ma 0 -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
-1.00 -Nl RTR -Nw --- -CHhops 1 -Ma 46 -Md 1 -Ms 0 -Mt 800 -Is 0.0 -Id
3.0 -It tcp -Il 1060 -If 0 -Ii 8 -Iv 30 -Pn tcp -Ps 2 -Pa 0 -Pf 1 -Po 0 
f -t 5.100840741 -Hs 1 -Hd 2 -Ni 1 -Nx 700.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl RTR -Nw --- -CHhops 1 -Ma 46 -Md 1 -Ms 0 -Mt 800 -Is 0.0 -Id
3.0 -It tcp -Il 1060 -If 0 -Ii 8 -Iv 29 -Pn tcp -Ps 2 -Pa 0 -Pf 1 -Po 0 
s -t 5.100850741 -Hs 1 -Hd -2 -Ni 1 -Nx 700.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 0 -Ma 0 -Md 0 -Ms 0 -Mt 0 
r -t 5.100910963 -Hs 0 -Hd -2 -Ni 0 -Nx 500.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 0 -Ma 0 -Md 0 -Ms 0 -Mt 0 
s -t 5.101020296 -Hs 1 -Hd -2 -Ni 1 -Nx 700.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 0 -Ma 13b -Md 2 -Ms 1 -Mt 0 
r -t 5.101104519 -Hs 2 -Hd -2 -Ni 2 -Nx 900.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 0 -Ma 13b -Md 2 -Ms 1 -Mt 0 
s -t 5.101114519 -Hs 2 -Hd -2 -Ni 2 -Nx 900.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 0 -Ma f5 -Md 1 -Ms 0 -Mt 0 

Routing protocol 2:
--
s -t 5.1 -Hs 0 -Hd -2 -Ni 0 -Nx 500.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl AGT -Nw --- -CHhops 0 -Ma 0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1.00 -Nl MAC -Nw --- -CHhops 0 -Ma 46 -Md 1 -Ms 0 -Mt 800 -Is 0.0 -Id
3.0 -It tcp -Il 1118 -If 0 -Ii 8 -Iv 30 -Pn tcp -Ps 2 -Pa 0 -Pf 0 -Po 0 
r -t 5.100720741 -Hs 1 -Hd 1 -Ni 1 -Nx 700.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl MAC -Nw --- -CHhops 1 -Ma 46 -Md 1 -Ms 0 -Mt 800 -Is 0.0 -Id
3.0 -It tcp -Il 1060 -If 0 -Ii 8 -Iv 30 -Pn tcp -Ps 2 -Pa 0 -Pf 1 -Po 0 
r -t 5.100720741 -Hs 1 -Hd 1 -Ni 1 -Nx 700.00 -Ny 400.00 -Nz 0.00 -Ne
-1.00 -Nl RTR -Nw --- -CHhops 1 -Ma 46 -Md 1 -Ms 0 -Mt 800 -Is 0.0 

[ns] about add a new manet routing protocol in ns2-2.34 encounter an error

2011-05-19 Thread 兰天

I follow the instruction about how to add a new routing protocol to ns2
and I am sure that I do all steps,however,I suffer the follow mistake,and I 
search a lot in internet and get nothing useful
the error follows:
num_nodes is set 3
extra switch pattern with no body
while executing
switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 $node start-dsr
}
AODV {
set ragent [$self cre...
(procedure _o3 line 14)
(Simulator create-wireless-node line 14)
invoked from within
_o3 create-wireless-node
(eval body line 1)
invoked from within
eval $self create-wireless-node $args
(procedure _o3 line 23)
(Simulator node line 23)
invoked from within
$ns node
invoked from within
set n(0) [$ns node] 
(file mflood.tcl line 55)
Could any one help me !
Thanks a lot!


[ns] Very Uergant , Please Help me

2011-05-19 Thread Sandy Haff

GOOD Day Every One 

i am a very very new user to NS-2 and i want to create a handover Senaro in 
Mobile Wimax 801.16e 


can any one pleas help me with that , im really in a very bad situation here 
any help will do .

the handover Senaro gose like this 


1: Tow base station ( BS1 , BS2 ) 

2: 100 Mobile node or station ( MN)

first make one MN do the handover form BS1 To BS2 and collate  the time Delay 
and packet lost .
and second make the 100 mobile node do the handover from BS1 to BS2 and also 
collate the time delay and the packet lost . 

what i want here to do this Senaro assuming that the two Base station Firest in 
the Different SubNet Address 
and then make the same Senaro but make the two Base Stations BS1, BS2 in the 
Same SubNet Address
and also collate the time delay and the packet drops 



thank you all for all your help .

sandy 




[ns] [very urgent] need IEEE 802.11p package

2011-05-19 Thread chadi jabroun


Hi

I want to create a handover process using the IEEE 802.11p.

The IEEE 802.11p extension which is integrated in ns2.34 doesn't support 
handover layer 2.

Does any body have an IEEE package that support handover.

please i need your help it is very very urgent.

Thank you very much 

best regards,

Chadi Jabroun  
  


[ns] need some help runing tcl examples

2011-05-19 Thread Sandy Haff

hi NS users , can anyone please run this examples for me i dont seem to get 
them 
running , its has been made with NS-2.29 NIST 

can anyone help me with this its really urgent 
thank you all 






[ns] packet forwarding to neighbours

2011-05-19 Thread Sudhanshu Pant

Hi
Could anybody please tell me a simple(ABC) example code for sending a new
packet to the neighbor nodes. The packet may contain a certain info. which
we want to send to the neighbor nodes. Please help.
-- 
Thanks and Regards
Sudhanshu Pant
M. Tech. NITH
Hamirpur, H.P.


[ns] Packet Forwarding to neighbor nodes

2011-05-19 Thread Sudhanshu Pant

Hi
Could anybody please tell me a simple(ABC) example code for sending a new
packet to the neighbor nodes. The packet may contain a certain info. which
we want to send to the neighbor nodes. Please help.

-- 
Thanks and Regards
Sudhanshu Pant
M. Tech. NITH
Hamirpur, H.P.