[Ns-developers] Different Clocks

Mike Moreton mjvm_ns at hotmail.com
Wed Mar 21 03:54:08 PDT 2012


I guess another alternative would be to add a node specific delta for each call to Schedule(), and keep a global time.

However, I'm not sure what the effect on frame reception would be - you want all nodes to see the frame ending at the same real time.

Sounds like a lot of opportunities to get things wrong!

> From: suresh.lalith at gmail.com
> Date: Wed, 21 Mar 2012 10:30:46 +0100
> Subject: Re: [Ns-developers] Different Clocks
> To: mjvm_ns at hotmail.com
> CC: ns-developers at isi.edu
> 
> On Wed, Mar 21, 2012 at 10:20 AM, Mike Moreton <mjvm_ns at hotmail.com> wrote:
> >
> > One of the problems that real world protocols have to contend with is that different nodes may have slightly different speed clocks - no two crystals are ever exactly the same.  You can get beating effects where everything runs fine for a while, and then at some point suddenly a whole load of things happen at once, and something goes wrong.
> >
> > Is there any way of simulating this with NS?  As fas as I can see NS-3 has one global view of "time".
> >
> 
> I once had a need of simulating an application which runs on many
> nodes that had to have a different 'local time'. I did this by using
> Simulator::Now() - <some delta> as the time within the application. I
> assumed that there was no drift (which isn't a realistic assumption
> either, but sufficed for my small scenario).
> 
> But I don't know any elegant way of doing this through every component
> of the node. You could try modifying the simulator implementation's
> ::Now() method to offset the timestamp by a delta corresponding to
> each node, but expect a significant performance drop. :)
> 
> 
> -- 
> Lalith Suresh
> www.lalith.in
 		 	   		  


More information about the Ns-developers mailing list