Skip to content

Avoid routes using transports between visors at the same IP address #2203

@0pcom

Description

@0pcom

When two visors share the same public IP address (e.g., on the same LAN behind NAT), transports between them should be handled specially to avoid suboptimal routing: Routes that include hops between same-IP visors create unnecessary loops

Current State

  • The Address Resolver already detects same-IP visors and sets IsLocal: true in VisorData (see pkg/address-resolver/api/api.go:307-309)
  • The transport network client uses this flag for connection optimization
  • However, the Transport Discovery (TPD) does not store or expose this information
  • Local route calculation has no awareness of same-IP transports

Proposed Solution

  1. TPD: Add is_local or same_ip flag to transport entries (don't modify /all-transports ; only /metrics)
    - At registration time, TPD could query AR for both edges' IPs and compare
    - Or accept the flag from the registering visor
  2. Route calculation: Filter or deprioritize same-IP transports
    - Route finder should exclude these from routes to external destinations
    - Local route calculation should do the same
    - Routes including transports between visors at the same public ip address could still be used when the destination is on the same IP or at user discretion - but by default not used.

Related

  • VisorData.IsLocal flag: pkg/transport/network/addrresolver/client.go:74
  • Same-IP detection: pkg/address-resolver/api/api.go:307-311
  • Transport Entry struct: pkg/transport/entry.go:33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions