Document

TS003-2.0.0 Application Layer Clock Synchronization

Issue link: https://read.uberflip.com/i/1464682

Contents of this Issue

Navigation

Page 7 of 12

LoRaWAN ® Application Layer Clock Synchronization Specification TS003-2.0.0 ©2022 LoRa Alliance ® Page 8 of 13 The authors reserve the right to change specifications without notice. DeviceTime is the current end-device clock and is expressed as the time in seconds 225 since 00:00:00, Sunday 6 th of January 1980 (start of the GPS epoch) modulo 2 32 . Note that 226 this is the same format as the Time field in the LoRaWAN Class B beacon frame described 227 in the LoRaWAN Link Layer Specification [TS001]. The time is captured immediately before 228 transmitting the radio packet. The processing delay between the clock time capture and the 229 transmission of the packet SHOULD be minimized. The intent is to provide near-second 230 accuracy. Therefore, the delay SHALL be less than 250ms. 231 232 If the AnsRequired bit is set to 1, the end-device expects an answer regardless if its clock 233 is well synchronized or not. If this bit is set to 0, this signals to the Application Server that it 234 only needs to answer if the end-device clock is out of synchronization. 235 236 TokenReq is a 4-bit counter value, and it SHOULD initially be set to 0. TokenReq SHALL 237 be incremented (modulo 16) each time the end-device receives and processes an 238 AppTimeAns message successfully. 239 240 The Application Server MAY respond to the AppTimeReq command with an AppTimeAns 241 command with the following payload: 242 243 Size (octets) 4 1 Field TimeCorrection Param Table 6: AppTimeAns 244 Where: 245 Bits 7:4 3:0 Param Fields RFU TokenAns Table 7: Param format 246 If the AnsRequired bit is 0, the Application Server SHALL respond if the end-device 247 indicated the current clock timing drifts were above a particular application-specific 248 threshold. If the end-device's clock is well synchronized, the Application Server SHOULD 249 NOT send an answer. The Application Server uses the timestamp of the uplink frame to 250 compute the required timing correction. 251 252 If the AnsRequired bit is 1, the Application Server SHALL respond to the AppTimeReq 253 command. Not responding to the end-device may trigger a retransmission of AppTimeReq 254 by the end-device until it receives an answer. This retransmission strategy is application 255 specific. 256 257 When the Application Server answers, TimeCorrection is a signed 32-bit integer, 258 stipulating the time delta correction in seconds. 259 260 TokenAns SHALL match the TokenReq value of the AppTimeReq message that is being 261 answered. If the TokenAns and TokenReq fields do not match, the end-device SHALL 262 ignore the AppTimeAns message. 263 264 If the two tokens match, the end-device SHALL increment its TokenReq internal counter 265 (modulo 16) and TimeCorrection SHALL be added to the current end-device clock to 266 be synchronous with the network clock. The end-device SHALL immediately perform the 267 correction on its clock. Any following transmission of the AppTimeReq message SHALL 268 reflect the timing correction and the incremented TokenReq value to avoid unnecessary 269 downlinks. 270

Articles in this issue

view archives of Document - TS003-2.0.0 Application Layer Clock Synchronization