[ns] ns 2.26 installation problem

2006-08-01 Thread sara MA

Hi there, I was trying to install ns2.26 on cygwin, and during the ./install 
procedure I got this error... can anyone help me please... (Thanks)



In file included from tclcl.h:48,
 from Tcl.cc:47:
tclcl-mappings.h: In static member function `static int 
TclObjectHelper::disp
atch_(void*, Tcl_Interp*, int, char**)':
tclcl-mappings.h:51: error: incomplete type `Tcl' used in nested name 
specifier
tclcl-mappings.h:52: error: invalid use of undefined type `struct Tcl'
tclcl-mappings.h:41: error: forward declaration of `struct Tcl'
tclcl-mappings.h:57: error: invalid use of undefined type `struct Tcl'
tclcl-mappings.h:41: error: forward declaration of `struct Tcl'
make: *** [Tcl.o] Error 1
tclcl-1.0b13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

_
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



[ns] adding trace analysis to the following wireless TCL code...any help?

2006-08-01 Thread Muth S

Hi all
   
  I want to add a trace analysis foe the following tcl code... i wnat to tract 
TCP packets from node 0 and know how much delay its consuming to send the 
packet... can any one help me in that
   
  
#Create a simulator object
set ns [new Simulator]
  set tf [open tcp1.tr w]
$ns trace-all $tf
  set nf [open tcp1.nam w]
#$ns namtrace-all $nf
$ns namtrace-all-wireless $nf 7 7
  Simulator set MacTrace_ ON
Simulator set RouterTrace_ ON
  $ns node-config -macType Mac/BNEP
  set node(0) [$ns node 0]
set node(1) [$ns node 1]
  $node(0) set-statist 10 30 1
$node(1) set-statist 10 30 1
  $node(0) rt AODV
$node(1) rt AODV
  $node(0) LossMod BlueHoc
 $node(0) trace-all-NULL on
 $node(0) trace-all-POLL on
# $node(0) trace-all-in-air on
  # [$node(1) set bb_] set T_w_inquiry_scan_ 4096
# [$node(1) set bb_] set T_inquiry_scan_ 4096
  $ns at 0.0002 "$node(0) on" 
$ns at 0.0005 "$node(1) on"
  set tcp0 [ new Agent/TCP]
$ns attach-agent $node(0) $tcp0
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
  set null0 [ new Agent/TCPSink]
$ns attach-agent $node(1) $null0
  $ns connect $tcp0 $null0
$tcp0 set packetSize_ 5000
$tcp0 set tcpip_base_hdr_size_ 72
  
# $ns at 1.0 "$ftp0 start"
set nscmd "$ftp0 start"
  [$node(1) set l2cap_] set ifq_limit_ 30
[$node(0) set l2cap_] set ifq_limit_ 40
  set ifq_ [new Queue/DropTail]
$ifq_ set limit_ 20
  $ns at 0.100 "$node(0) make-bnep-connection $node(1) DH5 DH3 noqos $ifq_ 
$nscmd" 
  $ns at 30.1 "finish"
  proc finish {} {
 global node ns nf tf 
 $node(0) print-all-stat
 $node(1) print-all-stat
 $close nf
 exec nam tcp1.nam &
 
 exit 0
}
  $ns run
   
   
  thanx in advance


[img]http://zonix.jeeran.com/hands.jpg[/img]

 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[ns] ns-2 examples

2006-08-01 Thread sanaz helmi

i'll appreciate if someone guides me how I can find some ns-2 samples for 
each OSI level which can be compiled correctly in NS-2.
Sincerely,
sanaz

_
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/



Re: [ns] How to Send only ONE packet ???

2006-08-01 Thread lei Liang

U can use sendmsg function of a udp agent. see 37.2.3 in the ns manuel.

Cheers,
lei

On Mon, 2006-07-31 at 19:27 +0100, Nicholas Loulloudes wrote:
> Hello,
> 
> Is there a way i can send from one node to an other node only ONE UDP
> packet?
> 
> Best Regards,
> 



[ns] Broadcast problem - HELP

2006-08-01 Thread [EMAIL PROTECTED]

Hi list!

I got a problem handling broadcast packets. Here it is the code:

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

set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf


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

set node1 [$ns node]
set node2 [$ns node]
set node3 [$ns node]
set node4 [$ns node]
set node5 [$ns node]
set node6 [$ns node]


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

$raw1 open tap0 readwrite
$raw2 open tap1 readwrite
$raw3 open tap2 readwrite
$raw4 open tap3 readwrite

#Tap Agent for each node
Agent/Tap set maxpkt_ 3100
set a1 [new Agent/Tap/Raw "FE:FD:0A:00:00:02"]
set a2 [new Agent/Tap/Raw "FE:FD:0A:00:00:03"]
set a3 [new Agent/Tap/Raw "FE:FD:0A:00:00:04"]
set a4 [new Agent/Tap/Raw "FE:FD:0A:00:00:05"]

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


#Assign TAP agents to ns-2 nodes
$ns attach-agent $node1 $a1
$ns attach-agent $node2 $a2
$ns attach-agent $node3 $a3
$ns attach-agent $node4 $a4


# Setup connections between the nodes
$ns duplex-link $node1 $node5 2Mb 2ms DropTail
$ns duplex-link $node2 $node5 2Mb 2ms DropTail
$ns duplex-link $node5 $node6 2Mb 15ms DropTail
$ns duplex-link $node6 $node3 2Mb 2ms DropTail
$ns duplex-link $node6 $node4 2Mb 2ms DropTail



$ns at 20.0 "finish"

$ns run


I'm using a nse extension to have some real (UML) machines talking each other 
via ns-2. If I use this code I get the error:

[EMAIL PROTECTED] ns2emulation]# ../nse mah.tcl
Using gettimeofday() insdead of the CPU cycle counter to guarantee portability
install nets into taps...
TapAgent: changing the src and dst address to 0:0 ---> -1:0
0.478134: Tap(_o33): recvpkt, writing to target: _o13
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o13: no target for slot -1
_o13 type: Classifier/Hash/Dest
content dump:
classifier _o13
0 offset
0 shift
2147483647 mask
1 slots
slot 0: _o37 (Classifier/Port)
-1 default
-- Finished standard no-slot{} default handler --

Usually I get this error when something is not correctly linked. If on the UML 
machines I set the ARP statically, it's work (I get the error  on the 
arp-request Who has 10.0.0.2...that is broadcast)

The code than handle this is:

void
RawTapAgent::processpkt (Packet* p, const NodeInfo& srcinfo) {

hdr_cmn* ch = HDR_CMN(p);
hdr_ip* ip = HDR_IP(p);
NodeInfo dstinfo = ((uint8_t*)p->accessdata ());
if (dstinfo.mac () == NodeInfo::broadcast_addr) { //A broadcast packet
ip->daddr () = IP_BROADCAST;
ip->dport () = 0;
TDEBUG5 ("TapAgent: changing the src and dst address to %d:%d 
---> %d:%d\n", srcinfo.get_node_addr (), 0, -1, 0);
} else {
nit = lower_bound (nodes.begin (), nodes.end (), dstinfo);
if (nit == nodes.end () || (dstinfo < *nit)) { //Destination 
address not found in the map table
Packet::free (p);
TDEBUG ("Dropped packet: invalid destination\n");
return;
}
ip->daddr () = (*nit).get_node_addr ();
ip->dport () = 0;
TDEBUG5 ("TapAgent: changing the src and dst address to %d:%d 
---> %d:%d\n", srcinfo.get_node_addr (), 0, (*nit).get_node_addr (), 0);
}

ip->saddr () = srcinfo.get_node_addr ();
ip->sport () = 0;

TDEBUG4("%f: Tap(%s): recvpkt, writing to target: %s\n",
now(), name(), target_->name());

Scheduler::instance().sync ();
ch->timestamp() = now();
target_->recv(p);

return;
}


How can I solve this? Please, I really need a soluzione for this!
If I use the wireless scenario they provided me, all works fine.

Regards,
  Paolo Carpo 



[ns] installation problem:miss files

2006-08-01 Thread pyramidal

 
Hello,
 
When I install ns-2.28,the following infomation displays:
 
luded from ./mac/channel.h:47,
 from ./mac/phy.h:60,
 from ./mac/mac.h:48,
 from trace/trace-ip.cc:39:
./mac/node.h:94:25: wired-flows.h: no that file or directory
In file included from ./mac/channel.h:47,
 from ./mac/phy.h:60,
 from ./mac/mac.h:48,
 from trace/trace-ip.cc:39:
./mac/node.h:201: error: ISO C++ forbids declaration of `SLList' with no type
./mac/node.h:201: error: expected `;' before '*' token
make: *** [trace/trace-ip.o] error 1
Ns make failed!
Any one would like to tell me where the problem lies?Thank you in advance!
 
Regards
 
Li An
 

Re: [ns] How to get the init link parameters using c++?

2006-08-01 Thread 王刚

Brad,
Thank you very much!

By searching in the archive, I know the bandwidth and delay of link are 
stored in a array,i.e. link_ array.But I don't know how to get this array.
What I really mean is to get the link delay and bandwidth in c++ 
program,not in tcl. 
A compromise methord ,I think, is to call tcl command in c++ program.However 
this may cause inefficient.
For example:

tcl.evalc("Simulator set NumberInterfaces_");
tcl.evalc("set a [[Simulator link $n0 $n1] link]");
tcl.evalc("$a set bandwidth_");
char *mybw = tcl.result();
tcl.evalc("$a set delay_");
char *mydelay = tcl.result();

My simulation need to read the link parameters frequently.We know that frequent 
switching between c++ and tcl are inefficient.
I wonder if there is a methord to get the link_ array in c++ program,not in tcl.
Can we call the link_ array directly,e.g. link_(sid,did) ?


Wish for your help,thank you in advance!

Sincerely
Gang Wang
- Original Message - 
From: "brad montgomery" <[EMAIL PROTECTED]>
To: "忘8制" <[EMAIL PROTECTED]>
Sent: Monday, July 31, 2006 9:35 PM
Subject: Re: [ns] How to get the init link parameters using c++?


Gang,

I'm still relatively new to ns, but what I've done to pass Tcl values to C++
is write a command (in C++) for my Agent that can be called from Tcl. For
example, if you had an agent called MyAgent, you could do something like
this:

int MyAgent::command(int argc, const char*const* argv) {
   if (argc == 3) {
  if (strcmp(argv[1], "get-bw-and-delay") == 0) {
 bw = argv[2];// bw would be declared in myagent.h
 delay = argv[3]; // delay would be declared in myagent.h
 return(TCL_OK);
  } 
} // end MyAgent

Then, from Tcl, the instance of your MyAgent class could call the
get-bw-and-delay function:

$myagent get-bw-and-delay 1.5 10

You may have to do some type-checking, but that's the basic idea.

Hope it helps.
Brad

On 4/1/06 2:20 AM, "王刚" <[EMAIL PROTECTED]> wrote:

> 
> Hi,I want to do some simulation about qos routing,and in c++ I need to know
> the link bandwidth and link delay,which is set in tcl topology script.
> For example,
> 
> set n0 [$ns node]
> set n1 [$ns node]
> set n2 [$ns node]
> set n3 [$ns node]
> $ns duplex-link $n0 $n1 1.5Mb 10ms DropTail
> $ns duplex-link $n1 $n2 1.6Mb 10ms DropTail
> $ns duplex-link $n1 $n3 1.7Mb 10ms DropTail
> 
> my question is that in c++ ,how to get the bandwidth and delay of
> link{(n0,n1),(n1,n2),(n1,n3)}.
> 
> Any advice will be appriciated.
> 
> Best wishes!
> 
> Sincerely
> Gang Wang
>