Thanks Fernando,

That's Ok, the node ID is used in the simulator core. But, it is possible
assign real IP addresses to the nodes (not X.Y.Z hierarchical format)? I
need the IP addresses because my protocol algorithm does some calculations
with them. As a matter of fact, it is not so important IP addresses appear
on the trace file. I used trace file just to confirm I can assign them.

I have read something about Address class, ns_addr_t struct, etc. But I
didn't understand how I use that. Could you help me with it? Or give me any
link?


[]s,
Marlos.



On Wed, Nov 5, 2008 at 9:37 AM, Fernando Farias <[EMAIL PROTECTED]> wrote:

> On simulator core the address have been to use for send traffic between
> node are the variable id of structure common head (hdr_cmn->id). The trace
> files will write based value from id variable as you have seen on your file.
>
> regards
>
> 2008/11/5 Marlos Marques <[EMAIL PROTECTED]>
>
>
>> Hello all,
>>
>> Currently, I am trying to implement an application layer multicast
>> algorithm
>> using NS2. For this purpose I need to assign IP address to every node in
>> NS2. I checked out the NS2 nodes may have hierarchical routing addressing
>> which is similar to IP addressing. But, I also found the "addr" command
>> which apparently allows you to configure the node IP, so I can run the
>> following code:
>>
>> set ns [new Simulator]
>> set n0 [$ns node]
>> set n1 [$ns node]
>> $n0 addr "192.168.1.1"
>> $n1 addr "192.168.1.2"
>>
>> But in the trace file I keep getting sequential identifiers. For example:
>>
>> + 0 1 2 tcp 40 ------- 2 1.0 5.0 0 0
>>
>> But I would like to get this one:
>>
>> + 0 192.168.1.1 192.168.1.2 tcp 40 ------- 2 1.0 5.0 0 0
>>
>> What am I doing wrong?
>>
>>
>> Thanks in advance,
>> Marlos
>>
>
>
>
> --
> "A computer is like air conditioning: it becomes useless when you open
> windows." - Linus Torvalds
>
> Fernando N. N. Farias
> IT Analyst  CTIC/UFPA
> Computer Engineer M.Sc. Student
> GERCOM/UFPA Team Member
> Federal University of ParĂ¡
>
>

Reply via email to