VOTER-Buffers
Introduction
There are two types of buffers involved in the VOTER/RTCM.
Buffer Settings
The buflen parameter in the [general]
stanza specifies the receiver buffer length in milliseconds'. This parameter should be set to the maximum expected network latency, plus a little padding (100mS of padding is a good amount). The default is 500 milliseconds, and is what the value will be set to if not specified.
The Tx Buffer Length parameter on each VOTER client, is similar to the buflen parameter for the receive (host) side. It sets the transmit buffer length in samples (8000 samples per second, so 8 samples = 1 millisecond). Like the buflen parameter, this should be set to the maximum expected network latency plus a little padding (800 samples is a good amount of padding, so setting the parameter to 3000 is probably a good place to start).
In both the receive and transmit cases, the buffer length is a fixed value. This will hard-set the delay time between actual reception and presentation time to the Asterisk channel (in the case of receive), and presentation from the Asterisk channel and actual transmission (in the case of transmit).
Since the overall system time delay (the amount of time between reception and re-transmission of the signal) is determined as the sum of the receiver buffer length, the (very minimal) latency within app_rpt/Asterisk
and the Transmit buffer length, it is very necessary to keep these settings to a reasonable minimum (without sacrificing packet consistency/integrity by making it too short based upon network latency/jitter).
RX/TX Buffers are NOT Both Millisecond Values
You might assume an RX buffer (in voter.conf) of 120ms would be equivalent of a TX buffer (in the RTCM) of 120ms. That is not the case.
The TX buffer is a number of 125 microsecond intervals, where the RX buffer is in milliseconds.
If you follow the buffer setting instructions, you should be fine, in most cases.
Setting Voter Buffers
Voter ping is useful for end-to-end network evaluation when ICMP ping is turned off and/or the RTCM is behind a firewall and is not ICMP reachable. It can also help with finding the correct RTCM and voter.conf buffer settings.
Voter Ping Usage
The voter ping asterisk CLI syntax is:
*CLI>voter ping nameOfClient [packetCount]
If packetCount is not specified 8 pings will be sent. Use packetCount of 0 to stop an in progress voter ping. Set packetCount to at least 100 when evaluating link quality.
The result will be similar to:
... PING (nameOfClient): Packets tx: 100, rx: 100, oos: 0, Avg.: 26.710 ms PING (nameOfClient): Worst: 38 ms, Best: 22 ms, 100.0% Packets successfully received (0.0% loss)
The output above is self evident except for oos which is a count of out of sequence packets. Voter ping requires RTCM firmware 1.23 or newer and chan_voter 2013-08-04 or newer.
RX Buffer Size
Ping all the receiver sites and look for the worst response of the worst client. As a rough rule of thumb the buflen setting in voter.conf should be set to the worst response + 40ms or 120 whichever is greater. Using the above case the buflen should be set to 120 (38+40
TX Buffer Size
Ping all the transmitter sites and look for the worst response of the worst client. The RTCM TX Buffer Length should be set to (worst response + 40ms) * 8 or 480 whichever is greater. Using the above case the RTCM TX Buffer Length should be set to 624 ((38+40)*8).
Assumptions
- The minimum TX buffer size is 480 (60ms) and the minimum RX buffer is 120ms. These were derived by testing on a LAN segment with chan_voter 2013-08-04 and RTCM 1.26.
- The ping times are not round trip times but they are in fact round trip times. Therefore the worst response could (should?) be divided by 2. Ie RX buffer = 38/2+40=59 and TX buffer = (38/2 + 40) * 8 = 472. Minimums still apply.
- The internet path to and from the RTCM under test is symmetrical.
- The added 40ms pad is an estimate of buffer ingress and egress.
As always your milage may vary. Some trial and error may be required to find the optimum settings.
Setup
The RX buffer is set with buflen=120 in /etc/asterisk/voter.conf. The value is in milliseconds. The TX buffer is set in the RTCM with menu item 7. The value is in 125 microsecond increments. To match the size of the TX to the RX buffer, use the RX buffer * 8 to get the TX buffer size.