Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2021 06:40:45 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Zhenlei Huang <zlei.huang@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Are there any RFCs for address selection for IPv4
Message-ID:  <202104251340.13PDej0b093486@gndrsh.dnsmgr.net>
In-Reply-To: <D66C20B9-24FA-4557-96F0-90E56B982150@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Hello hackers,
> 
> For IPv6 there's RFC 6724 to clarify the default address selection procedure, 
> both for source address selection and destination address selection. Are there
> any RFCs like RFC 6724 that are for IPv4? 

The important difference I think here is that in IPv6 it is very normal to
have both a link local and a routable IP address on an interface.  RFC 3927
speaks to this for IPv4 with:
   IPv4 Link-Local addresses are not suitable for communication with
   devices not directly connected to the same physical (or logical)
   link, and are only used where stable, routable addresses are not
   available (such as on ad hoc or isolated networks).  This document
   does not recommend that IPv4 Link-Local addresses and routable
   addresses be configured simultaneously on the same interface.

Though technically you have not put a global uniq unicast address on the
outbound interface the fact your trying to route one via that interface
to a loopback interface puts you  into the situation your attempting
to route global IP over a link local address.  
> 
> I'm exploring RFC 3927, consider this situation, a host configured with link-local
> address on NIC and global unicast alias address on loopback interface, and default route to 
> the link-local address of router (some ISPs do this). The current implementation kernel
> will use the link-local address as the source address when initializing a connection to 
> remote host via the default route. It seems wrong, as link-local address are not 
> routable as per RFC 3927.

So your wanting the kernel to pick a source address on another interface
for a packet going out a different interface, that is what seems wrong.

Though I think this could be solved by applying a technique used in
routers, and that is the concept of a host specific globally routeable
IP address that should be used for all non-local packets.  This is useful
in complex multipath networks as the router is always accessable via
that IP address no mater which interfaces are routing packets correctly
as long as the routing protocols are maintaining a path to it.

But before going down that road, why are you putting your desired globally
routeable IP address on lo0 and not on the upstream interface which would
eliminate this problem?  Is it because you have a complex multipath network,
or is it from an attempt to save some global IP's that would be needed
to run these on the link?  Or?

> 
> So it is important if there's corresponding RFC clarify the source address selection 
> for IPv4.

I do not believe you well find anything that speaks to this issue for IPv4, as
your not really in the situation of RFC6724 which has to do with multiple IP
addresses on the same interface.

> Thanks :)
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"

-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104251340.13PDej0b093486>