Friday, December 16, 2011

[ns] Specific Hierarchical address format to have an ipv4 like address

Hi all,
how to use the specific hierarchical address format.
from the manual it has this syntax:$ns set-address-format hierarchical <#n hierarchy levels> <#bits for level1> <#bits for level 2> ....<#bits for nth level>
so i followed that and i wrote in my tcl script:$ns_ set-address-format hierarchical 4 8 8 8 8
and when i created the nodes i have
set temp {0.0.0.0 0.0.0.1 0.0.0.2 } for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node [lindex $temp $i] ] $node_($i) random-motion 0 }
however, the messages now are dropped once they reached the destination. here is a part from the tracing file:
r 4.613981632 _2_ RTR --- 4 SIP_200 270 [13a 2 1 800] ------- [0.0.0.1:0 0.0.0.2:0 30 0.0.0.2] D 4.613981632 _2_ RTR NRTE 4 SIP_200 270 [13a 2 1 800] ------- [0.0.0.1:0 0.0.0.2:0 29 0.0.0.2]

also when i do "cout" to print the node address as following iph->daddr() = shv->node_;
where node_ is of nsaddr_t; i get 512 or 256 instead of of 0.0.01 for example.
also i noticed that RTR is forwarding the messages instead of sending them .what should i do to fix this problem? do I need to change any thing in the routing protocol?

basically what i am trying to achieve is given each node an ipv4-like address format. i dont need the ipv4 features i just need that the ip address of each node to look like ipv4 ; i.e. 192.86.23.1
i am using ns2.27 on Ubuntu-10.10. and i am working on the SIP module by Rui Prior and i am kaming it working in ad hoc using AODV routing protocol
Regards,Maram

No comments:

Post a Comment

Counter

blogger analytics