Re: [yang-doctors] Definition for base64

Andy Bierman <andy@yumaworks.com> Fri, 17 August 2018 19:14 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5910F130F9C for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 12:14:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 BEMsMm_Dao-i for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 12:14:26 -0700 (PDT)
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 D759E130DC3 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 12:14:25 -0700 (PDT)
Received: by mail-lf1-x12d.google.com with SMTP id j8-v6so6630513lfb.4 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 12:14:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=WVuzVSlOuMd0f2RNY0BEUb2W1WHvqn7ExJGaA+tUj28=; b=Cdt2+aLUEyFIca4cC0+8ZegbTi8N8LLxcVgB7RlI0byq40iOIKA0kx9b0dAlTUzRh5 1HxG22meoPRCUGqW0PCFG2g7ZfXkBOL2aaEZ4FmW9ore2nDSwjC/zD1ajLvLlJb7X5zf 5V0Kik40bxI6rFZ1L9mfKJzietVRki3wMHXs+SOnLoWQaJqlO8L4PTEiHK6dSrTgWmeU RraoG3INs7GIFWCBA3/JnnXLqLPn7LgSjtUJfdGEiOavlE7U6LNF7yI1u8P9IHccf/PQ wdt+t8vvTMQVGLrsP3DcvYuapDZG81eTKk+VPWJQr1p0orQUE6qgw+0WvZj+BTnG0Izp Md8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=WVuzVSlOuMd0f2RNY0BEUb2W1WHvqn7ExJGaA+tUj28=; b=MnkT4ZAiPJ90AdNksqm/SiuWnNcftrxM1A+tqqPIGy2K3mGqUf1pU6+QkSaWwBsIJ6 fol560nc/mob2vwuXYVOG3Ko+TVvEZCZOelDSm9abVRki13j/+BzW4vU6cRGNXYwWb9Z 3qEjR26Hk3qJjdKOaPsZ+2KGKX0NhGfODpyAmm/zKCjc+9eJPST551Xy+zBVUQpWD36k wW7F/Ni/hTwbeeCqXwqeX+QqJ3TFVVmVfgUR6MIsRZhEs2hWjH3eEAloffVhjSheQ8NS JmeBjZlAQ7XjAwoUT1xqF+WsUl2UT0Dkl4MZS8zhrNBXcEiBEXpsf+xLCfrUs2+kUGN0 48Cw==
X-Gm-Message-State: AOUpUlHILPm6tJyt9bpZHdOlTPQbNEfwor1ECGOKImChBzhi27+QbLzL 4BQm+EfZeMewWR9k+eHHRA0peBWJAQmUSAqzLAS5zg==
X-Google-Smtp-Source: AA+uWPwkPcP92z2oUtkQz5Nk1ZuXtUg81AnmNHydvORQFiZtF0RKGGvJTrOndPIkNhDoFR7d90LtgobZWOrtiCxj/K0=
X-Received: by 2002:a19:f50d:: with SMTP id j13-v6mr22313511lfb.127.1534533264030; Fri, 17 Aug 2018 12:14:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a19:aa46:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 12:14:23 -0700 (PDT)
In-Reply-To: <20180817190351.s2eqmn3at6qb2j3j@anna.jacobs.jacobs-university.de>
References: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com> <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com> <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com> <20180817190351.s2eqmn3at6qb2j3j@anna.jacobs.jacobs-university.de>
From: Andy Bierman <andy@yumaworks.com>
Date: Fri, 17 Aug 2018 12:14:23 -0700
Message-ID: <CABCOCHRDZ98-ZjaeK_oDCt6tDBU+Op-6reZOVCPPFwJnVExbJA@mail.gmail.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Mahesh Jethanandani <mjethanandani@gmail.com>, Andy Bierman <andy@yumaworks.com>, YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000195d690573a65e0a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/SoQXPAlYfcV-tp9yB9yMQbcgSs4>
Subject: Re: [yang-doctors] Definition for base64
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Aug 2018 19:14:28 -0000

On Fri, Aug 17, 2018 at 12:03 PM, Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> On Fri, Aug 17, 2018 at 10:46:55AM -0700, Mahesh Jethanandani wrote:
> > I have a protocol (Babel) that defines router-id as a base64 string of 8
> octets. I could define it as a string, but isn’t it the case that base64
> includes only a set of printable characters defined by the regex below? Not
> all printable characters are included in the set.
>
> RFC 6126 section 4.1.2 says:
>
> 4.1.2.  Router-Id
>
>    A router-id is an arbitrary 8-octet value.  Router-ids SHOULD be
>    assigned in modified EUI-64 format [ADDRARCH].
>
> Where does it say that it is a string on 8 octets base64? Note, if you
> use binary with length of 8, you actually get a base64 encoding on the
> wire. But then there might be another doument that says the router-id
>

IMO the correct YANG data model would use type binary { length 8; }


Andy

is to rendered as base64 but then the base64 string obviously is
> longer than 8 octets. If you work off the information model, then I
> might understand that you are confused because
> draft-ietf-babel-information-model-03 says:
>
>    base64      An opaque array of bytes.
>
> What is that? Does this mean a base64 encoded opaque array of bytes?
> Or something else? I would check how babel people and implementors
> prefer to represent router-ids in textual format. Do they really
> want trailing characters?
>
>   import base64
>   print(base64.b64encode(bytes(8)))
>
> Gives me:
>
>   b'AAAAAAAAAAA='
>
> /js
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
>