Skip to content

Enable NM 1.52 link-local fallback resolution - #2321

Open
thatcomputerguy0101 wants to merge 4 commits into
PhotonVision:mainfrom
thatcomputerguy0101:link-local
Open

Enable NM 1.52 link-local fallback resolution#2321
thatcomputerguy0101 wants to merge 4 commits into
PhotonVision:mainfrom
thatcomputerguy0101:link-local

Conversation

@thatcomputerguy0101

@thatcomputerguy0101 thatcomputerguy0101 commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Description

This enables link-local as a fallback to DHCP address resolution, using the new features of NetworkManager 1.52. Debian 13 (Trixie) and Ubuntu 26.04 (Resolute) introduce the required updates to NetworkManager for this to work. Unlike #1550, this continues to timeout and retry DHCP while holding a link-local address, which should avoid breaking compatibility with DHCP servers that don't respond immediately.

Closes #1813, blocked on updating the images to have NM 1.52 or later.

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@github-actions github-actions Bot added the backend Things relating to photon-core and photon-server label Jan 21, 2026
@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

It would probably be good to mention this in the documentation, but I don't think there is currently a section talking about DHCP.

@mcm001

mcm001 commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Yeah, I don't believe our documentation talks about networking very much at all. It seems like a common enough foot gun. It may be worth mentioning, although most people probably don't need to know very much

@github-actions github-actions Bot added the documentation Anything relating to https://docs.photonvision.org label Jan 21, 2026
@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

I added some draft documentation, although I'm unsure if I got the level of detail right.

@Gold856
Gold856 force-pushed the 2027 branch 2 times, most recently from 4153f8b to 4d1f0a5 Compare March 16, 2026 04:19
@samfreund
samfreund force-pushed the 2027 branch 4 times, most recently from 03a43cd to 68fc1e7 Compare April 11, 2026 17:23
@samfreund
samfreund force-pushed the 2027 branch 5 times, most recently from 439f5fc to b8e9e4f Compare May 3, 2026 18:37
@samfreund
samfreund deleted the branch PhotonVision:main May 5, 2026 16:43
@samfreund samfreund closed this May 5, 2026
@samfreund samfreund reopened this May 5, 2026
@samfreund
samfreund changed the base branch from 2027 to main May 5, 2026 16:47
@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

When do we want to try introducing this? The Raspberry Pi and Arabian Orange Pi images have the necessary NM versions, but the Rubik Pi and Joshua Riek Orange Pi images do not. It shouldn't break with older NM versions, but it won't do anything either.

@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

All of our images now have at least NM 1.52, so this feature should now be functional.

@thatcomputerguy0101
thatcomputerguy0101 marked this pull request as ready for review August 12, 2026 12:41
@thatcomputerguy0101
thatcomputerguy0101 requested a review from a team as a code owner August 12, 2026 12:41
@crschardt

crschardt commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I've been reading the NetworkManager issues and I'm not sure that version 1.52 completely solves this problem.

According to open issue 1775, we have to set ipv4.dhcp-timeout=infinity or the link local connection will still drop when the DHCP connection times out and NetworkManager resets the connection.

I'll try to do more testing when I have some time.

@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

Good catch. I tested this again, and the connection does seem to briefly drop approximately every 50 seconds when connected via the link-local address as it tries to renegotiate the DHCP address.

@thatcomputerguy0101
thatcomputerguy0101 marked this pull request as draft August 13, 2026 03:36
@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

I tried combining this with ipv6-method link-local. In that case, the ipv4 link-local address without a DHCP server is stable. It transfers automatically to an ipv4 DHCP address once a server is available the next time it checks for a DHCP server (approx. every 50s). It does not revert back to a link-local address if the server disappears until the physical link is broken and reconnected. (Tested by turning on and off network bridging on the host computer.)

@thatcomputerguy0101
thatcomputerguy0101 marked this pull request as ready for review August 13, 2026 03:59
@mcm001

mcm001 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Can we add some documentation on previous networking issues and the Om5p radio specifically? In general it's worth asking if we want to maintain support for it and its quirks. I remember something about ipv6 issues?

@crschardt

crschardt commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

If we want to avoid IPv6, we can configure the connection like this:

# 1. Keep the standard DHCP configuration active
nmcli connection modify "<con-name>" ipv4.method auto

# 2. Allow link-local (169.254.x.x) only when no DHCP IP is present
nmcli connection modify "<con-name>" ipv4.link-local fallback

# 3. Tell NM that an outstanding DHCP request is allowed to stay unfulfilled
nmcli connection modify "<con-name>" ipv4.may-fail yes

# 4. CRITICAL: Avoid protocol timeout errors that cause interface resets
nmcli connection modify "<con-name>" ipv4.dhcp-timeout infinity

# 5. Completely disable IPv6 to match your requirements
nmcli connection modify "<con-name>" ipv6.method disabled

# 6. Set connection auto-activation retries to infinite loop mode
nmcli connection modify "<con-name>" connection.autoconnect-retries 0

I used Google Gemini to help formulate this and I've been testing it with good results. I can swap between being connected to my router and being connected directly to my computer and the coprocessor remains reachable.

Here's the explanation provided by Gemini:

Using ipv4.dhcp-timeout infinity is the precise trick here: it instructs the internal DHCP client to keep requesting an IP address forever in the background without throwing a fatal protocol error. Because it never explicitly "fails", NetworkManager won't cycle the link or strip your fallback IP address.

I think that the reason enabling IPv6 also works is that it prevents the IPv4 DHCP timeout from triggering the network reset, essentially doing the same thing as setting the timeout to infinity.

@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

I think a weird thing about FRC networking is that the field DHCP server often isn't accessible when the wired link is established due to the wireless startup time. Most of our networking testing does not cover this frequently encountered scenario.

@thatcomputerguy0101

Copy link
Copy Markdown
Contributor Author

Actually, I forgot that a range of addresses is reserved for on-radio DHCP to hand out, but it still doesn't hurt to check that deferred DHCP availably works correctly.

@thatcomputerguy0101 thatcomputerguy0101 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm. Using ipv4.dhcp-timeout infinity behanves the same as ipv6.method link-local with respect to the ipv4 behavior. A link local address is obtained after the first DHCP failure and removed once DHCP succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Things relating to photon-core and photon-server documentation Anything relating to https://docs.photonvision.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link-local IPV4LL support

4 participants