Accurate clock models for simulating Wireless Sensor Networks

Time-critical parts of Wireless Sensor Network (WSN) applications, like medium access (MAC) and synchronization protocols, require an accurate timing analysis of their behavior. Meaningful simulation results are only achieved when the simulator provides a realistic model of the node's hardware (HW) clock. This paper provides three main contributions: (1) a realistic clock-drift model that allows to simulate HW clocks with an accuracy error of less than 1 μsec, (2) a clear interface to schedule timers/events that abstracts the artificial simulation time from the user and ensures that the HW time is used when implementing applications, and (3) a clock translator that converts the HW time of a node to the simulation time when scheduling events (hidden from the user). We implement and validate these extensions in Castalia, a WSNs simulator based on the OMNeT++ platform. We show that they have only minimal effects on the memory and processing demands of the simulation.