[ns] Questions about mobile simulation

Hajer FERJANI f.hajer at gmail.com
Tue Sep 27 23:59:11 PDT 2005


Hi All,
 I'm trying to add and simulate a new protocol to ns, and I'm facing some
problems:
 1/ I defined the structure of a new packet header. I also added the packet
type to the enum pt_packet (in packet.h) just before the PT_NTYPE field and
added the name of the packet to the name_ array of the packet_info class. I
recompiled, but still get "undefined" as a protocol type in trace files. Any
suggestions about the cause of the error?
 2/ I'm simulating an ad hoc network and I want to broadcast a packet 2 hops
away. So I'm setting daddr (of the ip header) as IP_BROADCAST and ttl (of
the ip header) as 2. But the message is only sent to direct neighbors and
broadcast stops. Is that the expected behavior (in this case I should handle
forwarding at agent level)? Or is there something wrong in what I did.
 3/ I set the simulation area as 670*670, and then I noticed that a node
that is giving an initial position outside the simulation area (at position
(800,0)) is active and can send and receive messages. I thought that nodes
are implicitly turned off as they move outside of sim area. Is'nt the case?
How can I turn off nodes that are laying outside of simulation area?
 Thanks a lot for your help.
 Regards.


More information about the Ns-users mailing list