Re: [ns] Simulating channel Hopping in ns2

2006-11-15 Thread Daniel Mahrenholz

Hi,
gaurav deshpande schrieb:
 Hi all,

 We intend to implement channel hopping using ns2 simulator. Has anyone tried 
 to implement hopping in ns2?

 Our approach: 

 We found that each channel (class WirelessChannel) keeps a linked list of all 
 nodes listening on that channel.  For a mobilenode to hop we wrote code to 
 dynamically  add and remove the node from this list. However, on running ns 
 we get a segmentation fault. The code we wrote looks something like:


 MobileNode* n = node that hops;
 WirelessChannel new = next channel to hop to;
 WirelessChannel current = current channel of node n;

 new.addNodeToList(n);
 current.removeNodeFromList(n);


 It would be great of someone share thier experience in implementing channel 
 hopping in ns2.
   
I cannot help with the channel hopping. But to find problems with linked 
lists etc. in the C++ part of the code it is always a very good idea to 
run ns-2 using valgrind. Simulations will use a lot more time to run, 
but every strange or wrong memory access will be recognized.

Daniel.



Re: [ns] Simulating channel Hopping in ns2

2006-11-15 Thread Pedro Vale Estrela



 I cannot help with the channel hopping. But to find problems with linked
 lists etc. in the C++ part of the code it is always a very good idea to

good tip

 run ns-2 using valgrind. Simulations will use a lot more time to run,
 but every strange or wrong memory access will be recognized.

As I explain here,
http://tagus.inesc-id.pt/~pestrela/ns2/ns2_debugging3.html
Step 1 - Choosing a simpler scenario that is known to be correct, etc

the first step should be to simplify the scenario to make the debug
simulations run faster. A common tip that I use extensively is to generate a
lot less traffic (lower the rate for UDP; use lower link speeds for TCP).

For handling the parameters in the command line, I suggest this
http://tagus.inesc-id.pt/~pestrela/ns2/contributed_code.html#_Toc147652228

Pedro Vale Estrela