Z Sensor: Store & Forward Process
Understanding Store & Forward
Store and Forward is a data communication procedure where information is transmitted from one intermediate station and remains there until it is sent to another intermediate station. The intermediate station, also called a Z Sensor, authenticates the integrity of the message before transmitting it from the sensor to the gateway to the data server.
When a sensor takes a measurement, it puts the data in its local Store and Forward. If the sensor has a connection to the gateway, the received data will be augmented with state information about the device (battery, signal strength, etc.) and the age of the sensor data will be updated. The age of the sensor data reflects the difference between the time that the sensor data is read and the gateway’s current time (the current time syncs periodically with the server). When the server receives the packet, it will send an acknowledgment through the gateway to the sensor, then the Sensor will remove that data from the Store and Forward buffer.
On the gateway, the sensor data is included in the gateway’s Store and Forward queue. The gateway processes the data, adding its own data and updating the age, then sends the data to the SmartSense backend.
The gateway upload is UDP (user datagram protocol) or TCP (transmission control protocol), which are reliable data transfers in computer networking. After sending the packet, the gateway waits up to 30 seconds (can vary depending on the gateway) waiting for the ACK message (an acknowledgment that indicates the data was received successfully) from the SmartSense backend. When a successful ACK is received, the data is deleted from the Store and Forward buffer. If no ACK is received, the packet is resent. After 3 attempts, the packet is removed from the queue.
There are situations where the gateway may bring down the Zigbee network, which is a low-power wireless technology, and will stop accepting messages from sensors. Sensors will expand the data in the Store and Forward buffers. When the network returns and they are able to connect, the sensors will start sending messages to clear the Store and Forward buffer.
If a gateway has data from sensors and loses connection with the SmartSense backend, it will keep that data in its own Store and Forward buffer. When the link returns, it will update the age in the report and send it.
Note that this update to the age reflects the aging of both the sensor data and the sensor's state information.
Loss Scenario
The Store and Forward buffer can store approximately one month of 15-minute interval data. If this amount of time is exceeded, data will be lost.