Re: [yang-doctors] Definition for base64

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 17 August 2018 19:03 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 040C2131002 for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 12:03:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 UIwiaeDwh3Bc for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 12:03:53 -0700 (PDT)
Received: from anna.localdomain (anna.eecs.jacobs-university.de [IPv6:2001:638:709:5::7]) by ietfa.amsl.com (Postfix) with ESMTP id 9617D130FC8 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 12:03:53 -0700 (PDT)
Received: by anna.localdomain (Postfix, from userid 501) id 595AC241A37A; Fri, 17 Aug 2018 21:03:51 +0200 (CEST)
Date: Fri, 17 Aug 2018 21:03:51 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Mahesh Jethanandani <mjethanandani@gmail.com>
Cc: Andy Bierman <andy@yumaworks.com>, YANG Doctors <yang-doctors@ietf.org>
Message-ID: <20180817190351.s2eqmn3at6qb2j3j@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Mahesh Jethanandani <mjethanandani@gmail.com>, Andy Bierman <andy@yumaworks.com>, YANG Doctors <yang-doctors@ietf.org>
References: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com> <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com> <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com>
User-Agent: NeoMutt/20180716
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/WFswYUXCdlv85FsbAyic_mi_4L0>
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:04:03 -0000

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
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/>