Re: Globally Unique Link Local Addresses (Re: about violation of standards)

Brian E Carpenter <brian.e.carpenter@gmail.com> Wed, 24 April 2019 20:46 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B4ABE120424 for <ipv6@ietfa.amsl.com>; Wed, 24 Apr 2019 13:46:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yjk-iGSUfqmz for <ipv6@ietfa.amsl.com>; Wed, 24 Apr 2019 13:46:44 -0700 (PDT)
Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AA24E120409 for <ipv6@ietf.org>; Wed, 24 Apr 2019 13:46:44 -0700 (PDT)
Received: by mail-pf1-x444.google.com with SMTP id e24so9900470pfi.12 for <ipv6@ietf.org>; Wed, 24 Apr 2019 13:46:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I90+/mQeqBM58h8W/y4zV/FxyGfMeXFib3Ng+/nTFt4=; b=oOSgkfmvQ6KE8OpTug/EoVARy+/xkzShoKz3QJaoc7iwtELREkijBofPpJViAk95Uj xYGwvQMCZrBTfEsKmeAu1tK48ixRSY7WC5HXTmBSIFSCf5LZcLLuJWWbGJbbajYR9KX8 kyxYeZ5fqGn0xNvFYfpJB7WimQfQ0EVQ+MOv+wm7PEGQgdoEV55dsncI577v/tac41Pv wqpb0tUvESUsDxVvPMjg/M7AVlUtNb9PmZWZCdV5EnABU/ClQ3RaXunUwq3etPvxMwwz /Pr9AMf1AV9UF8fgwkHGEGsBZP2dd04h7nx58wA35Rf4GSFgChBNsBVgvvfwcL3chfr9 cBDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I90+/mQeqBM58h8W/y4zV/FxyGfMeXFib3Ng+/nTFt4=; b=QTKNRBtk52tGZf4EquMBpZyqgyqN4lECm78bUVYC4fEOpl0NTxhVWg+rEZItTciNaG 6M5msCM2XajKGoCezbr5TJDrqTxDHjR0l81BO5iOnE/M1TFMZb8bTkzCy5sKObRBwbau J+tghdfqQ6GrnRXr5C2R4UrRl83YY6RaMAePIBS+54v5LtIzC1MZoXUqGWNSClYBkN2e B979XLzDUcP4TzetTyTTx3RV+6MIX66FqDpJN2U3jhZyAjQHepvRQehsofMgb22qPDWO fpy7lN6JZ3dZbcCdpjydFuSzacfJhJgK1JCwJXGh+pAWyVMWTEJ58G1fZziE2x8PbW8y RjjA==
X-Gm-Message-State: APjAAAWL0waCqiCOKI947U3u29yX6EuYroAJja+kthdL5h7JkcIRilrx ffiweqEKpOqqsVl54T9Jr14=
X-Google-Smtp-Source: APXvYqziVNDfu9bh1hml2nDijkT8xoz35B6efLJYrl0r4yds1954Qaf+hRAxZjV3WM1AZS13tzi3og==
X-Received: by 2002:a63:3dc8:: with SMTP id k191mr32491513pga.286.1556138804171; Wed, 24 Apr 2019 13:46:44 -0700 (PDT)
Received: from [192.168.178.30] ([118.148.72.205]) by smtp.gmail.com with ESMTPSA id l15sm4711600pgb.71.2019.04.24.13.46.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 13:46:43 -0700 (PDT)
Subject: Re: Globally Unique Link Local Addresses (Re: about violation of standards)
To: Mark Andrews <marka@isc.org>, Mark Smith <markzzzsmith@gmail.com>
Cc: Fernando Gont <fgont@si6networks.com>, "Pascal Thubert (pthubert)" <pthubert@cisco.com>, 6man WG <ipv6@ietf.org>, 神明達哉 <jinmei@wide.ad.jp>, Alexandre Petrescu <alexandre.petrescu@gmail.com>
References: <bb7f7606-2adf-e669-8bcd-e41f17800782@gmail.com> <CAJE_bqd9frqX5-yeVPj8MYXpZ4737HqK1gmfD9cQV3A-Ea5HrQ@mail.gmail.com> <6bd5db47-408a-727e-5c13-f34a3465f986@si6networks.com> <CAJE_bqfTLqRbLp4fLu2ASZuZ+4G5c2G+RXkO92kXfLgPTqBnng@mail.gmail.com> <EEF00EA7-2AAF-403F-99AD-1D53ED18E8B3@cisco.com> <47631828-121F-402D-8165-969684C1101B@employees.org> <CAO42Z2wbq=8f6FfR7DoOOFrY7B5puxS26Dk+SsM71Pk7y03ipQ@mail.gmail.com> <afa6e0e2-0a31-53f0-0f41-5e24c81405da@gmail.com> <CAO42Z2zoQtAqzT+v2XYequuWysrLo+WOG8Ou=asRMakQHuS-Pg@mail.gmail.com> <CAJE_bqcJZxWd1ZH8u0rqK5PfwNK9qqmw9O-7=u6Tpu_UTF7-Aw@mail.gmail.com> <CAO42Z2wimfJexfUfs+mfo6Cs8simv9XyTqCaU49VDaSqBG-BxQ@mail.gmail.com> <887AC8E6-2955-4AB0-9F9E-A20BC93E098C@isc.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <51ed40e7-145c-5076-97e1-d445625a5abf@gmail.com>
Date: Thu, 25 Apr 2019 08:46:39 +1200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <887AC8E6-2955-4AB0-9F9E-A20BC93E098C@isc.org>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/R6aA8Za2ljzRUB-q8ZZG5ZIGyAY>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <ipv6.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipv6>, <mailto:ipv6-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipv6/>
List-Post: <mailto:ipv6@ietf.org>
List-Help: <mailto:ipv6-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipv6>, <mailto:ipv6-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Apr 2019 20:46:54 -0000

getaddrinfo() also does the job in Winsock2.

(For Python programmers, there are subtleties depending on
O/S version and Python version. If you care:
https://github.com/becarpenter/graspy/blob/master/acp.py )

Regards
   Brian

On 24-Apr-19 18:04, Mark Andrews wrote:
> getaddrinfo() does in most implementations as it returns a pointer to a
> struct sockaddr_in6 which have a sin6_scope_id field.  inet_pton() deals
> with the part to the left of the % symbol.
> 
> From various getaddrinfo man pages.
> 
> MacOS:
> 
>      This implementation of getaddrinfo() allows numeric IPv6 address notation
>      with scope identifier, as documented in section 11 of RFC 4007.  By
>      appending the percent character and scope identifier to addresses, one
>      can fill the sin6_scope_id field for addresses.  This would make manage-
>      ment of scoped addresses easier and allows cut-and-paste input of scoped
>      addresses.
> 
>      At this moment the code supports only link-local addresses with the for-
>      mat.  The scope identifier is hardcoded to the name of the hardware
>      interface associated with the link (such as ne0).  An example is
>      ``fe80::1%ne0'', which means ``fe80::1 on the link associated with the
>      ne0 interface''.
> 
>      The current implementation assumes a one-to-one relationship between the
>      interface and link, which is not necessarily true from the specification.
> 
> Linux:
>      Notes
> 
>      getaddrinfo() supports the address%scope-id notation for specifying the IPv6
>      scope-ID.
> 
> 
> Mark
> 
>> On 24 Apr 2019, at 3:12 pm, Mark Smith <markzzzsmith@gmail.com> wrote:
>>
>>
>>
>> On Wed., 24 Apr. 2019, 14:01 神明達哉, <jinmei@wide.ad.jp> wrote:
>> At Wed, 24 Apr 2019 13:28:48 +1000,
>> Mark Smith <markzzzsmith@gmail.com> wrote:
>>
>>> However, the drawback of using LL addresses is that each application
>>> has to be written to specifically handle them viasin6_scope_id.
>>
>> This is not entirely accurate.  Section 11 of RFC 4007 exists exactly
>> for this purpose.  And, in fact, applications like ssh can perfectly
>> work for a link-local destination even on a multi-link host even if
>> the application (ssh client) doesn't do anything special for
>> link-local address:
>>
>> % ssh fe80::1%lo0 'echo ok'  
>> ok
>>
>>
>> So what Sockets API function converts "fe80::1%lo0" into a populated sockaddr_in6 structure including sin6_scope_id?
>>
>> inet_pton() only deals with and returns addresses, so it seems you have to write additional special case code that handles the % zone suffix.
>>
>>
>> It's true that *some* applications may still need to handle link-local
>> addresses as a special case, though.
>>
>>> I understand that one of the motivations for Link-Local addressing was
>>> the "dentist's office" scenario i.e. non-technical, plug and play, "it
>>> just works" networking. Having to have specially adapted applications
>>> to suit that that scenario is pretty contradictory to that goal.
>>
>> I wouldn't expect a dentist to type in a textual link-local address
>> (or for that matter, perhaps any textual IPv6 address) anyway.
>>
>> So my thoughts have been that things like MDNS would also return the zone information for a LL address to the resolver, although I haven't looked into whether it does or not.
>>
>> I still see that it would be simpler if interface or zone information was effectively embedded in the LL address, as it is in GUA and ULA addresses, using the, transparent to the application, node's route table to resolve and determine the ingress/egress network link interface.
>>
>>
>>   In
>> this context it's more about a higher level problem than
>> scope-awareness of the application.  It would have to use some kind of
>> zero-config service discovery library with sophisticated user
>> interface.  That "library" may have to be aware of the concept of
>> scoped addresses more explicitly, but the application would be more
>> likely to be agnostic about it.
>>
>> --
>> JINMEI, Tatuya
>> --------------------------------------------------------------------
>> IETF IPv6 working group mailing list
>> ipv6@ietf.org
>> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
>> --------------------------------------------------------------------
>