Re: Is 1111 1110 10 equal to 0xfe80 or 0x3fa?

Fred Baker <fredbaker.ietf@gmail.com> Fri, 07 June 2019 17:53 UTC

Return-Path: <fredbaker.ietf@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 D6AA912007C for <ipv6@ietfa.amsl.com>; Fri, 7 Jun 2019 10:53:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 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_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 1QPLn4c78vlY for <ipv6@ietfa.amsl.com>; Fri, 7 Jun 2019 10:53:32 -0700 (PDT)
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (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 17E13120104 for <ipv6@ietf.org>; Fri, 7 Jun 2019 10:53:31 -0700 (PDT)
Received: by mail-pf1-x430.google.com with SMTP id j2so1602305pfe.6 for <ipv6@ietf.org>; Fri, 07 Jun 2019 10:53:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=DAfEGzy6oU3JLS6czIYfq5DImlY7eNGH6DkGNmodxTo=; b=ttYAAx7n/nvbQYQr6WIkVZQOBXIeqN6FhUh0Ey9vH52EkmucBebCBG0xr5OVh4TcpI QHFSqFxaiQDlEHDTs8Cpc3sydQ5R+gMLovY7XJUyOb+WvuLn5dJmo+gAUdok9PHSRsJ/ WvwCYBZ0GjUU7cdfDVeAOHdqxpO+8OawudA3hp1qI//GjMR0Ndc/2JONFBPmdXjcXKg0 YUDJIrtOXuMED+aXUE2X6vY/J7ehQTrfntFTxhd/dEp3LSPYQ15vrM3J/kynbfL4K6r3 y7tri7MAxEiQuUkRTmZ5cbysLWG9GmlrghSkF/A1A5EStXqhoIvn7JM9+2wGZwegoaSl 9ntA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=DAfEGzy6oU3JLS6czIYfq5DImlY7eNGH6DkGNmodxTo=; b=HTNsm/k6XfBmfjHC0TNtx2/KDuw7Z5kfu9nDfyapIKkZhvC/fACSxxGIHUHjRyXq7C x/KYBMVb0wrK8l/fNRcp+Y3gnnHpehfJuO9sL1Xz7XkvEqEq+drNTmznVYHOZGQNtiHe 7vY92344CuVSy7/R3zIS6XrLF9vkqZnBgXACxLXuAGS8UHXdH2hEirY8TZARFyWqAo4F wwDxCzHUkQ9klsPKppijKGjcsMlSQ3HCOKdOiKCr2iL/+pyLa1fBg6QLYSqPoXHJon3k CgFvdvyKztLJDqCJfD2VM4iUMLZZ207iJQlXilh649MTVbDh/Gve+7oCwTMjAOagmkwl iajQ==
X-Gm-Message-State: APjAAAWT4V8aowWPsnZDWfJONQ4OctwCh3W96jvktWEv8uF76h7KeWc0 rFdSg0fo838+nLa4rgLZIQ8=
X-Google-Smtp-Source: APXvYqwPgnV4PqE+JWUfR2ZRlVYG4lFcQJqvmsQU3pzL7o2gE5pVqRDTjMIq7Us5GWIGoTScRQE+fQ==
X-Received: by 2002:a62:1993:: with SMTP id 141mr58440617pfz.97.1559930010621; Fri, 07 Jun 2019 10:53:30 -0700 (PDT)
Received: from ?IPv6:2600:8802:5903:df16::1006? ([2600:8802:5903:df16::1006]) by smtp.gmail.com with ESMTPSA id b15sm4619923pff.31.2019.06.07.10.53.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 10:53:29 -0700 (PDT)
From: Fred Baker <fredbaker.ietf@gmail.com>
Message-Id: <A722E202-7671-4111-BA92-8A67B3D3B924@gmail.com>
Content-Type: multipart/signed; boundary="Apple-Mail=_5FD91D73-FE6B-4FB9-9B54-A45A43D07338"; protocol="application/pgp-signature"; micalg="pgp-sha512"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Subject: Re: Is 1111 1110 10 equal to 0xfe80 or 0x3fa?
Date: Fri, 07 Jun 2019 10:53:28 -0700
In-Reply-To: <c57bc938-d151-a96d-7ea6-efca7a48648b@gmail.com>
Cc: IPv6 <ipv6@ietf.org>
To: Alexandre Petrescu <alexandre.petrescu@gmail.com>
References: <a71b00b7-0e0c-242a-b3f7-147f4c6b2eb0@gmail.com> <D05C857F-42F6-4F17-8520-A0BF4C8FB775@steffann.nl> <c57bc938-d151-a96d-7ea6-efca7a48648b@gmail.com>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/CdyHRqSGjCi8SzQSt1AVb4Dxf2o>
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: Fri, 07 Jun 2019 17:53:35 -0000


> On Jun 6, 2019, at 10:55 PM, Alexandre Petrescu <alexandre.petrescu@gmail.com> wrote:
> 
> Is it wrong to write that 3fa::/10 is the link-local prefix?

Which is to say that the bit pattern is 0000 0011 ffff 1010, and the prefix is the first ten bits (0000 0011 11) of that? If that's what you intend, no, it's not wrong. If you are thinking in terms of https://tools.ietf.org/html/rfc4291#section-2.5.6, there is no way that would work. It doesn't conform to https://tools.ietf.org/html/rfc4632 (which only uses IPv4 examples, but IPv6 works the same way).

Here's a simple way to think about this that might help you get your head around it. Let's imagine I have a prefix 2001:db8::/32, and I want to divide it into two 33 bit prefixes. What are they? 2001:db8:0000::/33 and 2001:db8:8000::/33, of course. It turns around the next bit.

If I have prefix fe80::/10, as described in RFC 4291, the next bit is bit 11. Doing the same subdivision of the prefix is fe80::/11 and fea0::/11.