Summary
Kerlink deviates from the reference UDP Packet Forwarder and Basic Station implementations in behavior that affects the round-trip time measurement by The Things Stack. We need to detect the Kerlink gateways by EUI and either disable round-trip time measurements or use a different mechanism.
Why
For GWMP (the UDP client), the TX_ACK message is typically only sent at transmission time. This means that there's a delay before TX_ACK is sent, depending on RX1 delay and whether RX1 or RX2 is chosen. In contrast, the reference Semtech UDP Packet Forwarder responds with TX_ACK immediately. Since there's no ping mechanism in the UDP protocol, The Things Stack uses the time between PULL_RESP and TX_ACK as round-trip time, but for Kerlink gateways this doesn't work because of the deliberate delay.
For Basic Station, the Kerlink implementation does not support timesync.
Implementation proposal
For both protocols, there can be a special handling for gateway EUIs starting with 7076FF and 7276FF.
The semtechudp server implementation should disable recording round-trip times for these gateway EUI ranges. Alternatively, we could send a PULL_RESP with deliberately a wrong frequency or wrong timestamp (too late), as Kerlink suggests that TX_ACK is sent immediately in those cases.
The lbslns server implementation should use ping/pong for round-trip times. This can also be used for other gateway models, but not for all gateways, as not all Basic Station clients support ping/pong. For example, the TrackNet Mini Hubs (including the original The Things Indoor Gateway) don't respond with pong messages. Maybe we can whitelist the Mini Hubs and use ping/pong for round-trip time observation for all other gateways.
Acceptance criteria
- GWMP gateways either record no round-trip times, or correct round-trip times via invalid downlink requests
- Basic Station records correct round-trip times via ping/pong
- Non-Kerlink gateways keep their existing round-trip time observations
Summary
Kerlink deviates from the reference UDP Packet Forwarder and Basic Station implementations in behavior that affects the round-trip time measurement by The Things Stack. We need to detect the Kerlink gateways by EUI and either disable round-trip time measurements or use a different mechanism.
Why
For GWMP (the UDP client), the
TX_ACKmessage is typically only sent at transmission time. This means that there's a delay beforeTX_ACKis sent, depending on RX1 delay and whether RX1 or RX2 is chosen. In contrast, the reference Semtech UDP Packet Forwarder responds withTX_ACKimmediately. Since there's no ping mechanism in the UDP protocol, The Things Stack uses the time betweenPULL_RESPandTX_ACKas round-trip time, but for Kerlink gateways this doesn't work because of the deliberate delay.For Basic Station, the Kerlink implementation does not support
timesync.Implementation proposal
For both protocols, there can be a special handling for gateway EUIs starting with
7076FFand7276FF.The
semtechudpserver implementation should disable recording round-trip times for these gateway EUI ranges. Alternatively, we could send aPULL_RESPwith deliberately a wrong frequency or wrong timestamp (too late), as Kerlink suggests thatTX_ACKis sent immediately in those cases.The
lbslnsserver implementation should use ping/pong for round-trip times. This can also be used for other gateway models, but not for all gateways, as not all Basic Station clients support ping/pong. For example, the TrackNet Mini Hubs (including the original The Things Indoor Gateway) don't respond with pong messages. Maybe we can whitelist the Mini Hubs and use ping/pong for round-trip time observation for all other gateways.Acceptance criteria