Skip to content

runtime: run periodic ipv4 stuns for public ip#234

Open
npry wants to merge 2 commits into
mainfrom
npry/runtime.stun
Open

runtime: run periodic ipv4 stuns for public ip#234
npry wants to merge 2 commits into
mainfrom
npry/runtime.stun

Conversation

@npry

@npry npry commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

stacked on #214

Provide an actor that runs periodic stuns to a derp server to get our public ipv4 and publishes the response on the message bus.

Nothing currently consumes the messages, but this is needed for future commits re: direct connections. In the future the internals may change slightly to reuse the single UDP endpoint socket rather than using a dedicated stun socket, but this should be fine for now.

@dylan-tailscale dylan-tailscale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, just one TODO to implement (correct me if I misunderstood the intent)

Comment thread ts_runtime/src/stunner.rs Outdated
Base automatically changed from npry/netmon to main June 13, 2026 10:30
@npry npry force-pushed the npry/runtime.stun branch 6 times, most recently from 64e0ef3 to 2859a7a Compare June 18, 2026 13:13
@npry

npry commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

fyi tqwewe/kameo#340, it's not blocking, just a rabbithole i went down because of this

Nothing currently consumes the messages, but this is needed for future
commits re: direct connections. In the future the internals may change
slightly to reuse the single UDP endpoint socket, but this should work
for now.

Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: Idc9dadd16a203188ab4138944fb8a6b56a6a6964
@npry npry force-pushed the npry/runtime.stun branch from 2859a7a to 3f428c6 Compare June 18, 2026 18:06
@npry npry requested a review from dylan-tailscale June 18, 2026 18:08
Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: If8cbc4db87ca78c3404af9a3f50846596a6a6964
@npry npry force-pushed the npry/runtime.stun branch from 3f428c6 to dcb473a Compare June 18, 2026 18:13

@dylan-tailscale dylan-tailscale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm! just one question

Comment thread ts_runtime/src/stunner.rs
.tell(
kameo_actors::scheduler::SetInterval::new(
slf.downgrade(),
Duration::from_secs(20),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Non-blocking: would we ever want to configure the STUN interval at runtime? I can come up with wacky cases, but none that would require a faster period than 20 seconds.

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

Successfully merging this pull request may close these issues.

2 participants