Skip to content

plumb ICMP into magicsock and where appropriate pass to overlay network #9480

Open

Description

@raggi

I observed a case where a remote endpoint was returning ICMP destination unreachable, but magicsock is unaware, and could become so.

This can be achieved for example on linux by setting IP_RECVERR and reading the error message queue in the receive path. There are additional behaviors to consider, but that are also advantageous in doing so, for example observing ENOBUF when expending the send capacity of the system, a condition which we would do well to at least monitor if not apply backpressure.

Example issues that can be addressed:

  • Cause immediate rather than hours later TCP socket teardown when a peer goes away
  • Cause immediate notification on UDP transports when a peer goes away
  • Pass packet too big from outer to inner layer to make pmtud work where available on host systems
  • Manifest ICMP for too big packets arriving at TUN from the host system

Activity

  1. raggi commented on Sep 20, 2023

    @raggi
    MemberAuthor
  2. self-assigned this
    on Sep 21, 2023
  3. jwhited commented on Jan 22, 2024

    @jwhited
    Member

    magicsock is already pretty sensitive to changes in UDP best path reachability via its heartbeating mechanism: https://github.com/tailscale/tailscale/blob/v1.58.0/wgengine/magicsock/magicsock.go#L2757-L2759. Therefore, we are not considering this/packet too big handling a blocker of PTMU-related work. We do need to ensure heartbeats are sized to the the path MTU that's in use to make that same sensitivity apply for non-default path MTU. cc @clairew @sailorfrag

  4. changed the title [-]plumb ICMP host destination unreachable back to endpoint selection in magicsock[/-] [+]plumb ICMP into magicsock and where appropriate pass to overlay network[/+] on Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions