Trust device-reported uplink speed over upstream port table#209
Open
tvancott42 wants to merge 5 commits intomainfrom
Open
Trust device-reported uplink speed over upstream port table#209tvancott42 wants to merge 5 commits intomainfrom
tvancott42 wants to merge 5 commits intomainfrom
Conversation
When a UniFi device (AP, modem, etc.) has a wired uplink through an unmanaged switch, the upstream UniFi switch port may report a different speed than what the device actually negotiates. For example, an AP with 1 GbE connected to an unmanaged PoE switch, which is connected to a gateway via 10 GbE SFP+ - the gateway port shows 10 GbE but the AP reports 1 GbE. Now prefer the device's own reported uplink speed (from Uplink.Speed in the API response) over the upstream port table lookup, with fallback to the port table if the device doesn't report a speed. Fixes #189
Logs when the device's reported uplink speed differs from the upstream port table, making it clear which value is being used for path tracing.
Tests verify that when a device's reported uplink speed differs from the upstream port table (unmanaged switch scenario), the device's speed is preferred. Also tests fallback to port table when device reports 0, and confirms mesh APs continue to use wireless path.
Gateway UplinkSpeedMbps represents WAN speed, not LAN port speed. Only apply the device-reported uplink speed preference for non-gateway devices (APs, switches, modems, etc.). Adds test to verify gateways use port table speed.
The fix should apply when going TOWARD gateway (uplink direction matches): - Target device: uses device uplink speed ✓ - Intermediate hops in main loop: uses device uplink speed ✓ Return path (AWAY from gateway) correctly uses port table: - Daisy-chain downstream: port table ✓ - Inter-VLAN return path: port table (except first hop ingress) ✓
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background
When a UniFi device connects through an unmanaged PoE switch, the upstream UniFi port may report a different (usually higher) speed than the device's actual link. For example, an AP with 1 GbE connected to an unmanaged switch, which connects to a gateway via 10 GbE SFP+ - the gateway port shows 10 GbE but the AP correctly reports 1 GbE.
Test plan
Fixes #189