Re: [Cbor] I-D Action: draft-ietf-cbor-network-addresses-04.txt

Brian E Carpenter <brian.e.carpenter@gmail.com> Sun, 25 April 2021 21:12 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C87A33A103C; Sun, 25 Apr 2021 14:12:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, 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 ITQ0kz8K57AC; Sun, 25 Apr 2021 14:12:32 -0700 (PDT)
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (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 771C83A103A; Sun, 25 Apr 2021 14:12:32 -0700 (PDT)
Received: by mail-pl1-x630.google.com with SMTP id g16so10986869plq.3; Sun, 25 Apr 2021 14:12:32 -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=HJ0+l7gQn64dYW9XkdG1+2WkbNdYSAUovAqsre8/Ydg=; b=V0Jc7U8H6dkXLEWlLATjVUKgajJkqnESTrmANbGL61zi8rbKQrksc0sqbXnA43A1rq d5F9Lj2x+wuMDNbnRYEjey+uoSKwdxRb74AjuScapd6X9/N/QgsFWDerMD7mk4dUfkTH SJDJIUlDXIS2OLuxG+le6ksSB3HtWiIwhIZLlel3MEnPy75udZojPefMlvqlJF6lGfxf +Xc2+wTNd31MXd/hUmGZoXxnhFfgRksJYiqqKMb68s2Ia8B7fniQb8NMOVHDDXbZkzUC K2NTUkMXZ1AOYS0uOLHxxnfav17G25l5RLDAQE5lnkkmAAX2DpHR8FUqH13aWf/6TS9f 5H3g==
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=HJ0+l7gQn64dYW9XkdG1+2WkbNdYSAUovAqsre8/Ydg=; b=UCM222SMrFSj/qCco3A3IzEBMaHmf40zjzSwlwfgh8eMgXVUuBcMbX5ySexw3TmCZd tt49b2ieXVuYfXCfCsrsFMCIZBb7TTyUDl1NqDUFaiDL43XBL+gSI23Yp/uqGydhuxBL lfYo3fRMyI8GnaVq7MNBYLIH8yswyDAQ+HWs26Hs/BAKegitIdPmAmJ/2y3rxgwROJox VmhgNgXfwd3oE/m7ooxWSh7z/53YXu3KPiLMAnlkp86Ow1MQPxTBGn7wftUKpUBOZGSd w5b5sVY9FBlYyLS+AAHRGg9utI4XMH+Nv2U6wYrke8pe3xssFU1IMJ9jMAIozXXhHbHL nCcg==
X-Gm-Message-State: AOAM533RuOOmocqJ4dmw9lBh0yIUWW2rPvSEH5xa7w1xNFlZ++EEl5HN Cl3wvHIyYhWEHlNb08Tl2+dHC0AWMJkBXQ==
X-Google-Smtp-Source: ABdhPJxezWvecQjvb0mLTdgVDwjXkxl5s+/AUByH6bSbqdrHqm3sWyd5UtiSuYNj3wwsgf9CzFpx/g==
X-Received: by 2002:a17:902:7c17:b029:ec:bfde:23e2 with SMTP id x23-20020a1709027c17b02900ecbfde23e2mr15074008pll.33.1619385150828; Sun, 25 Apr 2021 14:12:30 -0700 (PDT)
Received: from [192.168.178.20] ([151.210.131.14]) by smtp.gmail.com with ESMTPSA id 23sm9533124pgo.53.2021.04.25.14.12.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Apr 2021 14:12:30 -0700 (PDT)
To: Carsten Bormann <cabo@tzi.org>, Ole Troan <otroan@employees.org>
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, 6man@ietf.org, cbor@ietf.org
References: <12496.1619216560@localhost> <C3A4A868-4B39-4428-93AA-D0B88F79B9BD@employees.org> <5989D772-0104-4F12-A43B-AFBC77266C9C@tzi.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <647a725f-69a8-43bd-0500-0e382dc50a5f@gmail.com>
Date: Mon, 26 Apr 2021 09:12:24 +1200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <5989D772-0104-4F12-A43B-AFBC77266C9C@tzi.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/cbor/jvZ4aYRlamTsMA4kV1UTARzNzqc>
Subject: Re: [Cbor] I-D Action: draft-ietf-cbor-network-addresses-04.txt
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 25 Apr 2021 21:12:37 -0000

On 26-Apr-21 03:30, Carsten Bormann wrote:
>> - for 261 I would at least include those arguments and make it clear when to use or the other
> 
> Sounds good to me.
> 
>> - so you don’t want to support the commonly used shortcut of specifying both and address and a prefix in one?
> 
> That is a valid point.
> But I think the data should indicate whether they are just a prefix or an address and a prefix.
> 
>> - in ip agnostic code I often find I just need an IP address instead of having to care if it’s 4 or 6. It would therefore be nice with a general IP address and ip prefix type too. 

This is very dependent on the context where you are using the address. Sometimes you need to be address-family independent and sometimes not. It can also be programming-language dependent. And it can be API dependent (who are you passing the address to?). So I think this will have to be handled by the parser of the decoded CBOR, not by the CBOR tagging.
 
> If I understand this right, we already have that.  One type with two different tags…

Yes, and how you cast it into a particular language's type(s) is not a CBOR issue.

> (CBOR doesn’t have “types” [except for the “major types” on the representation level].  You are free to construct your own types in your implementation, e.g. construct a “Boolean” type from “true” and “false”.  In your case, the “IP address and prefix” type would include values with either tag 52 or 54.  We could define recommended CDDL types, like we did in Section 5 of RFC 8746...)

Sure. But in GRASP we ended up with 
  ipv4-address = bytes .size 4
  ipv6-address = bytes .size 16
which wouldn't suit every case. 

Regards
    Brian

> 
> Grüße, Carsten
> 
> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> ipv6@ietf.org
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------
>