Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P25Gateway Static Reflectors - Switching due to network activity on heartbeats not voice traffic #584

Open
TRENT310 opened this issue Jan 5, 2025 · 2 comments

Comments

@TRENT310
Copy link

TRENT310 commented Jan 5, 2025

With the last release of P25Gateway (20240831) compiled on an amd64 (x86_64)/EL9 platform and when 1 or more static reflector talkgroups are specified in the P25Gateway.ini file, this version constantly switches back and forth between one or more of those reflector(s) "due to network activity" even when there is actually no network activity, it was just a periodic heartbeat response at around 5 second intervals from the reflector. The expectation (and the observed behaviour with an armhf/Debian build of the same code) is that the P25Gateway only switches to a reflector carrying valid voice traffic activity, and ignores regular heartbeat activity approximately at intervals of every 5 seconds.

This code was make compiled on both the system it is operating on (AlmaLinux 9.4) as well as also attempted on WSL (Windows Subsystem for Linux) and then the binary transferred over and executed with the same result. It appears that upon a cursory review of the source code, that reflector supervisory control traffic received is specifically meant to be excluded from consideration as "network activity" however this case it is not, is causing P25Gateway to constantly switch, and also miss or late enter to actual voice traffic occurring on other reflectors, with the side effect of also filling up log files.

Since the same code compiles on armhf and does not exhibit this behaviour could there be potential that there is somehow a difference between the compilers between these architectures causing the reflector heartbeats to be erroneously considered as valid voice traffic activity. A roll back was also attempted to the 20201105 version of P25Gateway source, with the same result but again only on amd64 build.

See below excerpt from the log files with the reflector debug enabled. Debug hex has been intentionally truncated for this posting, but it is the timestamps that are of interest. This is with NetHangTime parameter set to an intentionally short duration of 1 second to demonstrate that P25Gateway is constantly reconnecting every heartbeat interval.

M: 2025-01-05 22:26:01.220 Starting P25Gateway-20240831
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
I: 2025-01-05 22:26:01.220 Started the DMR Id lookup reload thread
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
M: 2025-01-05 22:26:01.220 Statically linked to reflector 10200
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
D: 2025-01-05 22:26:01.220 P25 Network Poll Sent
D: 2025-01-05 22:26:01.220 0000: F0
M: 2025-01-05 22:26:01.220 Statically linked to reflector 10201
D: 2025-01-05 22:26:01.292 P25 Network Data Received
D: 2025-01-05 22:26:01.292 0000: F0
M: 2025-01-05 22:26:01.292 Switched to reflector 10200 due to network activity
D: 2025-01-05 22:26:01.292 P25 Network Data Received
D: 2025-01-05 22:26:01.292 0000: F0
D: 2025-01-05 22:26:01.297 P25 Network Data Received
D: 2025-01-05 22:26:01.297 0000: F0
D: 2025-01-05 22:26:01.297 P25 Network Data Received
D: 2025-01-05 22:26:01.297 0000: F0
D: 2025-01-05 22:26:01.302 P25 Network Data Received
D: 2025-01-05 22:26:01.302 0000: F0
D: 2025-01-05 22:26:01.302 P25 Network Data Received
D: 2025-01-05 22:26:01.302 0000: F0
M: 2025-01-05 22:26:02.288 Unlinking from 10200 due to inactivity
D: 2025-01-05 22:26:06.222 P25 Network Poll Sent
D: 2025-01-05 22:26:06.222 0000: F0
D: 2025-01-05 22:26:06.222 P25 Network Poll Sent
D: 2025-01-05 22:26:06.222 0000: F0
D: 2025-01-05 22:26:06.294 P25 Network Data Received
D: 2025-01-05 22:26:06.294 0000: F0
M: 2025-01-05 22:26:06.294 Switched to reflector 10200 due to network activity
D: 2025-01-05 22:26:06.294 P25 Network Data Received
D: 2025-01-05 22:26:06.294 0000: F0
M: 2025-01-05 22:26:07.290 Unlinking from 10200 due to inactivity
D: 2025-01-05 22:26:11.223 P25 Network Poll Sent
D: 2025-01-05 22:26:11.223 0000: F0
D: 2025-01-05 22:26:11.223 P25 Network Poll Sent
D: 2025-01-05 22:26:11.223 0000: F0
D: 2025-01-05 22:26:11.296 P25 Network Data Received
D: 2025-01-05 22:26:11.296 0000: F0
M: 2025-01-05 22:26:11.296 Switched to reflector 10200 due to network activity
D: 2025-01-05 22:26:11.296 P25 Network Data Received
D: 2025-01-05 22:26:11.296 0000: F0
M: 2025-01-05 22:26:12.291 Unlinking from 10200 due to inactivity
D: 2025-01-05 22:26:16.227 P25 Network Poll Sent
D: 2025-01-05 22:26:16.227 0000: F0
D: 2025-01-05 22:26:16.227 P25 Network Poll Sent
D: 2025-01-05 22:26:16.227 0000: F0
D: 2025-01-05 22:26:16.300 P25 Network Data Received
D: 2025-01-05 22:26:16.300 0000: F0
M: 2025-01-05 22:26:16.300 Switched to reflector 10201 due to network activity
D: 2025-01-05 22:26:16.300 P25 Network Data Received
D: 2025-01-05 22:26:16.300 0000: F0
M: 2025-01-05 22:26:17.299 Unlinking from 10201 due to inactivity
D: 2025-01-05 22:26:21.232 P25 Network Poll Sent
D: 2025-01-05 22:26:21.232 0000: F0
D: 2025-01-05 22:26:21.232 P25 Network Poll Sent
D: 2025-01-05 22:26:21.232 0000: F0
D: 2025-01-05 22:26:21.304 P25 Network Data Received
D: 2025-01-05 22:26:21.304 0000: F0
M: 2025-01-05 22:26:21.304 Switched to reflector 10201 due to network activity
D: 2025-01-05 22:26:21.305 P25 Network Data Received
D: 2025-01-05 22:26:21.305 0000: F0
M: 2025-01-05 22:26:22.304 Unlinking from 10201 due to inactivity
D: 2025-01-05 22:26:26.233 P25 Network Poll Sent
D: 2025-01-05 22:26:26.233 0000: F0
D: 2025-01-05 22:26:26.233 P25 Network Poll Sent
D: 2025-01-05 22:26:26.233 0000: F0
D: 2025-01-05 22:26:26.305 P25 Network Data Received
D: 2025-01-05 22:26:26.306 0000: F0
M: 2025-01-05 22:26:26.306 Switched to reflector 10201 due to network activity
D: 2025-01-05 22:26:26.306 P25 Network Data Received
D: 2025-01-05 22:26:26.306 0000: F0
M: 2025-01-05 22:26:27.302 Unlinking from 10201 due to inactivity
I: 2025-01-05 22:26:29.135 Closing Rpt network connection
I: 2025-01-05 22:26:29.135 Closing P25 network connection
I: 2025-01-05 22:26:29.223 Stopped the DMR Id lookup reload thread
I: 2025-01-05 22:26:29.223 P25Gateway-20240831 exited on receipt of SIGTERM

@RdWing
Copy link
Contributor

RdWing commented Jan 9, 2025

This has been a problem for a long time. There are some other old old builds floating around the internet that don't suffer from this.

@TRENT310
Copy link
Author

TRENT310 commented Jan 9, 2025

Some further testing with armv7l aarch64 builds (in case this was somehow a base architecture difference) is showing the same behaviour. It is constantly reconnecting back to valid reflectors in the static= list but which aren't carrying voice traffic. Invalid reflectors (unresolvable hostname, black hole, or loopback addresses defined in P25Hosts.txt) do not cause this connection.

The only working platform/build where this is functioning as expected so far, is armhf and I have also tried dropping in a binary copied from one of those working systems. Unfortunately that is getting old and technologies are moving away from that platform, so it is worth reviewing the code to see why it is doing this when built on 64-bit or other modern kernels. Also further testing may be done on multiarch or virtualizing the functional environment, but those add extra layers which should not be needed for some fairly lightweight software like this.

Old builds prior to having the multiple static reflector connection capability are fine, and a workaround by leaving the static= configuration blank on the recent version prevents this from happening but then undermines the capability entirely. This multiple reflector functionality is useful from a radio user perspective as they do not have to monitor a separate, out-of-band dashboard or similar status webpage to determine where traffic may be occurring to manually make a connection to a reflector; they will naturally hear traffic on their radio (as long as the selective squelch or unmute rules are appropriately configured) which enables the user to make contact or join in on a conversation, and this is especially important when P25Gateway is leveraged as the back end supporting shared or wide-area coverage repeaters, rather than just an individual personal hotspot.

This issue, along with the other long standing issue for several years with "canned" P25 HDU headers (specifically, the talkgroup ID which is not synthetically generated, and therefore does not always match the LDU1 link control parameters in accordance with TIA-102.BAAA) which I have described in much greater detail elsewhere, and along with the incorrect generation and insertion of Status Symbols which need to reflect the actual state of duplex operation (impacting functionality of busy channel lockout) is detrimental to the effective use of multiple talkgroups and especially for those who are experiencing P25 for their first or only time via the MMDVM implementation, are getting a poor first impression of what is otherwise a highly robust and production-grade radio protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants