My wireless sensor nodes and gateway application use timestamps as nonce and will guaranty that different messages use different nonces so security is not compromised.
If for some reason the gateway does not include logic to discard packets with old timestamps relative to its own clock, a replay attack can be sent to it. Beneficially, the sensor would then also be able to re-transmit the exact same packet later if the gateway was down. Let's say the sensor was not able to deliver the packet to the gateway, but it was picked up by an eavesdropper.
If for some reason the eavesdropper would like to replay this message, it would actually do the system a favor, as I can see it.
So, if the sensor only transmits sensor data samples with timestamps, can one say that it's not vulnerable to replay attacks?
And if the "sensor" includes a button to switch something on and off (real-time function), then one could discard packets with old timestamps.
Let's say a counter was used as the nonce rather than timestamps and there are hundreds of sensors connected to the gateway. Then the gateway would need to keep track of each individual counter that belongs to each sensor (complications like power cycling retention, flash endurance and etc) in order to prevent replay attacks. But using timestamps (and sharing the current time to the sensors initially) no such counters need to be monitored - wouldn't this be right?
Let's go back to the button example, and say that a counter nonce was used. The man in middle could then listen in to a button event packet and simultaneously do jamming at the end of the data packet (during CRC). This way the gateway did not receive the packet and it has not incremented its counter value (for this sensor). The jammer however did receive the packet (hoping that there was no bit errors). The jammer will continuously jam the sensor for future packets - to prevent the gateway to update its counter. Then later, it would transmit the packet it copied earlier - and the packet would be accepted(!) Using timestamps this would not happen, as I can see it. Or am I missing something here...?