User Tools

Site Tools


wiki:wiki3:network_delays

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:wiki3:network_delays [2019/02/18 14:13]
tda created
wiki:wiki3:network_delays [2023/05/10 15:05] (current)
mse
Line 1: Line 1:
 ====== Network delays configuration ====== ====== Network delays configuration ======
  
-Network ​delay configuration helps target the RX1 window when sending TX messages to an end-device.+Network ​delays ​configuration helps target the RX1 window when sending TX messages to an end-device.  
 +It also allows adaptation to networks with high latency.
  
 ===== Configuration ===== ===== Configuration =====
 +==== Menu ====
 +From the backhaul configuration menu of each gateway, the network delay uplink and downlink can be configured. The default configuration is 350ms. ​
  
-On the LNS section of each gateway, the network delay uplink and downlink can be configured. By default it is 350ms. Here is how it looks like:+Path to the menuManagements -> gateways->​ <​gateway_EUI>​ -> configurations -> backhaul
  
-{{:images:lns_network_delay.png|}}+{{:wiki3:network_delays_wmc3.0.png|}}
  
 This value is an indication of the network delays that the gateway has towards and from the LNS server. This value is an indication of the network delays that the gateway has towards and from the LNS server.
 +==== Samples of configuration ====
 +<note important>​The latency of the gateway can be evaluated from the ping (delay up + delay down) KPI. 
 +
 +On a fast network, to target the RX1 window with maximum anticipation,​ the following configuration must be set:
 +|Network max. delay up | |Network max. delay down |
 +|0| |400|
 +
 +On a slow network, to target the RX2 window with maximum anticipation,​ the following configuration must be set:
 +|network max. delay up | |network max. delay down |
 +|0| |1400| ​
 +
 +
 +</​note>​
  
 ===== Behavior ===== ===== Behavior =====
Line 15: Line 31:
 When an end-device sends a LoRa packet, each gateway that receives it will forward it to the LNS server. The LNS server will wait 350ms after having received the first packet, in order to aggregate all the copies of that packet sent by each individual gateway. When an end-device sends a LoRa packet, each gateway that receives it will forward it to the LNS server. The LNS server will wait 350ms after having received the first packet, in order to aggregate all the copies of that packet sent by each individual gateway.
  
-It will then try to see which window ​is best to send the TX message to the end device. To do so, it will add the //network ​delay down// to the current time, and see if this fits, with an additional 50ms margin. If this allows to reach the RX1 window delay (usually one second), then it will send it soon. If this doesn'​t allow to reach the RX1 window, it will target the RX2 window (usually two seconds).+If a push is configured for the cluster, the LNS server ​will wait 150 ms after the push, in order to offer the client the opportunity to reply to the message in the following RX window
 + 
 +The LNS will then choose the best RX window ​to send the TX message to the end-device. To do so, it will add the //Network max delay down// to the current time, and see if this fits, with an additional 50ms margin. If this allows to reach the RX1 window delay (usually one second), then it will send it soon. If this doesn'​t allow to reach the RX1 window, it will target the RX2 window (usually two seconds).
  
-==== RX window decision ==== 
  
-So the RX window decision ​is basically:+++++  
 +RX window decision ​method |
  
 <​code>​ <​code>​
-T0 = now - Ndu +T0lns = now - Ndu 
-Test = T0 + Tagg + Ndd hr +Test = now + Tagg + Topp Ndd 
-Decision = Test-T0 < 1000 ? +Decision = Test - T0lns = Ndu + Tagg + Topp + Ndd < 1000 ? 
-Ttx = T0 + Twin - Ndd+Ttx = now + Twin - Ndd
 </​code>​ </​code>​
  
Line 31: Line 49:
  
    * ''​T0'':​ packet transmission date by gateway.    * ''​T0'':​ packet transmission date by gateway.
 +   * ''​T0lns'':​ packet transmission date by gateway estimated by lns.
    * ''​now'':​ packet reception date by LNS.    * ''​now'':​ packet reception date by LNS.
    * ''​Ndu'':​ //Network max. delay up//: the setting on the dashboard (350ms by default).    * ''​Ndu'':​ //Network max. delay up//: the setting on the dashboard (350ms by default).
    * ''​Test'':​ estimated earliest timestamp for transmission    * ''​Test'':​ estimated earliest timestamp for transmission
    * ''​Tagg'':​ Aggregation time: the LNS waits 350ms after the first packet.    * ''​Tagg'':​ Aggregation time: the LNS waits 350ms after the first packet.
 +   * ''​Topp'':​ Opportunity time: the LNS waits 150ms after the first packet.
    * ''​Ndd'':​ //Network max. delay down//: the setting on the dashboard (350ms by default).    * ''​Ndd'':​ //Network max. delay down//: the setting on the dashboard (350ms by default).
-   * ''​hr'':​ Headroom: the LNS adds a 50ms margin. 
    * ''​Decision'':​ whether the RX1 window is reachable, 1000ms being the default RX1 value (it can be changed).    * ''​Decision'':​ whether the RX1 window is reachable, 1000ms being the default RX1 value (it can be changed).
    * ''​Ttx'':​ the time at which the LNS will send the packet to the gateway.    * ''​Ttx'':​ the time at which the LNS will send the packet to the gateway.
    * ''​Twin'':​ the time for the target RX window (1000ms by default for RX1).    * ''​Twin'':​ the time for the target RX window (1000ms by default for RX1).
 +++++ 
  
-=== Example ​===+++++  
 +Example ​|
  
 Inputs: Inputs:
Line 54: Line 75:
 Computation:​ Computation:​
  
-   * ''​T0''​ assumed is ''​09:​59:​59.846''​ by LNS (''​now''​ minus 350ms ''​Ndu''​). +   * ''​T0lns''​ assumed is ''​09:​59:​59.846''​ by LNS (''​now''​ minus 350ms ''​Ndu''​). 
-   * ''​Test''​ is ''​T0''​ + 350 + 350 + 50 = ''​10:​00:​00.596''​ +   * ''​Test'' ​without push is ''​now''​ + 350 + 350 = ''​10:​00:​00.896''​ 
-   * Decision: ''​Test''​ is less than 1000ms after ''​T0'',​ so RX1 is reachable. +   * ''​Test''​ with push is ''​now''​ + 350 + 150 + 350 = ''​10:​00:​01.046''​ 
-   * ''​Ttx''​ is ''​T0''​ + 1000 - 350 = ''​10:​00:​00.496''​ (time at which the LNS sends the TX message)+   * Decision: ''​Test''​ is greater ​than 1000ms after ''​T0'',​ so RX1 isn't reachable. 
 +   * Decision: ''​Test''​ is less than 2000ms after ''​T0'',​ so RX2 is reachable. 
 +   * ''​Ttx''​ is ''​T0lns''​ + 2000 - 350 = ''​10:​00:​01.496''​ (time at which the LNS sends the TX message)
  
 Behavior: Behavior:
  
-   * The LNS sends the packet at ''​10:​00:​00.496''​ (''​Ttx''​). +   * The LNS sends the packet at ''​10:​00:​01.496''​ (''​Ttx''​). 
-   * The packet forwarder receives it at ''​10:​00:​00.708''​ (''​Ttx+212ms''​). +   * The packet forwarder receives it at ''​10:​00:​01.708''​ (''​Ttx'' ​+ 212ms). 
-   * The LoRa frame is sent at ''​10:​00:​01.000''​ when the RX1 window opens. Actual timing is done with ''​tmst''​ (SX1301 clock counter).+   * The LoRa frame is sent at ''​10:​00:​02.000''​ when the RX2 window opens. Actual timing is done with ''​tmst''​ (SX1301 clock counter). 
 +++++
  
-==== Notes ====+++++  
 +Notes |
  
-   ​* ​The packet forwarder ​has a delay between the IP packet reception and the TX LoRa frame going out of the radio. This processing delay is around 30-50ms.+   ​* ​Due to the packet forwarder ​processing time, a delay of 30ms to 50ms occurs ​between the IP packet reception and the TX LoRa frame going out of the radio.
    * The computation algorithm above is only for the RX window **decision**. The actual **scheduling** of the packet is done using the ''​tmst''​ field of the packet forwarder, and adding the corresponding SX1301 ticks to reach the RX1 or RX2 windows.    * The computation algorithm above is only for the RX window **decision**. The actual **scheduling** of the packet is done using the ''​tmst''​ field of the packet forwarder, and adding the corresponding SX1301 ticks to reach the RX1 or RX2 windows.
-   * The LNS will try to keep the TX messages as long as possible and will send them at the last moment. This is by design to allow less load on the packet ​forwarder. Indeed, if the TX messages were sent as soon as possible, the gateways might get a lot of TX messages queued which would be problematic on embedded devices.+   * The LNS will keep the TX messages ​for as long as possibleand send them at the last moment. This is by designto allow less load on the packet ​forwarders. Indeed, if the TX messages were sent as soon as possible, the gateways might get a lot of TX messages queuedwhich would be problematic on embedded devices. 
 +++++ 
 + 
  
 ===== Actual behaviors ===== ===== Actual behaviors =====
Line 75: Line 103:
 Several situations may arise: Several situations may arise:
  
-   * The backhaul is very good (<​100ms ​RTT), everything works (nominal case). +   * The backhaul is correct ​(~200ms ​RTT), with default configuration ​everything works (nominal case with push). 
-   * The backhaul is fair (300ms RTT), but the RX1 window is sometimes missed+   * The backhaul is very good (<​100ms ​RTT), with specific configuration everything works (RX1 target with push)
-   * The backhaul is not good (>​500ms ​RTT), and the TX messages aren't transmitted ​properly.+   * The backhaul is not good (~800ms ​RTT), with default configuration ​the TX messages aren't transmitted
 +   * The backhaul is not good (~800ms RTT), with specific configuration everything works (RX2 target with push).
    * The backhaul is very bad (>1000ms RTT), and the TX messages aren't transmitted properly.    * The backhaul is very bad (>1000ms RTT), and the TX messages aren't transmitted properly.
 +   * The backhaul is correct (~200ms RTT), everything works (nominal case without push).
  
-==== Very good backhaul (<​100ms ​RTT) ====+==== Correct ​backhaul (~200ms ​RTT) ====
  
-This is the nominal case. The LNS will always target the RX1. The configured delays on the dashboard are the default values (350ms).+This is the nominal case. The LNS will always target the RX2. The configured delays on the dashboard are the default values (350ms).
  
-{{:images:lns_delay_50ms.png|}}+{{:images:326lns_delay_200ms.png|}}
  
-==== Fair backhaul (300ms RTT) ==== +==== Very good backhaul (<​100ms ​RTT) ====
- +
-This is an edge case of the nominal case. The LNS will miss the RX1 depending on the actual network delay. The configured delays on the dashboard are the default values (350ms).+
  
-{{:​images:​lns_delay_300ms.png|}}+The LNS will target the RX1 depending on the configured network delay.  
 +The configured network delays on the dashboard are set to 0ms and 400ms for //Network max. delay up// and //Network max. delay down//.
  
-In this example, the RX1 is missed. If the network delay had been configured to 300ms, the RX1 window may have been reachable.+{{:​images:​326lns_delay_100ms.png|}}
  
-In this caseit is very important to reconfigure ​the network delay on the dashboardThis will help to reach the RX1 window ​as soon as the actual network delay is good.+In this example (0ms/400ms)the RX1 is reachable.  
 +If the //Network maxdelay down// had been configured ​to 100ms, ​the RX1 window ​targeted may have been reachable without margin. 
 +With default configuration (350ms/​350ms),​ RX2 window ​is targeted.
  
-==== Not good backhaul (800ms RTT) ====+==== Not good backhaul (~800ms RTT) ====
  
 In this case the RX1 window is not reachable. The RX2 window is also missed, unless the network delay is adjusted. In this case the RX1 window is not reachable. The RX2 window is also missed, unless the network delay is adjusted.
  
-This is by default with 350ms //Network max. delay down//:+//Network max. delay down// ​is set with the default configuration:
  
-{{:images:lns_delay_800ms_unconfigured.png|}}+{{:images:326lns_delay_800ms_ko.png|}}
  
-In this case the RX2 is missed and the TX packet is dropped. The solution is to change the //Network max. delay down// to a value of 850ms:+In this case the RX2 is missed and the TX packet is dropped. The solution is to change the //Network max. delay up// and //Network max. delay down //to a value of 0ms and 850ms:
  
-{{:wiki:lns_delay_800ms_configured.png|}}+{{:images:326lns_delay_800ms.png|}}
  
 The RX1 is not reachable, but the RX2 is, thanks to the updated configuration. The RX1 is not reachable, but the RX2 is, thanks to the updated configuration.
Line 112: Line 143:
 ==== Very bad backhaul (>​1000ms) ==== ==== Very bad backhaul (>​1000ms) ====
  
-In this case the RX1 and RX2 windows are never reachable. ​Indeed, with an example 1200ms ​RTT, the delay is:+In this case the RX1 and RX2 windows are never reachable. ​For instance, with RTT of 1200ms, the delay is:
  
 <​code>​1200 + 350 + 50 + 1200 = 2800ms</​code>​ <​code>​1200 + 350 + 50 + 1200 = 2800ms</​code>​
  
-The RX2 window has to be changed in order for this to work. On each end device, and on the dashboard configuration of the end device, the RX1 window delay has to be adjusted to a greater value. For example, ​2000 (for RX2 target) or 3000ms (for RX1 target) is fine.+The RX1 window ​delay has to be adjusted ​to a greater value on each end-device, and on the WMC end-devices configuration interface. For example, ​setting RX1 to 2000ms ​(to reach the RX2 window) or 3000ms (to reach the RX1 window) is fine
 +  
 +This solution is possible at the cost of provisioning every end-devices of the network, so that it can work with high latencies. This network configuration is useful with satellite backhaul, for example.
  
-Indeed, the delay calculated above is 2800ms, so if RX1 delay is 3000ms, it is reachable. 
  
-This is possible at the cost of provisioning every end device ​on the network so that it can work with high latenciesThis can be useful with satellite backhaul, for example.+==== Correct backhaul (~200ms RTT) without push ==== 
 + 
 +This is the nominal case. The LNS will always target the RX2. The configured delays ​on the dashboard are the default values (350ms). 
 + 
 +{{:​images:​326lns_delay_200ms_adr.png|}} 
  
 ===== Edge case: idle cellular radios ===== ===== Edge case: idle cellular radios =====
Line 143: Line 180:
  
 Another way to work around this is to configure a 1000ms //Network max. delay up// and a 200ms //Network max. delay down//. This will allow the LNS to finely compute the delays, and be able to reach the RX2 window. Another way to work around this is to configure a 1000ms //Network max. delay up// and a 200ms //Network max. delay down//. This will allow the LNS to finely compute the delays, and be able to reach the RX2 window.
 +
 +
wiki/wiki3/network_delays.1550495595.txt.gz · Last modified: 2019/02/18 14:13 by tda