v3.23.1

Getting Started Devices Gateways Integrations Reference
Get The Things Stack

Reference

    Overview
  • Adaptive Data Rate
  • API
  • Application Packages
  • Billing with Stripe
  • Command-Line Interface
  • Components
  • Configuration
  • Data Formats
  • Data Retention and Privacy
  • Email Templates
  • Federated Authentication
  • Frequency Plans
  • FUOTA
  • Gateway RTT
  • Glossary
  • ID and EUI Constraints
  • Last Activity
  • LoRa Basics Station Implementation Guide
  • LoRaWAN Backend Interfaces Interoperability
  • LoRaWAN Specification and Regional Parameters
  • Networking
  • Packet Broker Routing
  • Packet Forwarders
  • Purging Entities
  • Rate Limiting
  • Resource Limiting
  • Root Certificates
  • Telemetry
  • Tenant Management
  • Web UI Branding

Gateway RTT

The Things Stack records Round Trip Times (RTT) between the Gateway Server and Gateways which act as a measure of latency.

This section explains how The Things Stack records and uses these values.

Background

Since The Things Stack communicates with gateways over the internet, a latency of transmitted messages is expected. This latency is not an issue for uplinks, but for downlinks, since the Rx windows are at specific intervals, the The Things Stack needs to be aware of network latency.

For UDP gateways, the RTT is the time difference between the moment a downlink message was sent and the moment when a corresponding valid Tx ACK was received.

For LoRa Basics™ Station gateways, the RefTime parameter that is sent on the Tx Confirmation message is used as the RTT. There are safeguards in place to make sure that a misbehaving gateway doesn’t skew the RTT measurement. If the RefTime value is greater than 10 seconds, it is considered invalid.

Downlink Scheduling

The Gateway Server uses RTT values to adjust downlink time when scheduling downlinks. The Things Stack by default stores a maximum of 20 recent RTT entries. Also, only those that were recorded within the the last 30 mins are considered.

When scheduling downlinks, if there are 5 or more RTT values that have been recorded in the last 30 mins, The Things Stack gets the 90th percentile value of these entries and uses that as the RTT. This value is then offset with either the gateway timestamp or the gateway absolute time (if the gateway has GPS) on the downlink that is scheduled.

If there are are lesser than 5 RTT entries in the past 30 mins, the downlink is scheduled without offsetting the RTT.

Querying RTT values

To query the RTT Values for each gateway can be found in the Gateway Connection stats.

Command-line interface only

The instructions below use the command-line interface (CLI).

Learn how to install the CLI
ttn-lw-cli gateways get-connection-stats <gateway-id>

The following is an example:

{
  "round_trip_times": {
    "min": "3.788374514s",
    "max": "3.788374514s",
    "median": "3.788374514s",
    "count": 1
  }
}

Troubleshooting

If the RTT values are high (ex: 5 seconds or more), check that the internet connection on the gateway is working properly. High RTT values are typically observed in Gateways with an LTE backhaul.

← FUOTA Glossary →

On this page

  • Background
  • Downlink Scheduling
  • Querying RTT values
  • Troubleshooting

The Things Stack

Getting Started

Devices

Gateways

Integrations

Reference

Contributing

GitHub

Forum

About Us

The Things Network

The Things Industries

About this page

Last changed by Nejra Selimović on 23 Dec 2021.
doc: Remove $ character from code blocks, add variables (#678)

Edit on Github