http://tagus.inesc-id.pt/~pestrela/ns2/ns2_haddr_tips.html

Type of Addresses that a node can have in NS2 (hAddr, ID, iAddr, Handle)? 
In NS2, a node can be uniquely identified by several forms

the "handle" is the otcl name; it refers to an object of the form "_oXXX",
and because of this, it is the only form can be used to directly call
internal instprocs and variables.
the "haddr" is the Hierarchical address, on the form "X.Y.Z" 
the "iaddr" is the INTEGER hierarchical address, where the haddr string is
simply ENCODED in a 32 bit integer.
the "id" is the sequential Node ID of the simulator.

...


In my ns2_shared_procs.tcl "utils" tcl file, I introduce procs for all
possible conversions of each form, using the procs "handle2iaddr",
"handle2haddr", "handle2id", etc.
http://tagus.inesc-id.pt/~pestrela/ns2/files/ns2_shared_procs.tcl


Feel free to ask further questions if necessary
Pedro Vale Estrela

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Nicholas Loulloudes
> Sent: segunda-feira, 3 de Julho de 2006 10:55
> To: ns-users@ISI.EDU
> Subject: [ns] Finding Node ID
> 
> 
> Hello,
> 
> I am currently implementing a routing algorithm in NS2. I have utilized
> the
> command [$node neighbors] for discovering the neighbors of a specific
> node.
> 
> This command returns a list with the following three elements (_o13, _o16,
> _019). Is is possible in TCL to retrieve dynamically the ID of each node
> using this elements in the list.
> 
> For example:
> 
> _o19 = n(1)
> _o13 = n (0)
> _o16 = n(2)
> 
> Regards,
> 
> 
> --
> Nicholas Loulloudes
> 
> Postgraduate at Communication Networks and Software.
> 
> BSc in Computer Science.

Reply via email to