[ns] How to access a newly created C++ MAC class function from TCL script, , Nodewise?

2008-10-31 Thread Mayur

Dear all,

I have defined a new function [ disp_state() ] in Mac802_11 class, which 
I want to call from my tcl script. So, I added following code in the 
command() function of class Mac802_11 as follows:


if (argc == 2) {
if (strcmp(argv[1], "disp-state") == 0) {
disp_state();
return TCL_OK;
}
}

///

Now the question is how to call this function from my tcl script? Had it 
been a Node level function, I should have called is as

$ns at time1 $node_($i) disp-state

But the function is in the MAC of each of the node. So, how to access 
each of this node wise MACs individually?


regards,
Mayur



[ns] where is the packet header offset set when a new packet is generated?

2008-10-31 Thread matt Wood

Dear all,
In NS2, the packet header must be accessed through its offset. But I can
not find where the offset_ is initialized. Please look and see if my
understanding of this issue is right or not:

In the RTPAgent, it is directly use hdr_cmn::access(p) to access the
header part. When the RTPAgent is configured in TCL, a binding is made to
connect the RTP header's offset to the "offset_" of struct "hdr_cmn".
Therefore, through the forced type conversion "return (hdr_rtp*)
p->access(offset_);" (in ns/apps/rtp.cc, and p is a pointer to a new Packet
instance), the "offset_" in hdr_rtp (which is a child of hdr_cmn) is
initialized to the value configured through TCL.

   Thank you.


[ns] NSWEB vs HTTP Packmime

2008-10-31 Thread J S

Hello

Has NSWEB been integrated as a part of NS-2?

How reliable is this method as compared to HTTP Packmime approach?


Re: [ns] tracing on the User-equipement in UMTS network

2008-10-31 Thread Mats Folke

Hi!

I assume you are using the EURANE simulator. Are you sure you have set up the 
network correctly? Is this output from the reference scripts? Maybe some 
important line in the TCL script has been lost. Perhaps there is an error with 
the input traces of the radio channels resulting in the non-existence of 
transmission opportunities?

Lots of questions.

Good hunting,
Mats Folke

Imen HEDFI wrote:
> Hi,
> 
> When simulating a traffic over an UMTS network, I obtain a trace
> format containing the following lines (an extract of the trace file))
> 
> + 11.319203 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2754
> - 11.319203 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2754
> + 11.319206 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2755
> - 11.319206 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2755
> + 11.319223 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2756
> - 11.319223 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 225 2756
>   .
>   .
>   .
>   .
> r 11.334014 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 223 2737
> r 11.334014 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2738
> r 11.334026 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2739
> r 11.33404 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2740
> r 11.334053 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2741
> r 11.33406 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2742
> r 11.334062 0 1 AM_Data 40  0 1.0.0.0 0.0.2.0 0 224 2743
> 
> the node "0" is the RNC and "1" is the BS,
> i want to trace the received packet in the mobile node, but i don't
> obtained the lines indicating that the packet reaches the mobile node.
> 
> How can i view this trace???
> 
> best regards
> 
> --Imen



-- 
Mats Folke, M.Sc., Lic.Eng.
Research Engineer

Ericsson AB Office: +46 8 7571385
Ericsson Research   Fax: +46 920 99621
P.O. Box 920Mobile: +46 76 1271385
SE-971 28 Luleå



[ns] Set energy for a node

2008-10-31 Thread Douglas Restrepo

Hello



I have a question.

I need to set the energy for a specific node in a specific time. for example

$ns_ at time_x $node_(32) energy=10

How can id do it?

Thank you


  



[ns] implemention malicious node in MANET over DSR

2008-10-31 Thread anas

I am doing some research to provide security to MANET. However, I am stuck by 
the way how to simulate one or more malicious node(s) in one  MANET scenario, 
such the nodes that drops the forwarding packets
intentively, or absorbs all packets to it, or duplicates the  forwarding 
packets. Is there any solution to this problem. 

thank you in advance



[ns] Nodes not moving in wireless1-out.nam(Marc Gries tutorial)

2008-10-31 Thread Mirza Naveed Baig

Hi all,
 
wireless1.tcl compiles fine but when i run wireless-out.nam then there is no 
movement for nodes also no packets exchange between nodes is seen.
 
Can any one help me please because I am new user of Ns2 and dont know whats the 
problem going on.
 
wireless1.tcl is taken from Marc Gries tutorial.
I am using Ns2 all in one 2.29.
Operating system WindowsXP
 
Best Regards.


  


  


Re: [ns] where is the packet header offset set when a new packet is generated?

2008-10-31 Thread Teerawat Issariyakul


Packet construction is fairly subtle. In fact it consist of three phases:

1) At the compilation (when you type "make"):
In this phase, NS2 allocate the memory for all TclClasses.
PacketHeaderClass defined in file ~ns/common/packet.h,cc is one of them.
In the constructor of this class, the sizeof() is used to determine
space needed to store the packet header. The size is passed up the
hierarchy and stored in the variable hdrlen_.

2) At the network configuration phase: Remember that we have just compute
the size of each header. But the offset is the accumulation of the size.
When you invokes "$ns run", instproc create_packetformat() is invoked.
Here the offset is computed by repeatedly added all the active header
together.

3) During the simulation phase: You may invoke function allocpkt() of
class Agent. Here the value of offset_ has already been set, and can be
used at will.

I suggest you to go through chapter 8 (specifically Section 8.3.8) in the
following book from Springer. You will find everything you need about
packets:

T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator
NS2", Springer 2008.

Here is the link:
http://www.springer.com/engineering/signals/book/978-0-387-71759-3

You might also find the following slide useful:
http://www.ece.ubc.ca/~teerawat/NS2.htm

Best,
Teerawat


On 10/31/2008, "matt Wood" <[EMAIL PROTECTED]> wrote:

>
>Dear all,
>In NS2, the packet header must be accessed through its offset. But I can
>not find where the offset_ is initialized. Please look and see if my
>understanding of this issue is right or not:
>
>In the RTPAgent, it is directly use hdr_cmn::access(p) to access the
>header part. When the RTPAgent is configured in TCL, a binding is made to
>connect the RTP header's offset to the "offset_" of struct "hdr_cmn".
>Therefore, through the forced type conversion "return (hdr_rtp*)
>p->access(offset_);" (in ns/apps/rtp.cc, and p is a pointer to a new Packet
>instance), the "offset_" in hdr_rtp (which is a child of hdr_cmn) is
>initialized to the value configured through TCL.
>
>   Thank you.
>