Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 6 years ago

Last modified 6 years ago

#562 accepted enhancement

Source and destination address selection

Reported by: Jiri Svoboda Owned by: Jiri Svoboda
Priority: major Milestone:
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

If you try to connect to or ping a host that has an AAAA DNS record (e.g. google.com), we will always try to use that regardless whether there is any (global-scope) IPv6 address configured. Thus on a host with only IPv4 connectivity this will fail.

There are cases where we are faced with several alternatives for both source and destination address, such as:

  • IPv4 vs IPv6
  • link-local vs. global-scope address (both IPv4 and IPv6)

We need to devise some strategy for proper selection of source and destination address. For inspiration how this problem can be approached see

(I don't think it's necessary to implement *exactly* this way, i.e. we don't necessarily need a configurable policy table).

Change History (3)

comment:1 Changed 6 years ago by Jiri Svoboda

Owner: set to Jiri Svoboda
Status: newaccepted

comment:2 Changed 6 years ago by Jiri Svoboda

Proposed strategy:

  • Choice of destination address is in the resolver (i.e. it returns the preferred address)
  • Only send DNS query for v6/v4 address if any v6/v4 address, resp., is reachable, i.e. any v6/v4 address or route is configured (v4-only host will not send v6 queries, v6-only host will not send v4 queries)
  • From the replies, filter out addresses to which we cannot determine a route
  • If the destination can be reached via both v6 and v4, prefer v6
  • Routing mechanism needs to be taught about link-local addresses: a destination that is not directly reachable (i.e. only reachable via a router) can only be reached if we can contact the router from a global-scope address

comment:3 in reply to:  2 Changed 6 years ago by Martin Decky

No major objections, only some comments:

  • Only send DNS query for v6/v4 address if any v6/v4 address, resp., is reachable, i.e. any v6/v4 address or route is configured (v4-only host will not send v6 queries, v6-only host will not send v4 queries)
  • From the replies, filter out addresses to which we cannot determine a route

There should still be some "unfiltered" DNS query mode. For testing purposes and for cases when the client wants to implement its own address selection policy.

  • Routing mechanism needs to be taught about link-local addresses: a destination that is not directly reachable (i.e. only reachable via a router) can only be reached if we can contact the router from a global-scope address

It might be helpful to introduce the concept of address scopes to the networking stack to achieve this. http://en.wikipedia.org/wiki/IPv6_address#IPv6_address_scopes

Note: See TracTickets for help on using tickets.